This snippet:
foo="{{ (resources.Get "css/site.css").RelPermalink }}";
href="{{ (resources.Get "css/site.css").RelPermalink }}";
yields:
foo="/css/site.css";
href="./css/site.css";
Why are the links different?
This snippet:
foo="{{ (resources.Get "css/site.css").RelPermalink }}";
href="{{ (resources.Get "css/site.css").RelPermalink }}";
yields:
foo="/css/site.css";
href="./css/site.css";
Why are the links different?
Unable to reproduce. Placed snippet in layouts/_default/single.html
.
I get it when I have relativeURLs: "true"
in my config.
That setting makes Hugo look for URL attributes (e.g. href
) in the HTML output; foo
is not.
I suspected something like that…
<link rel="stylesheet" href="{{ (resources.Get "css/site.css").RelPermalink }}" />
<style>
foo::before {
content: "{{ (resources.Get "css/site.css").RelPermalink }}";
}
</style>
<meta property="og:image" content="{{ (resources.Get "css/site.css").RelPermalink }}"/>
yields three different variants:
<link rel="stylesheet" href="./css/site.css" />
<style>
foo::before {
content: "\2f css\2fsite.css";
}
</style>
<meta property="og:image" content="/css/site.css"/>
woahhhh … is this a feature ? Can explain some troubles I had.