gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
75.12k stars 7.48k forks source link

Two way references #8600

Closed lucasew closed 3 years ago

lucasew commented 3 years ago

Hugo has a pretty convenient template engine, shortcodes have pretty interesting handling about markdown extensibility so Hugo is a nice candidate to preview and publish digital gardens, but it lacks a two-way linking reference.

The proposition is basically a method on Page data structure that exposes a slice of relative references to the current page.

This can then be used in a template to generate quick jumping links and also a JSON manifest to generate things like graph views. Hugo just generates that metadata of the page. The rest can be handled by a template.

An extra idea about this is that linking can be labeled like /some/page#label then the label is stripped out the ref then on that slice it returns a struct with the relative href from the baseurl to the referenced page and the label as something like the state.

I was looking to do this and send a PR. No idea where to start xD. Is there already a shared index on the server mode? Should I do it from scratch? How can I listen to file modifications to efficiently update the index? Does Hugo already have an index like to the links a file is referencing?

jmooring commented 3 years ago

Duplicate of https://github.com/gohugoio/hugo/issues/8077

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.