mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-29 12:03:31 +08:00
feat valine
This commit is contained in:
parent
4094233034
commit
8ca8b8b727
5
assets/icons/eye.svg
Normal file
5
assets/icons/eye.svg
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-eye" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||||||
|
<circle cx="12" cy="12" r="2"></circle>
|
||||||
|
<path d="M22 12c-2.667 4.667 -6 7 -10 7s-7.333 -2.333 -10 -7c2.667 -4.667 6 -7 10 -7s7.333 2.333 10 7"></path>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 444 B |
@ -110,6 +110,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.article-meta {
|
||||||
|
font-size: 1.4rem;
|
||||||
|
section {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.article-category,
|
.article-category,
|
||||||
.article-tags {
|
.article-tags {
|
||||||
a {
|
a {
|
||||||
|
@ -51,6 +51,14 @@ params:
|
|||||||
issueTerm: pathname
|
issueTerm: pathname
|
||||||
label:
|
label:
|
||||||
theme: preferred-color-scheme
|
theme: preferred-color-scheme
|
||||||
|
valine:
|
||||||
|
enable: false
|
||||||
|
appId: # leancloud appId
|
||||||
|
appKey: # leancloud appKey
|
||||||
|
verify: false # Verification code
|
||||||
|
avatar: wavatar # Gravatar style
|
||||||
|
placeholder: 说点什么吧...
|
||||||
|
visitor: true # Article reading statistic
|
||||||
|
|
||||||
widgets:
|
widgets:
|
||||||
enabled:
|
enabled:
|
||||||
|
@ -21,12 +21,24 @@
|
|||||||
</h3>
|
</h3>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
<footer class="article-time article-meta">
|
||||||
{{- if not .Date.IsZero -}}
|
{{- if not .Date.IsZero -}}
|
||||||
<footer class="article-time">
|
<section>
|
||||||
{{ partial "helper/icon" "clock" }}
|
{{ partial "helper/icon" "clock" }}
|
||||||
<time class="article-time--published">
|
<time class="article-time--published">
|
||||||
{{- .Date.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
|
{{- .Date.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
|
||||||
</time>
|
</time>
|
||||||
</footer>
|
</section>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if .Site.Params.comments.valine.enable -}}
|
||||||
|
<section>
|
||||||
|
{{ partial "helper/icon" "eye" }}
|
||||||
|
<span id="{{ .RelPermalink }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
|
||||||
|
<span class="post-meta-item-text"></span>
|
||||||
|
<span class="leancloud-visitors-count">loading</span>
|
||||||
|
</span>
|
||||||
|
</section>
|
||||||
|
{{- end -}}
|
||||||
|
</footer>
|
||||||
</div>
|
</div>
|
13
layouts/partials/comments/provider/valine.html
Normal file
13
layouts/partials/comments/provider/valine.html
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<div id="vcomments"></div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.v[data-class=v] .vcount {
|
||||||
|
color: var(--card-text-color-main);
|
||||||
|
}
|
||||||
|
.v[data-class=v] p {
|
||||||
|
color: var(--card-text-color-main);
|
||||||
|
}
|
||||||
|
.v[data-class=v] .veditor, .v[data-class=v] .vinput {
|
||||||
|
color: var(--body-text-color);
|
||||||
|
}
|
||||||
|
</style>
|
@ -5,3 +5,19 @@
|
|||||||
{{- $script := resources.Get "ts/main.ts" | js.Build $opts -}}
|
{{- $script := resources.Get "ts/main.ts" | js.Build $opts -}}
|
||||||
|
|
||||||
<script type="text/javascript" src="{{ $script.RelPermalink }}" defer></script>
|
<script type="text/javascript" src="{{ $script.RelPermalink }}" defer></script>
|
||||||
|
|
||||||
|
<!-- valine -->
|
||||||
|
{{- if .Site.Params.comments.valine.enable -}}
|
||||||
|
<script src='//cdn.jsdelivr.net/npm/valine/dist/Valine.min.js'></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
new Valine({
|
||||||
|
el: '#vcomments' ,
|
||||||
|
appId: '{{ .Site.Params.comments.valine.appId }}',
|
||||||
|
appKey: '{{ .Site.Params.comments.valine.appKey }}',
|
||||||
|
verify: '{{ .Site.Params.comments.valine.verify }}',
|
||||||
|
avatar:'{{ .Site.Params.comments.valine.avatar }}',
|
||||||
|
placeholder: '{{ .Site.Params.comments.valine.placeholder }}',
|
||||||
|
visitor: '{{ .Site.Params.valine.comments.visitor }}'
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{{- end -}}
|
Loading…
Reference in New Issue
Block a user