@samrich How many different layouts do you have for your blog posts? Is this as simple as just adding <a href="/blog/">Back to Blog</a>
in the templating layer? The leading /
should mean it’s root relative.
Better, you could also write the following:
<a href="{{.Site.BaseURL}}/blog/">Back to Blog</a>
if you want the full path.
If you want to use an even more abstracted approach (eg, with a /_default/single.html
), you could also do this:
<a href="{{.Site.BaseURL}}/{{.Section}}">Back to {{.Section}}</a>
You could also use the {{ whatever | pluralize }}
depending on your use case.
If you are looking for something more like @Jura’s original question, I would recommend setting a param (a la env
) in your config then checking for that value or modifying it with a flag (or as needed) during your dev work.