mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
Fix customJS and customCSS feature (#606)
* Fix customJS function In the current state the customJS feature doesn't work, because an asset will only be generated to `/public` when `.RelPermalink` is used as mentioned in the [document](https://gohugo.io/hugo-pipes/introduction/#asset-publishing). * Update CONTRIBUTORS.md * Fix customCSS as well
This commit is contained in:
@@ -103,3 +103,4 @@
|
||||
- [Kirill Feoktistov](https://feoktistoff.org)
|
||||
- [leins275](https://github.com/LanskovNV)
|
||||
- [Michael Weiss](https://mweiss.ch)
|
||||
- [Simon Pai](https://github.com/simonpai)
|
||||
|
||||
@@ -61,7 +61,13 @@
|
||||
{{ end }}
|
||||
|
||||
{{ range .Site.Params.customCSS }}
|
||||
<link rel="stylesheet" href="{{ . | relURL }}" />
|
||||
{{ if $.Site.IsServer }}
|
||||
{{ $styles := resources.Get . }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
|
||||
{{ else }}
|
||||
{{ $styles := resources.Get . | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ range .Site.Params.customSCSS }}
|
||||
@@ -123,7 +129,13 @@
|
||||
{{ end }}
|
||||
|
||||
{{ range .Site.Params.customJS }}
|
||||
<script src="{{ . | relURL }}"></script>
|
||||
{{ if $.Site.IsServer }}
|
||||
{{ $script := resources.Get . }}
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
{{ else }}
|
||||
{{ $script := resources.Get . | minify | fingerprint }}
|
||||
<script src="{{ $script.RelPermalink }}" integrity="{{ $script.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
|
||||
Reference in New Issue
Block a user