spanezz / staticsite

Static site generator
GNU General Public License v3.0
46 stars 7 forks source link

Support multiple markdown blocks with footnotes #13

Closed DonKult closed 5 years ago

DonKult commented 6 years ago

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…

spanezz commented 5 years ago

This should really be the default!