带有锚点的 Grav CMS home_url
Grav CMS home_url with anchor
所以,我想为我的 url 添加一些锚点。我的代码
<a href="{{ home_url }}/#anchor">Link name</a>
它不起作用。它给了我这样的东西
<a href="//#anchor">Link name</a>
我想要的是
<a href="mydomain.com/#anchor">Link name </a>
我该怎么做?有人可以帮我吗?
尝试 {{ base_url }}
而不是 {{ home_url }}
。 Grav's documentation of theme variables 是这样说的:
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.
所以,我想为我的 url 添加一些锚点。我的代码
<a href="{{ home_url }}/#anchor">Link name</a>
它不起作用。它给了我这样的东西
<a href="//#anchor">Link name</a>
我想要的是
<a href="mydomain.com/#anchor">Link name </a>
我该怎么做?有人可以帮我吗?
尝试 {{ base_url }}
而不是 {{ home_url }}
。 Grav's documentation of theme variables 是这样说的:
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 theabsolute_urls
option in the system configuration.