0

So, I want to add some anchor to my url. My code

<a href="{{ home_url }}/#anchor">Link name</a>

and it's not working. It gives me something like this

<a href="//#anchor">Link name</a>

what I want is

<a href="mydomain.com/#anchor">Link name </a>

How can I do that? Can anyone help me with that?

MMPL1
  • 533
  • 7
  • 21

1 Answers1

1

Try {{ base_url }} instead of {{ home_url }}. Grav's documentation of theme variables says this:

base_url variable

The {{ base_url }} returns the base URL to the Grav site, whether or not this shows the full URL is dependent on the absolute_urls option in the system configuration.

Matias Kinnunen
  • 7,828
  • 3
  • 35
  • 46