mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-04-20 20:11:53 +02:00
Merge branch 'translations-v1' into translations-v1
This commit is contained in:
commit
422d8fa8e8
6 changed files with 32 additions and 14 deletions
|
@ -1,7 +1,9 @@
|
||||||
var liked_page = false
|
var liked_page = false
|
||||||
|
var id = oid ? oid.replaceAll("/", "-") : oid
|
||||||
|
var id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes
|
||||||
|
|
||||||
if (typeof auth !== 'undefined') {
|
if (typeof auth !== 'undefined') {
|
||||||
var id = oid ? oid.replaceAll("/", "-") : oid
|
|
||||||
var viewed = localStorage.getItem(id);
|
var viewed = localStorage.getItem(id);
|
||||||
|
|
||||||
if (!viewed) {
|
if (!viewed) {
|
||||||
|
@ -28,7 +30,6 @@ if (typeof auth !== 'undefined') {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes
|
|
||||||
var liked = localStorage.getItem(id_likes);
|
var liked = localStorage.getItem(id_likes);
|
||||||
|
|
||||||
if (liked) {
|
if (liked) {
|
||||||
|
@ -97,7 +98,6 @@ function remove_like_article(id_likes) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_article() {
|
function process_article() {
|
||||||
var id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes
|
|
||||||
if (!liked_page) {
|
if (!liked_page) {
|
||||||
like_article(id_likes)
|
like_article(id_likes)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -14,4 +14,5 @@ cascade:
|
||||||
|
|
||||||
本章节包含了你需要了解的有关 Blowfish 的所有信息。如果你是新用户,请查阅[安装]({{< ref "docs/installation" >}}) 指南,或者访问[示例]({{< ref "samples" >}}) 来了解 Blowfish 能做什么。
|
本章节包含了你需要了解的有关 Blowfish 的所有信息。如果你是新用户,请查阅[安装]({{< ref "docs/installation" >}}) 指南,或者访问[示例]({{< ref "samples" >}}) 来了解 Blowfish 能做什么。
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
@ -19,12 +19,16 @@
|
||||||
<div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
|
<div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
|
||||||
{{ partial "article-meta/list.html" (dict "context" . "scope" "single") }}
|
{{ partial "article-meta/list.html" (dict "context" . "scope" "single") }}
|
||||||
</div>
|
</div>
|
||||||
{{ with .File }}
|
|
||||||
|
{{ $path := .File.Path }}
|
||||||
|
{{range .AllTranslations}}
|
||||||
|
{{ $lang := print "." .Lang ".md" }}
|
||||||
|
{{ $path = replace $path $lang ".md" }}
|
||||||
|
{{end}}
|
||||||
<script>
|
<script>
|
||||||
var oid = "views_{{ .Path }}"
|
var oid = "views_{{ $path }}"
|
||||||
var oid_likes = "likes_{{ .Path }}"
|
var oid_likes = "likes_{{ $path }}"
|
||||||
</script>
|
</script>
|
||||||
{{ end }}
|
|
||||||
{{ $jsPage := resources.Get "js/page.js" }}
|
{{ $jsPage := resources.Get "js/page.js" }}
|
||||||
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
|
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
|
||||||
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
|
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
|
||||||
|
|
|
@ -86,12 +86,15 @@
|
||||||
{{ partial "related.html" . }}
|
{{ partial "related.html" . }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ with .File }}
|
{{ $path := .File.Path }}
|
||||||
|
{{range .AllTranslations}}
|
||||||
|
{{ $lang := print "." .Lang ".md" }}
|
||||||
|
{{ $path = replace $path $lang ".md" }}
|
||||||
|
{{end}}
|
||||||
<script>
|
<script>
|
||||||
var oid = "views_{{ .Path }}"
|
var oid = "views_{{ $path }}"
|
||||||
var oid_likes = "likes_{{ .Path }}"
|
var oid_likes = "likes_{{ $path }}"
|
||||||
</script>
|
</script>
|
||||||
{{ end }}
|
|
||||||
{{ $jsPage := resources.Get "js/page.js" }}
|
{{ $jsPage := resources.Get "js/page.js" }}
|
||||||
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
|
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
|
||||||
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
|
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
|
||||||
|
|
|
@ -4,7 +4,12 @@
|
||||||
{{ else if eq .Kind "term"}}
|
{{ else if eq .Kind "term"}}
|
||||||
<span id="likes_term_{{ .Page.Data.Term }}"
|
<span id="likes_term_{{ .Page.Data.Term }}"
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<span id="likes_{{ .File.Path }}"
|
{{ $path := .File.Path }}
|
||||||
|
{{range .AllTranslations}}
|
||||||
|
{{ $lang := print "." .Lang ".md" }}
|
||||||
|
{{ $path = replace $path $lang ".md" }}
|
||||||
|
{{end}}
|
||||||
|
<span id="likes_{{ $path }}"
|
||||||
{{ end }}
|
{{ end }}
|
||||||
class="animate-pulse inline-block text-transparent max-h-3 rounded-full mt-[-2px] align-middle bg-neutral-300 dark:bg-neutral-400" title="likes">loading</span>
|
class="animate-pulse inline-block text-transparent max-h-3 rounded-full mt-[-2px] align-middle bg-neutral-300 dark:bg-neutral-400" title="likes">loading</span>
|
||||||
<span class="inline-block align-text-bottom">{{ partial "icon.html" "heart" }}</span>
|
<span class="inline-block align-text-bottom">{{ partial "icon.html" "heart" }}</span>
|
||||||
|
|
|
@ -4,7 +4,12 @@
|
||||||
{{ else if eq .Kind "term"}}
|
{{ else if eq .Kind "term"}}
|
||||||
<span id="views_term_{{ .Page.Data.Term }}"
|
<span id="views_term_{{ .Page.Data.Term }}"
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<span id="views_{{ .File.Path }}"
|
{{ $path := .File.Path }}
|
||||||
|
{{range .AllTranslations}}
|
||||||
|
{{ $lang := print "." .Lang ".md" }}
|
||||||
|
{{ $path = replace $path $lang ".md" }}
|
||||||
|
{{end}}
|
||||||
|
<span id="views_{{ $path }}"
|
||||||
{{ end }}
|
{{ end }}
|
||||||
class="animate-pulse inline-block text-transparent max-h-3 rounded-full mt-[-2px] align-middle bg-neutral-300 dark:bg-neutral-400" title="views">loading</span>
|
class="animate-pulse inline-block text-transparent max-h-3 rounded-full mt-[-2px] align-middle bg-neutral-300 dark:bg-neutral-400" title="views">loading</span>
|
||||||
<span class="inline-block align-text-bottom">{{ partial "icon.html" "eye" }}</span>
|
<span class="inline-block align-text-bottom">{{ partial "icon.html" "eye" }}</span>
|
||||||
|
|
Loading…
Add table
Reference in a new issue