[solved] fastpages: editing site-wide template

apologies if this is already answered somewhere but i really have searched the forum, looked at the repo, read the readme and looked at the minima site.

i’m trying to edit the template site-wide to add an image header and whatever else to every page. the layouts all derive from default but _layouts doesn’t have a default.html and if i add one to the repo my navigation and styling vanish so i assume fastpages is wedging one in programmatically somewhere.

i’ve hunted around and i don’t see anywhere in _layouts or _includes (or anywhere else for that matter) which looks like what i’m after.

does anyone know?

[edit] _includes/header.html also does the job but also makes the nav menu vanish.


one of the pages on the jekyll site gave me a _layouts/default.html to cut & paste which was missing all of the includes.

this works:

<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: "en" }}">
  {%- include head.html -%}
    {%- include header.html -%}
    <main class="page-content" aria-label="Content">
      <div class="wrapper">
        {{ content }}
    {%- include footer.html -%}
1 Like

Take a look at the layouts folder for example posts.

It’s recommend to do a full tutorial of Jekyll before you try to customize this as this will become difficult to understand without that prerequisite first

Tbh it would have been easier to see what was going on if all the templates had been copied from minima but no worries, I got there in the end.

that sounded a bit ungrateful and whiny so i should probably add that fastpages is frigging amazing, i’m loving it…thank you for all the effort that went into this. :+1:

Copying all the templates is not a good way of doing things. We want to be able to inherit the latest changes in minima where possible.

Copying all the templates is like copy pasting all the code you want to use instead of pip installing it. Doesn’t really make sense to me.

1 Like

fair enough.