zola icon indicating copy to clipboard operation
zola copied to clipboard

Internal anchors can be added by templates

Open clarfonthey opened this issue 7 months ago • 1 comments

Zola version: 0.18.0


Because templates can add extra anchors, the internal link checker has false negatives when linking directly to these anchors. There are a few options to getting around this, namely:

  1. Make the internal link checker fully render a template and use the external link checker code if there's an error, to verify that it's not added by a template. This could potentially be disabled by default because it's slow.
  2. Add options to disable the link checker for particular internal pages (e.g., allow any anchor on @/page.md when linking).
  3. Add the ability to tell zola about custom anchors in front matter, and/or the global configuration for anchors added to every page (like a return-to-top anchor).

Note that any combination of these could be implemented, but I don't want to be too prescriptive about the solution since there are multiple and it depends on what people would be comfortable with.

clarfonthey avatar Jan 22 '24 00:01 clarfonthey

See https://github.com/getzola/zola/pull/2264

We are not going to check anchors added by templates

Keats avatar Jan 22 '24 09:01 Keats