This is a Jekyll theme for blogging with Pandoc. It's based off of Pandoc Markdown CSS Theme for the original CSS file. Read more about the theme there.
There are two external dependencies in order to use this theme:
Follow the installation instructions for your platform. If you’re using macOS, installation is as easy as:
brew install pandoc
brew install jez/formulae/pandoc-sidenote
Next, add this line to your Jekyll site's Gemfile:
# -- Gemfile --
# ...
gem "pandoc-markdown-jekyll-theme"
And then run:
# Install the Jekyll theme
bundle install
# Copy out one file that has to live in the site folder, not the theme
cp $(bundle info pandoc-markdown-jekyll-theme --path)/_template.html5 .
# Bust the Jekyll cache (Jekyll doesn't track _template.html5 changes)
rm -rf .jekyll-cache
And finally, update your _config.yml
file:
# -- _config.yml --
theme: pandoc-markdown-jekyll-theme
gems:
- jekyll-pandoc
markdown: Pandoc
pandoc:
extensions:
- from: 'markdown+smart+tex_math_single_backslash'
- filter: 'pandoc-sidenote'
- template: '_template'
- katex
- toc
- M: 'site__baseurl=/'
If your Jekyll site has a baseurl:
setting in _config.yml
, change the last
line above to site__baseurl=$BASEURL/
, replacing $BASEURL
with what the
setting of your baseurl
property reads. (There is unfortunately no easy way to
get the Pandoc template file to read from the Jekyll config, so the value must
be duplicated.)
The following variables are used by this theme.
site.title
<title>
elementpage.title
site.author
page.author
page.author_url
site.baseurl
site.header_includes
page.header_includes
<head>
site.include_after
site.pandoc_markdown_skip_syntax_theme
true
to skip including the default syntax theme CSS file.page.include_after
<body>
before the contentsite.include_before
page.include_before
<body>
after the contentpage.layout
index
, page
, or post
index
won't have a "Return home" link at the bottom of the pagepage.subtitle
site.description
page.description
<head>
section, as a <meta>
tag.page.date
page.keywords
page.math
true
, we'll include KaTeX for displaying math formulas. Will add
JavaScript on this page.page.lang
'en'
page.dir
'ltr'
You can also define:
_includes/enable_checkboxes.html
to be an empty file in your project to remove the only non-math JavaScript.
To update KaTeX:
katex_version=0.11.1
mkdir assets/libs/KaTeX/$katex_version/
cd assets/libs/KaTeX/$katex_version/
wget https://cdnjs.cloudflare.com/ajax/libs/KaTeX/$katex_version/katex.min.js
wget https://cdnjs.cloudflare.com/ajax/libs/KaTeX/$katex_version/katex.min.css
rg --no-heading --no-filename --no-line-number --only-matching 'url\(font[^)]+\)' | \
cut -c 5- | \
sed -e 's/)$//' | \
sed -e "s+^+https://cdnjs.cloudflare.com/ajax/libs/KaTeX/$katex_version/+" | \
xargs wget -i -
mkdir -p fonts
mv *.ttf *.woff *.woff2 fonts
To make a release:
version=TODO
vim pandoc-markdown-jekyll-theme.gemspec
git commit pandoc-markdown-jekyll-theme.gemspec -m "$version"
git tag "$version"
git push --tags origin master
gem build pandoc-markdown-jekyll-theme.gemspec
gem push "pandoc-markdown-jekyll-theme-$version.gem"