Internal links to anchors that live in templates

Hi,

I just want to make sure I’m not missing something.

I have some sort of page footer that is generated with a template, which contains in particular:

<h2>Useful Links<a class="zola-anchor" href="#{{ id }}">🔗</a></h2>

Pages that use this footer contain internal links to this anchor, e.g. (cf. [Useful Links](#useful-links)). They used to work correctly but after a zola update, the site won’t build anymore as the link checker raises errors about non-existent anchors in links. As far as I can tell, this is due to this commit that made the link checker handle “naked anchor links”. And since configuration variables skip_prefixes and skip_anchor_prefixes only target external links, and there’s no way to disable the link checker from the command line, I think I’m stuck.

So my question is: am I right that internal links to anchor that are generated using a template are not possible anymore in zola, or am I missing something? Thanks a lot for any clarification!

Can you confirm it still errors with Next version by Keats · Pull Request #1741 · getzola/zola · GitHub ? I believe we should add some ways to skip internal anchors as well if not.

Yes, I still get the same errors.

@mwcz would it be useful for you as well?

I know we have template->template internal anchors, but I don’t think we have any markdown->template anchors. It’s possible though, since we have 600+ broken internal anchors.

I think my upcoming changes to make link checker error levels configurable will help here, they’ll allow the site to build, but the warnings would still appear.

I’m wondering why the heuristic link checker doesn’t solve the problem here? Add heuristic checking for HTML anchors by phillord · Pull Request #1716 · getzola/zola · GitHub