spanezz / staticsite

Static site generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support multiple markdown blocks with footnotes

DonKult opened this issue · comments

Similar to debian-policy, staticsite currently has a problem if a page has footnotes in multiple blocks – e.g. if the page is an index page of a blog: the [^1] footnotes in each block would get the same id.

By setting the right option in the right way the ids include a block-number to be unique:

MARKDOWN_EXTENSION_CONFIGS = {
    'markdown.extensions.extra': {
        'markdown.extensions.footnotes': {
            'UNIQUE_IDS': True,
        },
    },
}

Setting options for extensions bundled in the extra extension is a bit tricky, an explanation can be found in upstreams bugtracker.

I guess that should be a builtin default, but it breaks existing links with footnotes, so perhaps it should just be a project specific setting (hint hint)… decisions decisions…

This should really be the default!