[Hosted-Portals] How to add hyperlinks to a document's internal sections

Morten Høfft mhoefft at gbif.org
Wed Feb 24 10:20:07 UTC 2021


Anchors - or internal links are automatically generated.

In your particular case the issue is casing
works: https://hp-colombian-biodiversity.gbif-staging.org/recursos/ComoCitar#cuando-se-trate-de-la-descarga-de-una-consulta-de-datos
Do not work: https://hp-colombian-biodiversity.gbif-staging.org/recursos/ComoCitar#Cuando-se-trate-de-la-descarga-de-una-consulta-de-datos

Github vs Kramdown
The problem is that markdown isn't one thing. And you just stumbled over a difference in how Github do it and how Kramdown (the Jekyll markdown parser) do it. So you cannot copy anchors from one to the other as the 2 generate them differently.

You can read a bit about the default Kramdown settings on the Jekyll docs<https://jekyllrb.com/docs/configuration/markdown/> - (they call it header ID generation)

The flavor of markdown used on the website is described on the base theme<https://hp-base-theme.gbif-staging.org/markdown> - including links to the kramdown documentation<https://kramdown.gettalong.org/quickref.html>. Notice that you can control the anchor text. You can also add a table of content by adding "toc: true" to your front matter.

Hope that helps
Morten
________________________________
From: Hosted-Portals <hosted-portals-bounces at lists.gbif.org> on behalf of Wayne Asera <waynea at sprep.org>
Sent: Wednesday, February 24, 2021 2:50 AM
To: Helpdesk, discussion and announcements for the GBIF hosted portals <hosted-portals at lists.gbif.org>
Subject: Re: [Hosted-Portals] How to add hyperlinks to a document's internal sections


Hi Camilla,



Could you try using the syntax below if it works?[https://forms.gle/S1vo53AU9LUSip4h9](https://forms.gle/S1vo53AU9LUSip4h9)



regards,



Wayne





From: Hosted-Portals <hosted-portals-bounces at lists.gbif.org> On Behalf Of Camila Andrea Plata Corredor
Sent: Wednesday, 24 February 2021 3:02 PM
To: hosted-portals at lists.gbif.org
Subject: [Hosted-Portals] How to add hyperlinks to a document's internal sections



Dear all,



We are creating content in markdown and we came across an issue while trying to add hyperlinks to a document's internal sections. When in Markdown the hyperlink works but in the portal it stops working.



[Cuando se trate de la descarga de una consulta de datos](#Cuando-se-trate-de-la-descarga-de-una-consulta-de-datos)



For example: when in the Markdown Github preview we can click on the hyperlink...



[https://lh3.googleusercontent.com/L4BIFaUl6RwJWZip6KP2IkpNirV0WbMlZ_NnE006KNPzgLvfsjPqj479Iq9ZdyqG9IIWoM8B2ttTjLWeVsJGeMTYkEnzIALBIlF_30L7oO4IXxQvhBPqnaSv3yBiGO4gTtb_07SA]



....and It redirects to the respective title/section within the same document:



(https://github.com/gbif/hp-colombian-biodiversity/blob/master/recursos/ComoCitar.md#Cuando-se-trate-de-la-descarga-de-una-consulta-de-datos)



[https://lh6.googleusercontent.com/VYcAupr6YoRymmLw6rbm-GIJFv1wmrz778DcsyT_0zNfY5XD2JxhGIrgK97MbPLY_kJgwzbGv8ZmB80w9ooHW_Hl5FiSVioR9zpYFjm3DKHfPx6ns4GLS0JmgwEuNLjGBP5UmEc9]



But in the portal we get a dead link:



(https://hp-colombian-biodiversity.gbif-staging.org/recursos/ComoCitar#Cuando-se-trate-de-la-descarga-de-una-consulta-de-datos)



[https://lh3.googleusercontent.com/XxmQ7e1_LIqsFl0vQigaiicyvBeOQOtJ60N6dWkkcC5bEwa69L8ZubBBUamgKEUqYwCemOl1t5-kITPku0Vvrq4uilQTUruM8zmvqWf0V0wl8ryDhN1HdjAVDyjjNwFHT_GWcLHs]



Then, Which is the correct way to address hyperlinks to a document's internal sections?



Thank you in advance,





--

Camila Andrea Plata Corredor

Equipo Coordinador                                                                                   Sistema de Información sobre Biodiversidad de Colombia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gbif.org/pipermail/hosted-portals/attachments/20210224/3cdba691/attachment-0001.html>


More information about the Hosted-Portals mailing list