# May have found a way to keep relref functionality without the shortcode

**URL:** <https://discourse.gohugo.io/t/may-have-found-a-way-to-keep-relref-functionality-without-the-shortcode/43982>\
**Category:** tips & tricks\
**Created:** [April 19, 2023, 10:32am UTC](https://discourse.gohugo.io/t/may-have-found-a-way-to-keep-relref-functionality-without-the-shortcode/43982 "2023-04-19T10:32:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Georg](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/georg/32/21486_2.png) [@Georg](https://discourse.gohugo.io/u/Georg)\
**Post date:** [April 19, 2023, 10:32am UTC](https://discourse.gohugo.io/t/may-have-found-a-way-to-keep-relref-functionality-without-the-shortcode/43982/1 "2023-04-19T10:32:42Z")

</div>

Hi there,

I’ve been using the render-link hook Joe Mooring published in his very informative article on [Veriphor](https://www.veriphor.com/articles/link-and-image-render-hooks/) for a short while now. I’ve made some minor modifications and may have come up with a way to get rid of the `relref` shortcode. It works very fine for me, but I’m not sure if it will in all circumstances.

The idea is to simply call the `relref` template **function** as a last resort inside the render-link hook to find a page, when .GetPage has failed.

You can find the template code snippet at the end of line 132 on [GitHub](https://github.com/bowman2001/perplex/blob/main/layouts/_default/_markup/render-link.html).

I’ve also documented this approach [in my documentation (beta)](https://perplex.desider.at/doc/basic/link/#obsolete-relref-shortcode).

Maybe this is a good idea and we can keep the `relref` functionality without the messy shortcode.

Have a nice day,  
Georg

---

<div class="post-metadata">

**Author:** ![Georg](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/georg/32/21486_2.png) [@Georg](https://discourse.gohugo.io/u/Georg)\
**Post date:** [April 19, 2023, 11:00pm UTC](https://discourse.gohugo.io/t/may-have-found-a-way-to-keep-relref-functionality-without-the-shortcode/43982/3 "2023-04-19T23:00:47Z")

</div>

Thanks again, for your clever idea to use the render link for missing inline elements with an attribute. My implementation may not be optimal, but it works fine.

As I said, all the very useful checks for links and fragments at runtime in this hook haven’t been my idea. They are a little complicated but they help me to find erroneous links. If you want to learn more about them I would like to refer to the article from Joe Mooring again (Link in the first post).

To add the relref functionality was my idea and I know, that not everybody may need this because — like your special targets — it is not compatible with other Markdown renderers.
