Hello, I’m trying to show some styles conditionally based on the url. Maybe I am going about this the wrong way but my initial thought was to check the url and based on that, show the styles.
This works but only on the specific page.
{{ if eq .RelPermalink "/my-section/" }}
{{ $styles := resources.Get "scss/styles.scss" | toCSS | minify | fingerprint }}
<link rel="stylesheet" href="{{ $styles.Permalink | relURL }}">
{{ end }}
Once I navigate within that section of my site the sites no longer render. For example on this page
site.com/my-section/new-page
the above logic breaks.
So how could I check for if .RelPermalink contains "/my-section"
?
Again, if there is a simpler/better/cleaner way to go about this I’m all ears.
Thanks.