Yore embeds a backlink system based on jmooring/hugo-module-backlinks to track and display bidirectional links.
Configuration
Add backlinks to outputs.home to generate the backlink index, and set backlinkEnabled: true to display backlinks on pages:
outputs:
home:
- HTML
- RSS
- backlinks
params:
backlinkEnabled: trueBacklinks rely on global state. Restart the development server to see updated references.
Link Resolution
Backlinks are only detected when the link path can be resolved by Hugo's .GetPage. Use paths relative to the current file or the content directory root.
For example, with this directory structure:
content/
âââ docs/
â âââ installation
â â âââ index.md
â âââ usage.md
âââ posts/
âââ feature-update.mdIn docs/installation/index.md, you can reference the other content using:
[text](../usage.md)[text](/posts/feature-update.md)or[text](../../posts/feature-update.md)
And in docs/usage.md, you can reference the other content using:
[text](./installation/index.md)[text](/posts/feature-update.md)or[text](../posts/feature-update.md)
Paths that cannot resolve by Hugo's GetPage are ignored and will not be indexed.
How It Works
During rendering, Hugo's render-link hook intercepts each internal link and calls .GetPage on the destination path. If the path resolves to a page, a backlink entry is recorded in a global store that is built once per site build.