Welcome to mirror list, hosted at ThFree Co, Russian Federation.

assets.html « partials « layouts - github.com/uPagge/uBlogger.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9352c3e62bea37fee9c3f1e2c307eef5134b8d4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
{{- $scratch := .Scratch.Get "scratch" -}}
{{- $CDN := $scratch.Get "CDN" -}}
{{- $fingerprint := $scratch.Get "fingerprint" -}}
{{- $config := dict "desktopHeaderMode" .Site.Params.header.desktopMode "mobileHeaderMode" .Site.Params.header.mobileMode -}}
{{- with $scratch.Get "contentData" -}}
    {{- $config = dict "content" . | merge $config -}}
{{- end -}}
{{- with $scratch.Get "comment" -}}
    {{- $config = dict "comment" . | merge $config -}}
{{- end -}}

{{- /* Fork Awesome */ -}}
{{- if $scratch.Get "forkawesome" -}}
    {{- $options := dict "targetPath" "lib/forkawesome/fork-awesome.min.css" -}}
    {{- dict "source" "lib/forkawesome/fork-awesome.scss" "toCSS" $options "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
{{- end -}}

{{- /* iconfont */ -}}
{{- if $scratch.Get "iconfont" -}}
    {{- with $CDN.iconfontCSS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
    {{- else -}}
        {{- dict "source" "lib/iconfont/iconfont.css" "minify" true "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
    {{- end -}}
{{- end -}}

{{- /* Smooth Scroll */ -}}
{{- with $CDN.smoothScrollJS -}}
    {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
    {{- dict "source" "lib/smooth-scroll/smooth-scroll.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}

{{- /* Search */ -}}
{{- if .Site.Params.search.enable -}}
    {{- with $CDN.autocompleteJS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
    {{- else -}}
        {{- dict "source" "lib/autocomplete/autocomplete.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
    {{- end -}}
    {{- $searchConfig := dict "noResultsFound" (T "noResultsFound") -}}
    {{- if eq .Site.Params.search.type "lunr" -}}
        {{- with .Site.Home.OutputFormats.Get "json" -}}
            {{- $searchConfig = dict "type" "lunr" "lunrIndexURL" .RelPermalink | merge $searchConfig -}}
        {{- end -}}
        {{- with $CDN.lunrJS -}}
            {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
        {{- else -}}
            {{- dict "source" "lib/lunr/lunr.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
        {{- end -}}
        {{- if ne .Language.Lang "en" -}}
            {{- $searchConfig = T "lunrLanguageCode" | dict "lunrLanguageCode" | merge $searchConfig -}}
            {{- if eq .Language.Lang "zh-cn" -}}
                {{- $searchConfig = dict "lunrSegmentitURL" (resources.Get "lib/lunr/lunr.segmentit.js").RelPermalink | merge $searchConfig -}}
            {{- end -}}
            {{- dict "source" "lib/lunr/lunr.stemmer.support.js" "minify" true "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
            {{- dict "source" (T "lunrLanguageLib") "minify" true "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
        {{- end -}}
    {{- else if eq .Site.Params.search.type "algolia" -}}
        {{- with $CDN.algoliasearchJS -}}
            {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
        {{- else -}}
            {{- dict "source" "lib/algoliasearch/algoliasearch-lite.umd.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
        {{- end -}}
        {{- $searchConfig = dict "type" "algolia" "algoliaIndex" .Site.Params.search.algolia.index "algoliaAppID" .Site.Params.search.algolia.appID "algoliaSearchKey" .Site.Params.search.algolia.searchKey | merge $searchConfig -}}
    {{- end -}}
    {{- $config = dict "search" $searchConfig | merge $config -}}
{{- end -}}

{{- /* lazysizes */ -}}
{{- with $CDN.lazysizesJS -}}
    {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
    {{- dict "source" "lib/lazysizes/lazysizes.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}

{{- /* lightgallery.js */ -}}
{{- if ne .Site.Params.page.lightgallery false | and (ne .Params.lightgallery false) -}}
    {{- with $CDN.lightgalleryCSS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
    {{- else -}}
        {{- dict "source" "lib/lightgallery/lightgallery.min.css" "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
    {{- end -}}
    {{- with $CDN.lightgalleryJS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
    {{- else -}}
        {{- dict "source" "lib/lightgallery/lightgallery.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
    {{- end -}}
    {{- with $CDN.lightgalleryThumbnailJS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
    {{- else -}}
        {{- dict "source" "lib/lightgallery/lg-thumbnail.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
    {{- end -}}
    {{- with $CDN.lightgalleryZoomJS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
    {{- else -}}
        {{- dict "source" "lib/lightgallery/lg-zoom.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
    {{- end -}}
    {{- $lightGalleryConfig := dict "selector" ".lightgallery" "speed" 400 "hideBarsDelay" 2000 "thumbnail" true "exThumbImage" "data-thumbnail" "thumbWidth" 80 "thumbContHeight" 80 "actualSize" false -}}
    {{- $config = dict "lightGallery" $lightGalleryConfig | merge $config -}}
{{- end -}}

{{- /* clipboard.js */ -}}
{{- with $CDN.clipboardJS -}}
    {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
    {{- dict "source" "lib/clipboard/clipboard.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
{{- $config = T "copyToClipboard" | dict "title" | dict "clipboard" | merge $config -}}

{{- /* Sharer.js */ -}}
{{- if $scratch.Get "share" -}}
    {{- with $CDN.sharerJS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
    {{- else -}}
        {{- dict "source" "lib/sharer/sharer.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
    {{- end -}}
{{- end -}}

{{- /* TypeIt */ -}}
{{- with $scratch.Get "typeitMap" -}}
    {{- with $CDN.typeitJS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
    {{- else -}}
        {{- dict "source" "lib/typeit/typeit.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
    {{- end -}}
    {{- $typeitConfig := slice -}}
    {{- range $key, $val := . -}}
        {{- $typeitConfig = $typeitConfig | append (slice $val) -}}
    {{- end -}}
    {{- $config = dict "typeit" $typeitConfig | merge $config -}}
{{- end -}}

{{- /* KaTeX */ -}}
{{- if ne .Site.Params.math.enable false | and .Params.math -}}
    {{- with $CDN.katexCSS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
    {{- else -}}
        {{- dict "source" "lib/katex/katex.min.css" "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
    {{- end -}}
    {{- with $CDN.katexJS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
    {{- else -}}
        {{- dict "source" "lib/katex/katex.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
    {{- end -}}
    {{- with $CDN.katexAutoRenderJS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
    {{- else -}}
        {{- dict "source" "lib/katex/auto-render.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
    {{- end -}}
    {{- $math := .Site.Params.math -}}
    {{- if $math.copyTex -}}
        {{- with $CDN.katexCopyTexCSS -}}
            {{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
        {{- else -}}
            {{- dict "source" "lib/katex/copy-tex.min.css" "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
        {{- end -}}
        {{- with $CDN.katexCopyTexJS -}}
            {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
        {{- else -}}
            {{- dict "source" "lib/katex/copy-tex.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
        {{- end -}}
    {{- end -}}
    {{- if $math.mhchem -}}
        {{- with $CDN.katexMhchemJS -}}
            {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
        {{- else -}}
            {{- dict "source" "lib/katex/mhchem.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
        {{- end -}}
    {{- end -}}
    {{- $mathConfig := dict "strict" false -}}
    {{- $delimiters := slice (dict "left" "$$" "right" "$$" "display" true) (dict "left" "\\[" "right" "\\]" "display" true) -}}
    {{- if and $math.blockLeftDelimiter $math.blockRightDelimiter -}}
        {{- $delimiters = $delimiters | append (dict "left" $math.blockLeftDelimiter "right" $math.blockRightDelimiter "display" true) -}}
    {{- end -}}
    {{- $delimiters = $delimiters | append (dict "left" "$" "right" "$" "display" false) (dict "left" "\\(" "right" "\\)" "display" false) -}}
    {{- if and $math.inlineLeftDelimiter $math.inlineRightDelimiter -}}
        {{- $delimiters = $delimiters | append (dict "left" $math.inlineRightDelimiter "right" $math.inlineRightDelimiter "display" false) -}}
    {{- end -}}
    {{- $mathConfig = dict "delimiters" $delimiters | merge $mathConfig -}}
    {{- $config = dict "math" $mathConfig | merge $config -}}
{{- end -}}

{{- /* mermaid */ -}}
{{- if $scratch.Get "mermaid" -}}
    {{- with $CDN.mermaidJS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
    {{- else -}}
        {{- dict "source" "lib/mermaid/mermaid.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
    {{- end -}}
    {{- $options := dict "targetPath" "lib/mermaid/mermaid.min.css" -}}
    {{- dict "source" "lib/mermaid/mermaid.scss" "toCSS" $options "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
{{- end -}}

{{- /* ECharts */ -}}
{{- if $scratch.Get "echarts" -}}
    {{- with $CDN.echartsJS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
    {{- else -}}
        {{- dict "source" "lib/echarts/echarts.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
    {{- end -}}
    {{- with $CDN.echartsMacaronsJS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
    {{- else -}}
        {{- dict "source" "lib/echarts/macarons.js" "minify" true "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
    {{- end -}}
{{- end -}}

{{- /* Mapbox GL */ -}}
{{- if $scratch.Get "mapbox" -}}
    {{- with $CDN.mapboxGLCSS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
    {{- else -}}
        {{- dict "source" "lib/mapbox-gl/mapbox-gl.min.css" "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
    {{- end -}}
    {{- with $CDN.mapboxGLJS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
    {{- else -}}
        {{- dict "source" "lib/mapbox-gl/mapbox-gl.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
    {{- end -}}
    {{- dict "source" "lib/mapbox-gl/mapbox-gl-language.js" "minify" true "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
    {{- $mapbox := dict "accessToken" (.Params.mapbox.accessToken | default .Site.Params.mapbox.accessToken) "RTLTextPlugin" "https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.0/mapbox-gl-rtl-text.js" -}}
    {{- $config = dict "mapbox" $mapbox | merge $config -}}
{{- end -}}

{{- /* Music */ -}}
{{- if $scratch.Get "music" -}}
    {{- /* APlayer */ -}}
    {{- with $CDN.aplayerCSS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
    {{- else -}}
        {{- dict "source" "lib/aplayer/APlayer.min.css" "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
    {{- end -}}
    {{- $options := dict "targetPath" "lib/aplayer/dark.min.css" -}}
    {{- dict "source" "lib/aplayer/dark.scss" "toCSS" $options "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
    {{- with $CDN.aplayerJS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
    {{- else -}}
        {{- dict "source" "lib/aplayer/APlayer.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
    {{- end -}}

    {{- /* MetingJS */ -}}
    {{- with $CDN.metingJS -}}
        {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
    {{- else -}}
        {{- dict "source" "lib/meting/Meting.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
    {{- end -}}
{{- end -}}

{{- /* Dev feature */ -}}
{{- if .Params.dev -}}
{{- end -}}

{{- /* Theme script */ -}}
{{- dict "source" "js/theme.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- $_ := (resources.Get "js/theme.min.js.map").RelPermalink -}}

{{- range $scratch.Get "stylesheet" -}}
    {{- partial "plugin/stylesheet.html" . -}}
{{- end -}}

<script type="text/javascript">
    window.config = {{ jsonify $config | safeJS }};
</script>

{{- /* Polyfill.io */ -}}
{{- partial "plugin/script.html" (dict "source" "https://polyfill.io/v3/polyfill.min.js?features=Element.prototype.closest%2CrequestAnimationFrame%2CCustomEvent%2CPromise%2CObject.entries%2CObject.assign%2CObject.values%2Cfetch%2CElement.prototype.after") -}}

{{- range $scratch.Get "script" -}}
    {{- partial "plugin/script.html" . -}}
{{- end -}}

{{- /* Google analytics async */ -}}
{{- if eq hugo.Environment "production" | and .Site.GoogleAnalytics -}}
    {{- template "_internal/google_analytics_async.html" . -}}
{{- end -}}