funkydan2 / hugo-kiera

Kiera - A Hugo Theme for writing
https://hugo-kiera.netlify.app
MIT License
71 stars 53 forks source link

Add header supplement loading #70

Closed jsumners closed 1 year ago

jsumners commented 1 year ago

This PR adds conditional loading of a supplemental header partial. It makes use of templates.Exists (added by https://github.com/gohugoio/hugo/pull/5015) to do this.

This feature allows theme users to extend the theme's head block with additional content without having to copy the theme's partials to layouts/partials/ (and avoid the maintenance burden that would introduce). In my specific case, I want to add a link to every generated page.

netlify[bot] commented 1 year ago

Deploy Preview for hugo-kiera ready!

Name Link
Latest commit 1a0294144391daf8950062ef3270eb8754fb7689
Latest deploy log https://app.netlify.com/sites/hugo-kiera/deploys/646e07dbf9610200086e923b
Deploy Preview https://deploy-preview-70--hugo-kiera.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

funkydan2 commented 1 year ago

One question - do you know what version template.Exists was added to Hugo?

theme.toml states the minimum hugo version is 0.55β€”just wondering if that needs to be bumped? https://github.com/funkydan2/hugo-kiera/blob/5b47ce76b3eea00d31bc2f2217429189eac931e9/theme.toml#L8

jsumners commented 1 year ago

It looks like it was included in https://github.com/gohugoio/hugo/releases/tag/v0.46. So the minimum version for this theme covers it.