Enable the embedded link render hook:
[markup.goldmark.renderHooks.link]
enableDefault = true
Then reference the target page using its logical path. Consider this content structure:
content/
├── posts/
│ ├── post-3/
│ │ ├── bryce-canyon.jpg
│ │ └── index.md
│ ├── _index.md
│ ├── post-1.md
│ └── post-2.md
└── _index.md
To link from anywhere to post-1:
[post 1](/posts/post-1)
To link from anywhere to post-3:
[post 3](/posts/post-3)
I would enable the embedded image render hook as well:
[markup.goldmark.renderHooks.image]
enableDefault = true
Note that embedded link and image render hooks are automatically enabled for multilingual single-host sites.
Enabling these embedded render hooks addresses the challenges described in this article.