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:

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

Then the temlate base.html was modified to include:

...
        {% 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:

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