theNewDynamic / hugo-layout_module-base-2019

2019 version of Hugo starter base files
1 stars 0 forks source link

Remove generated headers page #5

Open budparr opened 4 years ago

budparr commented 4 years ago

Some time ago I discovered that it's fairly easy to malform the generated headers page. So I've recently been manually adding settings in the Netlify TOML file. A bit more work than generating it, but more deliberative and safe.

I'd like to remove this file: https://github.com/theNewDynamic/hugo-layout_module-base-2019/blob/master/layouts/index.headers

Any sense of the sites we should circle around to change some of these settings, @regisphilibert

regisphilibert commented 4 years ago

I would say all of them. But then again, we did not update the base module on any of those since early last year so... not too worried. But if we did, we would just end up with a warning.

I don't have any use case for dynamically generating the headers, (and so a good reason to keep this functionality in our future sites) but I can't imagine there aren't... What do you think?

budparr commented 4 years ago

It's useful for caching and pre-loading assets, which we can't do with netlify.toml. Toml's structure is very good for this sort of thing though.

regisphilibert commented 4 years ago

Would Netlify completely ignore our _headers file if we were to have some in netlify.toml?

I guess my question is: could we have both, if some need preloading, prefetching etc...

budparr commented 4 years ago

Hmm good point

budparr commented 4 years ago

I'm checking that out. for the immediate issue, I'm going to remove this file for now. There's a bunch in it that can have a negative impact on headers if everything is not just right. So, note on any sites that are using this as a submodule, we'll want to add some basic headers to. I'll make sure tnd.com is updated with best practices. Sound good?

budparr commented 4 years ago

n.b. the reason behind this change: https://community.netlify.com/t/common-issue-why-are-my-headers-file-rules-not-working-as-expected/1551?u=budparr