Skip to content

InPoint-Automation/AutoAnchorLinks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auto Anchor Links

Icon

Description

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.

Features

  • Wraps h2 and h3 headings 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 id exists
  • De-duplicates repeated heading slugs with numeric suffixes

Requirements

Publii 0.43.0 or newer.

Installation

  1. Download the release ZIP.
  2. Publii -> Tools -> Plugins -> Install plugin -> pick the ZIP.
  3. Enable the plugin for the site.

Usage

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.

screenshot

Contributing

Feel free to fork this project or contribute a PR. Build instructions can be found in the developer readme DEV.md.

Licenses

Main code

This project is licensed under the GPLv3+. See LICENSE file for details.

Third-Party Components

None, the plugin is self-contained plain JavaScript with no dependencies.

Credits

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.

Changelog

See CHANGELOG.md for the full version history.

About

A Publii plugin that turns `h2` and `h3` headings in your posts and pages into anchor links

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors