pixelastic / norska

🏔️ Custom SSG using Pug, Webpack, PostCSS and Tailwind.
https://projects.pixelastic.com/norska/
MIT License
8 stars 0 forks source link

Replace boilerplate with mixins in default layout #45

Closed pixelastic closed 4 years ago

pixelastic commented 4 years ago

The current default layout shipped with norska included the whole head part, including all the meta. This specific code block saw multiple revisions in the last norska updates (bug fixing on escaping values, including screenshots by default, etc).

The issue it creates is that whenever a project updates its norska version, it also have to manually update its main layout to reflect those changes. Even if we update the default layout in the norska templates, projects that were initialized before that won't see the changes.

What we could do instead is wrap the whole head part into its own norska_head mixin. This way, whenever we fix a bug in the mixin itself, all projects benefit from it.

Maybe we should also mixinify the footer (the part including the script loading) as well. While we're at it, we should also refactor the pageTitle/pageDescription into a global meta object.

The issue is finding the right balance between shared code in norska and customisation in child projects.

pixelastic commented 4 years ago

This has been added