Header links on repeated content template


#1

Hello,

I’m trying to create a project repeating content with _project.html detail page. Everything is working except the links to the style sheets and .js code in the header and footer. I’m using a partial for the header, _header.html, that has all the necessary links that is used on the index.html page as well as the _project.html detail page. Is there a way to make absolute html links that work across detail pages and static pages?

Also, when I got to the header on _project.html and follow the link to the css which is /stylesheets/styles.css it just takes me back to the _project.html page…


#2

Found the answer. Use {{_permalink}} in _header.html if you use it in a partial. It should work on any static pages you create and any repeat pages.


#3

I also realized that I was calling the header and navigation partials before the section. If I call them after then I don’t have to use _permalink to make everything link up correctly.
Old:
{{> header}}
{{> navigation}}
{{#section projects label=“Projects”}}
html + vapid stuff
{{/section}}

New:
{{#section projects label=“Projects”}}
{{> header}}
{{> navigation}}
html + vapid stuff
{{/section}}