Create new layout for an about page


Well when I go to : http://localhost:1313/about/

No css is loaded because the baseURL is not loaded.

./themes/mytheme/layouts/mylayout.html I added {{ partial “header.html” }}

in header.html I have :
link rel=“stylesheet” href="{{ .Site.BaseURL }}css/style.css"

Which sould render to :
link rel=“stylesheet” href=“http://localhost:1313/css/style.css”>

but in http://localhost:1313/about/ it renders to :
link rel=“stylesheet” href=“css/style.css”>

So environnement variables do not seem to work


I’m sorry @stephenbe I think we might be using different terms here. You said you would have a repo to point me to in a few minutes. Can you point me in that direction? Thanks…


will do give me a few minutes, thank you!


So here is my about page

Here is the template that it uses


Seems lik a known issue …

I had to use
{{ “vendors/N3UX/lib/externe/bootstrap/3.3.6/css/bootstrap.min.css” | absURL }}

To make this work =/

I asked @bep to re-open the issue


Actually no logic works anymore…if you add
{{- range first 10 .Data.Pages -}} <h4><a href="{{ .Permalink }}">{{ .Title }}</a></h4> {{- end }}

In about/single.html nothing shows up…what am I doing wrong? @rdwatters


This is a list page, so there is not .Data available to it by default. I would recommend reading the docs I sent along in the links above. All the answers will be in there, I promise :wink:`

I don’t now what you’re trying to range through, but the following will work in a single template:

{{- range first 10 $.Site.Pages -}}
<h4><a href="{{ .Permalink }}">{{ .Title }}</a></h4>
{{- end }}

But grabs all the pages for the site. I think you will benefit from learning some of the Hugo fundamentals; namely, the difference between list pages and single content pages.


You are so right, I am very grateful for all your help, but I need to do some more reading on my part.

Thank you so much for all your help


I discovered why the {{ .Site.BaseURL }} wasn’t working

Forgot to add a .

{{ partial “header.html” }}


{{ partial “header.html” . }}


13 posts were split to a new topic: Problems rendering a Contact Page partial and using Layout