You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I am really enjoying these little bundles of joy.
I'm rebuilding a site and wanted to take advantage of this plugin. I have some one-off layouts for which the <head> content is different in terms of styles and scripts, and various tags (say <link>), so I can adjust what goes in the template for the head (lots of common tags like the title, icon, meta… justify not having duplicated files).
The reason I can't reuse the very same setup is due to the fact I run PurgeCSS as a transform, and I cache my bundles, so they are reused across the site if the name is identical. I could use a unique bundle name (head-base', 'head-one-off'…) for my JS and CSS per layout but that seems a little gross and not scalable to add them in there. (I need scalability for my 3 layouts, of course 🙃)
I did try to see if it worked and while every element built out as I expected, the contents of those CSS and JS elements were a comment which I assume is replaced by a transform after the fact.
Currently I've worked around the problem by assigning {% block head %}{% endblock %} in my head.njk file and replace the {% html "head" %} with {% block head %}. That works fine in my case, but just wanted to make sure I reported a valid use-case regardless (well, valid enough in my eyes, perhaps!).
Thank you!
The text was updated successfully, but these errors were encountered:
Hi! I am really enjoying these little bundles of joy.
I'm rebuilding a site and wanted to take advantage of this plugin. I have some one-off layouts for which the
<head>
content is different in terms of styles and scripts, and various tags (say<link>
), so I can adjust what goes in the template for the head (lots of common tags like the title, icon, meta… justify not having duplicated files).Here's my very simple
<head>
template:Now, here's my default
base.njk
layout:And with my one-off template, I could use it like this:
The reason I can't reuse the very same setup is due to the fact I run PurgeCSS as a transform, and I cache my bundles, so they are reused across the site if the name is identical. I could use a unique bundle name (
head-base'
,'head-one-off'
…) for my JS and CSS per layout but that seems a little gross and not scalable to add them in there. (I need scalability for my 3 layouts, of course 🙃)I did try to see if it worked and while every element built out as I expected, the contents of those CSS and JS elements were a comment which I assume is replaced by a transform after the fact.
Currently I've worked around the problem by assigning
{% block head %}{% endblock %}
in myhead.njk
file and replace the{% html "head" %}
with{% block head %}
. That works fine in my case, but just wanted to make sure I reported a valid use-case regardless (well, valid enough in my eyes, perhaps!).Thank you!
The text was updated successfully, but these errors were encountered: