Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: allow early script embedding #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gerrywastaken
Copy link
Contributor

There are two changes there. One to add an include at the top of the HTML head tag so that the user can include scripts that need to be the first thing loaded.

e.g. Osano or other cookie consent scripts which blocks the loading of other scripts until user consent has been given. This allows people to more easily comply with regulations in the EU.

This is just one example, but I'm sure there are many cases of scripts that should be loaded as early as possible.

The second change I made is just to make the previous inclusion of a custom stylesheets much more flexible and consistent with the change I made in the first commit.

Some scripts need to be the very first thing loaded or they will no
work. One example of this is the cookie consent script from Osano which
will stop other scripts from setting cookies before they have consent
from the visitor.
I previously introduced a change to add a custom stylesheet at the
bottom of the page, but this was actually far more limiting that it
needed to be. It only allowed the user to add their styles to a single
stylesheed which is not great if they wish to add a third party
stylesheet as well as their own styles.

This change also makes this addition consistent with the other custom
partial introduced in this pull request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant