TheWebTech / CrankShaft

A framework for building modern websites on the HubSpot Platform.
https://thewebtech.github.io/CrankShaft
MIT License
47 stars 17 forks source link

Site wide includes/requires #55

Open TheWebTech opened 5 years ago

TheWebTech commented 5 years ago

Something I personally do is create a custom module, that acts to store all of my site-wide requires. Things like fonts, stuff I know will be needed for every template.

The reason for this is because if you need to change it site wide, it's easier to do it in 1 module that's used everywhere.

The alternative is HubSpot's domain based settings, but for anyone who's been around long enough to do a redesign - basically setting anything there that isn't invisible(like a tracking code) is a huge slap in the face to whomever does a redesign down the road.

If it's possible though doing an include of an html partial file in the is probably better. modules add html markup even if they have nothing to display.

ajlaporte commented 5 years ago

We do the html partials when we do this. image

TheWebTech commented 5 years ago

Okay so you go the html partial route. Do you load them in the in drag n drop templates?

TheWebTech commented 5 years ago

I've implemented this concept in 12a6e0c04b35e6128395bab510868cfae7033caf https://github.com/TheWebTech/CrankShaft/blob/f45961200a7bf45059a9935871b3fc2df95c8252/CrankShaft/globals/theme-head.html#L1-L17 This is only doing the header however.

I am not opposed to doing it for the footer too, what's the reason you have a footer_scripts_partial? Only reason I can think of is so you could take advantage of the SRI hash security stuff