|
43 | 43 |
|
44 | 44 | <!-- SCSS (aka sass) object oriented css --> |
45 | 45 | {{ with resources.Get "sass/main.scss" }} |
46 | | - {{ $opts := dict |
47 | | - "transpiler" "dartsass" |
48 | | - "targetPath" "css/style.css" |
49 | | - }} |
50 | | - {{ with . | toCSS $opts | minify | fingerprint }} |
51 | | - <link |
52 | | - rel="stylesheet" |
53 | | - href="{{ .RelPermalink }}" |
54 | | - integrity="{{ .Data.Integrity }}" |
55 | | - crossorigin="anonymous" |
56 | | - /> |
57 | | - {{ end }} |
58 | | - {{ end }} |
| 46 | + {{ $opts := dict |
| 47 | + "transpiler" "dartsass" |
| 48 | + "targetPath" "css/style.css" |
| 49 | + }} |
| 50 | + {{ with . | toCSS $opts | minify | fingerprint }} |
| 51 | + <link |
| 52 | + rel="stylesheet" |
| 53 | + href="{{ .RelPermalink }}" |
| 54 | + integrity="{{ .Data.Integrity }}" |
| 55 | + crossorigin="anonymous" |
| 56 | + /> |
| 57 | + {{ end }} |
| 58 | + {{ end }} |
59 | 59 |
|
60 | 60 | <!-- jQuery from Google's CDN --> |
61 | 61 | <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> |
62 | 62 |
|
63 | 63 | <!-- JS --> |
64 | | - {{ with resources.Get "js/script.js" }} {{ if hugo.IsDevelopment }} {{ with |
65 | | - . | js.Build }} |
66 | | - <script defer src="{{ .RelPermalink }}"></script> |
67 | | - {{ end }} {{ else }} {{ $opts := dict "minify" true }} {{ with . | js.Build |
68 | | - $opts | fingerprint }} |
69 | | - <script |
70 | | - defer |
71 | | - src="{{ .RelPermalink }}" |
72 | | - integrity="{{ .Data.Integrity }}" |
73 | | - crossorigin="anonymous" |
74 | | - ></script> |
75 | | - {{ end }} {{ end }} {{ end }} {{ with resources.Get "js/navhover.js" }} {{ |
76 | | - if hugo.IsDevelopment }} {{ with . | js.Build }} |
77 | | - <script defer src="{{ .RelPermalink }}"></script> |
78 | | - {{ end }} {{ else }} {{ $opts := dict "minify" true }} {{ with . | js.Build |
79 | | - $opts | fingerprint }} |
80 | | - <script |
81 | | - defer |
82 | | - src="{{ .RelPermalink }}" |
83 | | - integrity="{{ .Data.Integrity }}" |
84 | | - crossorigin="anonymous" |
85 | | - ></script> |
86 | | - {{ end }} {{ end }} {{ end }} |
| 64 | + {{ $jsFiles := slice "js/script.js" "js/navhover.js" }} |
| 65 | + {{ $scripts := slice }} |
| 66 | + {{ range $jsFiles }} |
| 67 | + {{ with resources.Get . }} |
| 68 | + {{ $scripts = $scripts | append . }} |
| 69 | + {{ end }} |
| 70 | + {{ end }} |
| 71 | + |
| 72 | + {{ $bundle := $scripts | resources.Concat "js/main.js" | js.Build }} |
| 73 | + |
| 74 | + {{ if hugo.IsDevelopment }} |
| 75 | + <script defer src="{{ $bundle.RelPermalink }}"></script> |
| 76 | + {{ else }} |
| 77 | + {{ with $bundle | minify | fingerprint }} |
| 78 | + <script defer src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script> |
| 79 | + {{ end }} |
| 80 | + {{ end }} |
87 | 81 |
|
88 | 82 | <!-- is dit nodig? --> |
89 | 83 | {{ with .OutputFormats.Get "rss" -}} {{ printf ` |
|
0 commit comments