This is a test of using Jekyll and Jupyter together to make a blog. We'll set the title by adding a bit of metadata to the Notebook (this can be changed from Edit → Edit Notebook Metadata):
"jekyll": {
"name": "Hello, World!"
}
We can plot things in blog posts in the usual way, with the familiar Jupyter Notebook commands.
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot-rq')
xs = np.linspace(0, 10, 201)
plt.plot(xs, np.cos(xs))
[<matplotlib.lines.Line2D at 0x6aadba8>]
Once we're done, we can use nbconvert
to turn everything into a Jekyll-ready HTML page.
!jupyter nbconvert --to html --template jekyll.tpl 2016-05-27-hello-world.ipynb
[NbConvertApp] Converting notebook 2016-05-27-hello-world.ipynb to html [NbConvertApp] Writing 23119 bytes to 2016-05-27-hello-world.html
This should be fun!