Skip to content

Commit

Permalink
Introduce jupyter notebook format (ipynb) (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
rgbkrk authored and KyleAMathews committed Sep 22, 2016
1 parent 9749910 commit e7cec1e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/isomorphic/create-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ module.exports = (files, pagesReq) => {
})

const staticFileTypes = [
'ipynb',
'md',
'markdown',
'html',
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/load-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// This file is auto-written and used by Gatsby to require
// files from your pages directory.
module.exports = function (callback) {
let context = require.context('./pages', true, /(coffee|cjsx|jsx|js|markdown|md|html|json|yaml|toml)$/) // eslint-disable-line
let context = require.context('./pages', true, /(coffee|cjsx|jsx|js|markdown|md|ipynb|html|json|yaml|toml)$/) // eslint-disable-line
if (module.hot) {
module.hot.accept(context.id, () => {
context = require.context('./pages', true, /(coffee|cjsx|jsx|js|markdown|md|html|json|yaml|toml)$/) // eslint-disable-line
context = require.context('./pages', true, /(coffee|cjsx|jsx|js|markdown|md|ipynb|html|json|yaml|toml)$/) // eslint-disable-line
return callback(context)
})
}
Expand Down
4 changes: 4 additions & 0 deletions lib/utils/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ module.exports = (program, directory, suppliedStage, webpackPort = 1500, routes
test: /\.html$/,
loader: 'html',
})
config.loader('ipynb', {
test: /\.ipynb$/,
loaders: ['json'],
})
config.loader('json', {
test: /\.json$/,
loaders: ['json'],
Expand Down

0 comments on commit e7cec1e

Please sign in to comment.