Create a text file of markdown links within each section of a document

I was wrong, my baby example worked, but not my website. You can check here:Cooking: An original sin | Instincto & Meta
bibliography
No order at all (or not the right one at least).
Very first link is “EGYPT BEFORE THE PHARAOHS” but it goes around the middle of the list.

I have not changed the code. for confirmation I copied my content into post-1 and the same problem arised.

I’d be happy to look at a test repo, but not your site.

Sorry I can’t. you can use your own repo, just past the following in post-1.md, nothing else changing.

+++
title = 'Post 1'
date = 2024-03-16T20:00:49-07:00
draft = false
+++

## What is an instinctive diet

[failure](https://google.fr "google")

### Denatured molecules

[diabetes](https://doi.org/10.1007/s11892-013-0453-1 "Vlassara, H., Uribarri, J. Advanced Glycation End Products (AGE) and Diabetes: Cause, Effect, or Both? (2014)")

[organ failure](https://doi.org/10.1155/2019/2746521 "Excessive Oxidative Stress Contributes to Increased Acute ER Stress Kidney Injury in Aged Mice (2019)")

[with](https://doi.org/10.1007/s007020050069 "Alzheimer's disease – synergistic effects of glucose deficit, oxidative stress and advanced glycation endproducts (1998)")

[without](https://doi.org/10.1016/j.mad.2011.10.007 "Serum concentration of an inflammatory glycotoxin, methylglyoxal, is associated with increased cognitive decline in elderly individuals (2011)")

### Criteria for a natural diet

### The importance of insects

[to be anything but a prey](https://www.amazon.com/Man-Hunted-Primates-Predators-Evolution/dp/0813339367)

[moving quickly from branches to branches (brachiation)](https://www.evolvemoveplay.com/movement-inspiration-8-14-14-brachiation/)

### Alcohol and sugar addiction

#### Drunken mammals

[](www.doi.org/10.1098/rsos.150150 "Tools to tipple: ethanol ingestion by wild chimpanzees using leaf-sponges (2015)")

My mistake. We need to walk .Fragments.Headings instead of ranging over .Fragments.HeadingsMap. The latter is alphabetized, which is why the simple example worked.

git clone --single-branch -b hugo-forum-topic-48875 https://github.com/jmooring/hugo-testing hugo-forum-topic-48875
cd hugo-forum-topic-48875
rm -rf public && hugo && cat public/posts/post-1/bib.txt

Post 1 is your example.

Files of interest:

  • hugo.toml
  • layouts/_default/_markup/render-heading.html
  • layouts/_default/_markup/render-link.html
  • layouts/_default/single.bib.txt

Note that the global page function was very handy in single.bib.txt. You need to be careful how you use it (see warnings), but this was the perfect application for it.

You have my gratitude !
I suggest it gets put somewhere on the site, easy to find ( :sweat_smile:), because such a clean way to produce a bibliography might be appreciated by lots of people. Only caveat, links in footnotes appear at the end, not where the footnote is. I suspect footnotes are rendered in last ? Otherwise the links would be added in flow to the .Store variable.
Not much of a problem.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.