nditcommunity / nditcommunity.github.io

Website for Neurodiversity In Tech
https://nditcommunity.github.io
MIT License
1 stars 1 forks source link

Split JS into multiple files #30

Open hayleyw7 opened 3 months ago

hayleyw7 commented 3 months ago

We should probably brainstorm a bit on how we do this. There are a lot of different ways.

royemosby commented 2 months ago

The simplest approach that I can think of right now is to place the theme and analytic scripts into all pages then only apply other scripts on a per-page basis. I've assembled the layouts and partials to use liquid templates so we can conditionally add scripts in any place based on some frontmatter property. I am thinking of probably a script: ["script1-name", "script2-name"] approach in the frontmatter of each page. The template then can conditionally add in scripts whether it's mentioned in the frontmatter.