How to hyperlink templates specific file on index.html in Zola

36 Views Asked by At

I am trying to hyperlink gallery.html located in the templates folder at the index.html at Zola.

Structure of the project

content
templates
  - gallery.html
  - index.html
  - base.html
static
config.toml

I tried to use link_to it didn't work to link.

<a href="{{ link_to("gallery.html") }}">Gallery</a>.
1

There are 1 best solutions below

0
On BEST ANSWER

Zola does not have a link_to() function. To add a hyperlink to the gallery you need to target gallery’s template output file (in the content directory) and not the template.

index.html:

<a href="{{ get_url(path="@/pages/gallery.md") }}">Gallery</a>

See Zola’s internal linking.