The source code for my personal website: www.alanmartyn.com Includes a static website generator that renders content from Jupyter Notebooks and Markdown.
To articulate my work effectively requires a means for people to:
- view my work in one place
- view posts written as jupyter notebooks in the browser
- view posts written markdown as in the browser
- access source code for a post
- execute source code for a post
Clone the repository
$ git clone https://github.com/a-martyn/website.git
Install dependencies (assumes Python 3 is installed)
$ python -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
Check settings in config.py
.
Run tests and build html
$ python test.py
$ python render.py
Preview site by opening html files ./output
in your browser.
Make a directory to contain your post
$ mkdir input/my-new-post
Create content as markdown or jupyter notebook
$ touch input/my-new-post/my-new-post.ipynb
Add your post to the index ./input/_index.json
Render to static site
$ python render.py
Publish: git commit
and git push
to publish via CircleCI continuous integration
If your post requires linked images add assets
dir and include linked images in there.
$ mkdir input/my-new-post/assets
Note: Asset filenames must be unique across all posts else render.py
will raise an exception.
To display your post on the homepage set "index": true
in input/_index.json
, or false
to publish page without link from index.
Homepage images should be 700x400px and live in ./input/_index_assets