The Astrochelys Pelican Theme
This is the theme we use for OutOfCheeseError
- Start a blog using Pelican
- Clone this repository alongside your
- Add the following options to
pelicanconf.py. (the table of contents can be customized as desribed here)
THEME = "./astrochelys" TAG_SAVE_AS = '' AUTHOR_SAVE_AS = '' CATEGORY_SAVE_AS = '' PLUGINS = ['pelican-toc'] DIRECT_TEMPLATES = (('index', 'tags', 'categories', 'archives'))
Margin notes and Side notes
Add margin and side notes to your articles by including raw HTML (which can be done in markdown, Jupyter notebook, and org-mode formats at least)
<label for="mn-note" class="margin-toggle">»</label> <input type="checkbox" id="mn-note" class="margin-toggle"/> <span class="marginnote"> your note here </span>
and for a numbered side-note:
<label for="sn-note" class="margin-toggle sidenote-number"></label> <input type="checkbox" id="sn-note" class="margin-toggle"/> <span class="sidenote"> your note here </span>
Change mn-note and sn-note to different names for each additional note (both in the label and the id)
- To use Google Analytics, set the
pelicanconf.pyto your Analytics ID.
- To use Fathom, set the
FATHOM_SITE_IDvariable to the site ID given by Fathom, and the
FATHOM_ANALYTICSvariable to the server address performing the tracking (We use Fathom Lite hosted on Heroku for this, following the instructions here.)
Astrochelys provides comments using either Hypothesis or Disqus (or both). Disqus support is controlled by the variable
pelicanconf.py. Hypothesis is embedded in the header and appears on the right side of the page.
- Install tinysearch and terser as described in the tinysearch repository
- Add a
Title: JSON Template: json Slug: json
- Set the
- Finally, add the following to your pelican
and, instead of running
pelican content to build your output files, run
make build instead.
Colors & Fonts
- All website colors and fonts are defined in the first few lines of
static/css/astrochelys.css, change these for a different theme. The modified fonts need to be downloaded from Google Fonts in the Fonts section of the
- Syntax highlighting colors are defined in
static/css/pygments.css. Change this to any pygments theme you like. If your syntax theme needs a non-white background, add
background: <color>to the
pre, pre codesection in
astrochelys.css. You can then probably remove the border since the color already demarcates the code block.
- Change the sidebar color by changing the
backgroundvariable in the
Every line of code in excruciating detail over at this post.