Siblings, children, related & content links

Starting with the embedded link render hook, create your own render hook that appends the link’s page reference to a Page.Store slice. When accessing the slice later on, pass it through the uniq function to remove duplicates (i.e., when the page includes two links to the same destination).

Yes, if you base your link render hook on Hugo’s embedded link render hook as described above.

With this content structure:

content/
├── site/
│   ├── about.md
│   └── foo.md
└── _index.md

And this markdown in content/site/foo.md:

- [About](/site/about/)
- [About](about)
- [About](./about)
- [About](../site/about)
- [About](https://mysite.com/site/about/)

All of the links above work.

1 Like