mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-29 03:53:30 +08:00
commit
a4a66eb77a
@ -70,14 +70,20 @@ params:
|
|||||||
# Waline 前端配置参见 https://waline.js.org/reference/client.html
|
# Waline 前端配置参见 https://waline.js.org/reference/client.html
|
||||||
# Waline client configuration see: https://waline.js.org/en/reference/client.html
|
# Waline client configuration see: https://waline.js.org/en/reference/client.html
|
||||||
waline:
|
waline:
|
||||||
serverURL:
|
serverURL:
|
||||||
lang:
|
lang:
|
||||||
visitor:
|
visitor:
|
||||||
avatar:
|
avatar:
|
||||||
emoji:
|
emoji:
|
||||||
admin:
|
- emoji URL 1
|
||||||
|
- emoji URL 2
|
||||||
requiredMeta:
|
requiredMeta:
|
||||||
|
- name
|
||||||
|
- email
|
||||||
|
- url
|
||||||
placeholder:
|
placeholder:
|
||||||
|
locale:
|
||||||
|
admin: test
|
||||||
|
|
||||||
widgets:
|
widgets:
|
||||||
enabled:
|
enabled:
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
title: "Test"
|
title: "Test"
|
||||||
description: "This is a example category"
|
description: "This is an example category"
|
||||||
slug: "test"
|
slug: "test"
|
||||||
image: "hutomo-abrianto-l2jk-uxb1BY-unsplash.jpg"
|
image: "hutomo-abrianto-l2jk-uxb1BY-unsplash.jpg"
|
||||||
style:
|
style:
|
||||||
background: "#2a9d8f"
|
background: "#2a9d8f"
|
||||||
color: "#fff"
|
color: "#fff"
|
||||||
---
|
---
|
||||||
|
@ -28,7 +28,7 @@ widget:
|
|||||||
|
|
||||||
search:
|
search:
|
||||||
title:
|
title:
|
||||||
other: サーチ
|
other: 検索
|
||||||
placeholder:
|
placeholder:
|
||||||
other: 入力...
|
other: 入力...
|
||||||
resultTitle:
|
resultTitle:
|
||||||
|
@ -7,25 +7,26 @@
|
|||||||
box-shadow: var(--shadow-l1);
|
box-shadow: var(--shadow-l1);
|
||||||
padding: var(--card-padding);
|
padding: var(--card-padding);
|
||||||
}
|
}
|
||||||
|
.waline-container .vcount {
|
||||||
|
color: var(--card-text-color-main);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
{{- with .Site.Params.comments.waline -}}
|
{{- with .Site.Params.comments.waline -}}
|
||||||
<script>
|
{{- $config := dict "el" "#waline" "dark" "body[data-scheme=\"dark\"]" -}}
|
||||||
// 本页配置参见 https://waline.js.org/reference/client.html
|
{{- $replaceKeys := dict "serverurl" "serverURL" "requiredmeta" "requiredMeta" "wordlimit" "wordLimit" "pagesize" "pageSize" "avatarcdn" "avatarCDN" "avatarforce" "avatarForce" -}}
|
||||||
// Waline client configuration see: https://waline.js.org/en/reference/client.html
|
|
||||||
new Waline({
|
{{- range $key, $val := . -}}
|
||||||
el: '#waline',
|
{{- if $val -}}
|
||||||
serverURL: '{{ .serverURL }}',
|
{{- $replaceKey := index $replaceKeys $key -}}
|
||||||
lang: '{{ .lang }}',
|
{{- $k := default $key $replaceKey -}}
|
||||||
visitor: '{{ .visitor }}',
|
|
||||||
avatar: '{{ .avatar }}',
|
{{- $config = merge $config (dict $k $val) -}}
|
||||||
emoji: ['{{ .emoji }}'],
|
{{- end -}}
|
||||||
dark: 'body[data-scheme="dark"]',
|
|
||||||
requiredMeta: ['{{ .requiredMeta }}'],
|
|
||||||
locale: {
|
|
||||||
admin: '{{ .admin }}',
|
|
||||||
placeholder: '{{ .placeholder }}',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/// Waline client configuration see: https://waline.js.org/en/reference/client.html
|
||||||
|
new Waline({{ $config | jsonify | safeJS }});
|
||||||
|
</script>
|
||||||
|
{{- end -}}
|
@ -21,5 +21,5 @@
|
|||||||
<link rel="shortcut icon" href="{{ . }}" />
|
<link rel="shortcut icon" href="{{ . }}" />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{- template "_internal/google_analytics_async.html" . -}}
|
{{- template "_internal/google_analytics.html" . -}}
|
||||||
{{- partial "head/custom.html" . -}}
|
{{- partial "head/custom.html" . -}}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
{{ $url := urls.Parse $imageValue }}
|
{{ $url := urls.Parse $imageValue }}
|
||||||
|
|
||||||
{{ if or (eq $url.Scheme "http") (eq $url.Scheme "https") }}
|
{{ if or (eq $url.Scheme "http") (eq $url.Scheme "https") }}
|
||||||
<!-- Is a external image -->
|
<!-- Is an external image -->
|
||||||
{{ $result = merge $result (dict "permalink" $imageValue) }}
|
{{ $result = merge $result (dict "permalink" $imageValue) }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $pageResourceImage := .Context.Resources.GetMatch (printf "%s" ($imageValue | safeURL)) }}
|
{{ $pageResourceImage := .Context.Resources.GetMatch (printf "%s" ($imageValue | safeURL)) }}
|
||||||
@ -58,4 +58,4 @@
|
|||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ return $result }}
|
{{ return $result }}
|
||||||
|
Loading…
Reference in New Issue
Block a user