Jiayin Cao
jiayincao.bsky.social
Jiayin Cao
@jiayincao.bsky.social
Senior Devtech @Nvidia. Former graphics engineer at Ready At Dawn, Naughty Dog, Ubisoft. Views are my own.
Totally enjoying it!
May 13, 2025 at 9:22 PM
It work within my repo. It may need some adjustment to work on other theme, I'm not quite sure though.
April 21, 2025 at 1:25 AM
gist.github.com/JiayinCao/64...

Right, the source code is here. I forgot.
Short code to support references in hugo blog post
Short code to support references in hugo blog post - example_post.md
gist.github.com
April 21, 2025 at 1:21 AM
Hi @mjp123.bsky.social

I thought this is something you may want to make it easier for you to write post in the future, 😀.

This is a lot of talk to chatgpt to make it happen, 😅
April 21, 2025 at 1:21 AM
- Reference to a same item will result to the same link.
- The reference text will be a link on post, which links to the line of the corresponding reference item.
- Reference link supports both external link and other internal hugo post link.

[tbc]
April 21, 2025 at 1:09 AM
Here are the features it supports.
- References with actual reference first will show earlier in the reference list
- References without actual references will show after those are actually refered in the order they are defined.
- Failing to find the tag will produce obvous error on page

[tbc]
April 21, 2025 at 1:08 AM
- Reference to an item with a short code by using their tag, rather than hard coding it with numbers and links.
- At the end of the article, simply do `{{< refshow >}}` to show all the references articles.

[tbc]
April 21, 2025 at 1:06 AM
So I build a tool that allows us to define references in a painless way in the future.

Here is how it works.
- Define references at the beginning, rather than at the end. Defining != showing.
- For each item, we only need tag, title and link/page. Page is for reference to other post of yours.
[tbc]
April 21, 2025 at 1:04 AM