Auto Anchor Links is a Publii plugin that turns h2 and h3 headings in
your posts and pages into anchor links. Clicking a heading sets the URL hash so
readers can link to a specific section. It runs at build time.
- Wraps
h2andh3headings in anchor links for linking - Preserves any existing heading
id(e.g. ids from Publii's block editor) - Generates a URL-safe slug from the heading text when no
idexists - De-duplicates repeated heading slugs with numeric suffixes
Publii 0.43.0 or newer.
- Download the release ZIP.
- Publii -> Tools -> Plugins -> Install plugin -> pick the ZIP.
- Enable the plugin for the site.
Open Plugins -> Auto Anchor Links -> settings icon and choose the Apply to
scope: Posts and pages, Posts only, or Pages only. Rebuild the site and
each h2/h3 heading becomes a clickable link.
Feel free to fork this project or contribute a PR. Build instructions can be found in the developer readme DEV.md.
This project is licensed under the GPLv3+. See LICENSE file for details.
None, the plugin is self-contained plain JavaScript with no dependencies.
This project was developed by InPoint Automation Sp. z o.o. https://inpointautomation.com/
Thanks to the Publii project for the CMS and plugin API.
See CHANGELOG.md for the full version history.
