Quarto publications page and adding anchors
Given: quarto website page with publications. Previously touched upon in the messy 240605-2055 Quarto website creation notes.
Anchor links in (quarto) markdown
This works:
[UNLP paper](publications.qmd#hamotskyi2024unlp)
Anchor targets
- Only correct solution: 1
<a name="title"></a>
- (markdown - How to link to a named anchor in Multimarkdown? - Stack Overflow says to use the
name=
, notid=
, attribute, but this doesn’t work for me in quarto.)
- (markdown - How to link to a named anchor in Multimarkdown? - Stack Overflow says to use the
Template
// Get anchor id somehow from paper path
<% let y= item.path.split('/'); y.pop(); let dirname = y.pop(); let citation_key = dirname.split('-').pop() %>
// Overwrite with paper front-matter if there's one
<% if (item.citation_key) { %>
<% citation_key = item.citation_key %>
<% } %>
// Add to paper listing thing
<a id="<%= citation_key %>"></a>
Nel mezzo del deserto posso dire tutto quello che voglio.