Pelican Notes

Pelican is being used for this site. For future reference, this page contains some information on how it was set up.

First the project was created according to the documentation found on the webpage.

Given that code highlighting did not work with the picked schema, which was simple, a copy of simple theme was produced, and was put into a folder lakat-theme.

Pygments was used to generate a suitable css file:

:::bash
pygmentize -S monokai -f html -a .highlight > lakat-theme/static/css/pygments.css

I had to add some padding to the pre tag (5px) so it looks a bit better.

Then the temlate base.html was modified to include:

:::jinja
...
        {% endblock head %}
        <link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css/pygments.css" />
</head>

Also we had to tell in pelicanconf.py to pelican what class should it generate when it sees code:

:::python
MARKDOWN = {
    'extension_configs': {
        'markdown.extensions.codehilite': {
            'css_class': 'highlight',  # <-- Here is the name
            'linenums': False,
        },
        'markdown.extensions.extra': {},
        'markdown.extensions.meta': {},
    },
    'output_format': 'html5',
}