CaiJimmy / hugo-theme-stack

Card-style Hugo theme designed for bloggers
https://stack.jimmycai.com
GNU General Public License v3.0
4.89k stars 1.6k forks source link

Support explicitly related content in article frontmatter #775

Closed tesujimath closed 1 year ago

tesujimath commented 1 year ago

Sometimes the Hugo related content algorithm just doesn't do what you want.

This change allows to specify related content in the frontmatter of an article. These take priority over any derived by Hugo by its related content algorithm.

For example, in TOML format:

related = [ "/post/a-compelling-read/index.md" ]

The paths are passed to .Site.GetPage, and this list prepended to the Hugo-generated related content, with duplicates removed.

CaiJimmy commented 1 year ago

Thank you so much for submitting your pull request!

Sorry for the late reply. Unfortunately, I'm still tied up with academic tasks and won't be able to review pull requests for the time being.

Once I have more time, I'll take a look at your pull request and provide feedback.

Thank you again for your contributions!

CaiJimmy commented 1 year ago

Sorry for the late reply.

After thinking it through, I believe this feature is not something widely used, so I'll have to decline this PR 🙏.

Thanks again for your PR!