i18n: update i18n string format (#371)

This commit is contained in:
Dillon
2020-05-18 16:10:24 +08:00
committed by GitHub
parent 36f59a72ee
commit 9c1244490f
35 changed files with 236 additions and 284 deletions

View File

@@ -31,6 +31,8 @@
[theme=dark] & { [theme=dark] & {
color: $global-font-secondary-color-dark; color: $global-font-secondary-color-dark;
} }
@include link(false, false);
} }
.post-info-md { .post-info-md {

View File

@@ -89,7 +89,7 @@ youtubechannel:
# 012: Tumblr # 012: Tumblr
tumblr: tumblr:
weight: 12 weight: 12
template: https://%s.tumblr.com/ template: https://%v.tumblr.com/
title: Tumblr title: Tumblr
icon: icon:
class: fab fa-tumblr fa-fw class: fab fa-tumblr fa-fw
@@ -225,7 +225,7 @@ spotify:
# 029: Bandcamp # 029: Bandcamp
bandcamp: bandcamp:
weight: 29 weight: 29
template: https://%s.bandcamp.com/ template: https://%v.bandcamp.com/
title: Bandcamp title: Bandcamp
icon: icon:
class: fab fa-bandcamp fa-fw class: fab fa-bandcamp fa-fw
@@ -281,7 +281,7 @@ foursquare:
# 036: Hacker News # 036: Hacker News
hackernews: hackernews:
weight: 36 weight: 36
template: https://news.ycombinator.com/user?id=%s template: https://news.ycombinator.com/user?id=%v
title: Hacker News title: Hacker News
icon: icon:
class: fab fa-hacker-news fa-fw class: fab fa-hacker-news fa-fw
@@ -385,7 +385,7 @@ jsfiddle:
# 049: DeviantArt # 049: DeviantArt
deviantart: deviantart:
weight: 49 weight: 49
template: https://%s.deviantart.com/ template: https://%v.deviantart.com/
title: DeviantArt title: DeviantArt
icon: icon:
class: fab fa-deviantart fa-fw class: fab fa-deviantart fa-fw
@@ -409,7 +409,7 @@ dribbble:
# 052: WordPress # 052: WordPress
wordpress: wordpress:
weight: 52 weight: 52
template: https://%s.wordpress.com/ template: https://%v.wordpress.com/
title: WordPress title: WordPress
icon: icon:
class: fab fa-wordpress fa-fw class: fab fa-wordpress fa-fw
@@ -425,7 +425,7 @@ vine:
# 054: Google Scholar # 054: Google Scholar
googlescholar: googlescholar:
weight: 54 weight: 54
template: https://scholar.google.com/citations?%s template: https://scholar.google.com/citations?%v
title: Google Scholar title: Google Scholar
icon: icon:
simpleicons: googlescholar simpleicons: googlescholar
@@ -472,7 +472,7 @@ gitea:
# 060: XMPP # 060: XMPP
xmpp: xmpp:
weight: 60 weight: 60
template: xmpp:%s template: xmpp:%v
title: XMPP title: XMPP
icon: icon:
simpleicons: xmpp simpleicons: xmpp
@@ -496,7 +496,7 @@ bilibili:
# 063: Email # 063: Email
email: email:
weight: 63 weight: 63
template: mailto:%s template: mailto:%v
title: Email title: Email
icon: icon:
class: far fa-envelope fa-fw class: far fa-envelope fa-fw

View File

@@ -17,7 +17,7 @@ other = "Artikel"
# === Taxonomy === # === Taxonomy ===
[allSome] [allSome]
other = "Alle %s" other = "Alle {{ .Some }}"
[tag] [tag]
other = "Tag" other = "Tag"
@@ -47,10 +47,7 @@ other = "Thema wechseln"
# === partials/footer.html === # === partials/footer.html ===
[poweredBySome] [poweredBySome]
other = "Ermöglicht durch %s" other = "Ermöglicht durch {{ .Hugo }} | Thema - {{ .Theme }}"
[theme]
other = "Thema"
# === partials/footer.html === # === partials/footer.html ===
# === partials/comment.html === # === partials/comment.html ===
@@ -108,33 +105,30 @@ other = "Teilen auf"
[contents] [contents]
other = "Inhalt" other = "Inhalt"
[publish] [publishedOnDate]
other = "veröffentlicht auf" other = "veröffentlicht auf {{ .Date }}"
[included] [includedInCategories]
other = "enthalten in" other = "enthalten in {{ .Categories }}"
[wordCount] [wordCount]
one = "Ein Wort" one = "Ein wort"
other = "{{ .Count }} Wörter" other = "{{ .Count }} wörter"
[readingTime] [readingTime]
one = "Eine Minute" one = "Eine minute"
other = "{{ .Count }} Minuten" other = "{{ .Count }} minuten"
[views] [views]
other = "Aufrufe" other = "aufrufe"
[author] [author]
other = "Autor" other = "Autor"
[lastMod] [updatedOnDate]
other = "Aktualisiert am %s" other = "Aktualisiert am {{ .Date }}"
[license] [readMarkdown]
other = "Veröffentlicht unter der %s Lizenz"
[seeMarkdown]
other = "Markdown anzeigen" other = "Markdown anzeigen"
[back] [back]

View File

@@ -16,7 +16,7 @@ other = "Posts"
# === Taxonomy === # === Taxonomy ===
[allSome] [allSome]
other = "All %s" other = "All {{ .Some }}"
[tag] [tag]
other = "Tag" other = "Tag"
@@ -46,10 +46,7 @@ other = "Switch Theme"
# === partials/footer.html === # === partials/footer.html ===
[poweredBySome] [poweredBySome]
other = "Powered by %s" other = "Powered by {{ .Hugo }} | Theme - {{ .Theme }}"
[theme]
other = "Theme"
# === partials/footer.html === # === partials/footer.html ===
# === partials/comment.html === # === partials/comment.html ===
@@ -104,17 +101,19 @@ other = "Share on"
[contents] [contents]
other = "Contents" other = "Contents"
[publish] [publishedOnDate]
other = "published on" other = "published on {{ .Date }}"
[included] [includedInCategories]
other = "included in" other = "included in {{ .Categories }}"
[wordCount] [wordCount]
other = "about {{ .Count }} words" one = "One word"
other = "{{ .Count }} words"
[readingTime] [readingTime]
other = "{{ .Count }} min" one = "One minute"
other = "{{ .Count }} minutes"
[views] [views]
other = "views" other = "views"
@@ -122,13 +121,10 @@ other = "views"
[author] [author]
other = "Author" other = "Author"
[lastMod] [updatedOnDate]
other = "The article was updated on %s" other = "Updated on {{ .Date }}"
[license] [readMarkdown]
other = "Published under the %s license"
[seeMarkdown]
other = "Read Markdown" other = "Read Markdown"
[back] [back]

View File

@@ -17,7 +17,7 @@ other = "Artículos"
# === Taxonomy === # === Taxonomy ===
[allSome] [allSome]
other = "Todo %s" other = "Todo {{ .Some }}"
[tag] [tag]
other = "Etiqueta" other = "Etiqueta"
@@ -47,10 +47,7 @@ other = "Cambia el tema"
# === partials/footer.html === # === partials/footer.html ===
[poweredBySome] [poweredBySome]
other = "Provisto por %s" other = "Provisto por {{ .Hugo }} | Tema - {{ .Theme }}"
[theme]
other = "Tema"
# === partials/footer.html === # === partials/footer.html ===
# === partials/comment.html === # === partials/comment.html ===
@@ -108,17 +105,19 @@ other = "Compartir en"
[contents] [contents]
other = "Contenido" other = "Contenido"
[publish] [publishedOnDate]
other = "publicado el" other = "publicado el {{ .Date }}"
[included] [includedInCategories]
other = "incluido en" other = "incluido en {{ .Categories }}"
[wordCount] [wordCount]
other = "unas {{ .Count }} palabras" one = "Una palabra"
other = "{{ .Count }} palabras"
[readingTime] [readingTime]
other = "{{ .Count }} min" one = "Un minuto"
other = "{{ .Count }} minutos"
[views] [views]
other = "vistas" other = "vistas"
@@ -126,13 +125,10 @@ other = "vistas"
[author] [author]
other = "Autor" other = "Autor"
[lastMod] [updatedOnDate]
other = "El artículo fue actualizado el %s" other = "Actualizado el {{ .Date }}"
[license] [readMarkdown]
other = "Publicado bajo la licencia %s"
[seeMarkdown]
other = "Leer Markdown" other = "Leer Markdown"
[back] [back]

View File

@@ -17,7 +17,7 @@ other = "Posts"
# === Taxonomy === # === Taxonomy ===
[allSome] [allSome]
other = "Tous %s" other = "Tous {{ .Some }}"
[tag] [tag]
other = "Balise" other = "Balise"
@@ -47,10 +47,7 @@ other = "Changer de Thème"
# === partials/footer.html === # === partials/footer.html ===
[poweredBySome] [poweredBySome]
other = "Propulsé par %s" other = "Propulsé par {{ .Hugo }} | Thème - {{ .Theme }}"
[theme]
other = "Thème"
# === partials/footer.html === # === partials/footer.html ===
# === partials/comment.html === # === partials/comment.html ===
@@ -108,17 +105,19 @@ other = "Partager sur"
[contents] [contents]
other = "Contenu" other = "Contenu"
[publish] [publishedOnDate]
other = "publié le" other = "publié le {{ .Date }}"
[included] [includedInCategories]
other = "inclus dans" other = "inclus dans {{ .Categories }}"
[wordCount] [wordCount]
other = "environ {{ .Count }} mots" one = "Un mot"
other = "{{ .Count }} mots"
[readingTime] [readingTime]
other = "{{ .Count }} min" one = "Une minute"
other = "{{ .Count }} minutes"
[views] [views]
other = "vues" other = "vues"
@@ -126,13 +125,10 @@ other = "vues"
[author] [author]
other = "Auteur" other = "Auteur"
[lastMod] [updatedOnDate]
other = "Dernière mise à jour le %s" other = "Mis à jour le {{ .Date }}"
[license] [readMarkdown]
other = "Publié sous licence %s"
[seeMarkdown]
other = "Lire Markdown" other = "Lire Markdown"
[back] [back]

View File

@@ -17,7 +17,7 @@ other = "Articoli"
# === Taxonomy === # === Taxonomy ===
[allSome] [allSome]
other = "Tutti %s" other = "Tutti {{ .Some }}"
[tag] [tag]
other = "Etichetta" other = "Etichetta"
@@ -47,10 +47,7 @@ other = "Cambiare il tema"
# === partials/footer.html === # === partials/footer.html ===
[poweredBySome] [poweredBySome]
other = "Realizzato da %s" other = "Realizzato da {{ .Hugo }} | Tema - {{ .Theme }}"
[theme]
other = "Tema"
# === partials/footer.html === # === partials/footer.html ===
# === partials/comment.html === # === partials/comment.html ===
@@ -108,17 +105,19 @@ other = "Condividi su"
[contents] [contents]
other = "Contenuti" other = "Contenuti"
[publish] [publishedOnDate]
other = "pubblicato su" other = "pubblicato su {{ .Date }}"
[included] [includedInCategories]
other = "incluso in" other = "incluso in {{ .Categories }}"
[wordCount] [wordCount]
other = "circa {{ .Count }} parole" one = "Una parola"
other = "{{ .Count }} parole"
[readingTime] [readingTime]
other = "{{ .Count }} min" one = "Un minuto"
other = "{{ .Count }} minuti"
[views] [views]
other = "visualizzazioni" other = "visualizzazioni"
@@ -126,13 +125,10 @@ other = "visualizzazioni"
[author] [author]
other = "Autore" other = "Autore"
[lastMod] [updatedOnDate]
other = "L'articolo è stato modificato il %s" other = "Aggiornato il {{ .Date }}"
[license] [readMarkdown]
other = "Pubblicato sotto la licenza %s"
[seeMarkdown]
other = "Leggi Markdown" other = "Leggi Markdown"
[back] [back]

View File

@@ -17,7 +17,7 @@ other = "Posty"
# === Taxonomy === # === Taxonomy ===
[allSome] [allSome]
other = "Wszystkie %s" other = "Wszystkie {{ .Some }}"
[tag] [tag]
other = "Tag" other = "Tag"
@@ -47,10 +47,7 @@ other = "Przełącz schemat"
# === partials/footer.html === # === partials/footer.html ===
[poweredBySome] [poweredBySome]
other = "Napędzany przez %s" other = "Napędzany przez {{ .Hugo }} | Szablon - {{ .Theme }}"
[theme]
other = "Szablon"
# === partials/footer.html === # === partials/footer.html ===
# === partials/comment.html === # === partials/comment.html ===
@@ -96,17 +93,19 @@ other = "Udostępnij na"
[contents] [contents]
other = "Spis treści" other = "Spis treści"
[publish] [publishedOnDate]
other = "opublikowano" other = "opublikowano {{ .Date }}"
[included] [includedInCategories]
other = "zawarty w" other = "zawarty w {{ .Categories }}"
[wordCount] [wordCount]
other = "około {{ .Count }} słów" one = "Jedno słowo"
other = "{{ .Count }} słów"
[readingTime] [readingTime]
other = "{{ .Count }} min" one = "Jedna minuta"
other = "{{ .Count }} minuty"
[views] [views]
other = "wyświetleń" other = "wyświetleń"
@@ -114,13 +113,10 @@ other = "wyświetleń"
[author] [author]
other = "Autor" other = "Autor"
[lastMod] [updatedOnDate]
other = "Artykuł ostatnio zaktualizowany %s" other = "Zaktualizowano {{ .Date }}"
[license] [readMarkdown]
other = "Opublikowano na licencji %s"
[seeMarkdown]
other = "Zobacz Markdown" other = "Zobacz Markdown"
[back] [back]

View File

@@ -17,7 +17,7 @@ other = "Posts"
# === Taxonomy === # === Taxonomy ===
[allSome] [allSome]
other = "Todos %s" other = "Todos {{ .Some }}"
[tag] [tag]
other = "Tag" other = "Tag"
@@ -47,10 +47,7 @@ other = "Trocar tema"
# === partials/footer.html === # === partials/footer.html ===
[poweredBySome] [poweredBySome]
other = "Movido a %s" other = "Movido a {{ .Hugo }} | Tema - {{ .Theme }}"
[theme]
other = "Tema"
# === partials/footer.html === # === partials/footer.html ===
# === partials/comment.html === # === partials/comment.html ===
@@ -108,17 +105,19 @@ other = "Compartilhe em"
[contents] [contents]
other = "Conteúdos" other = "Conteúdos"
[publish] [publishedOnDate]
other = "publicado em" other = "publicado em {{ .Date }}"
[included] [includedInCategories]
other = "incluido em" other = "incluido em {{ .Categories }}"
[wordCount] [wordCount]
one = "Uma palavra"
other = "{{ .Count }} palavras" other = "{{ .Count }} palavras"
[readingTime] [readingTime]
other = "{{ .Count }} min" one = "Um minuto"
other = "{{ .Count }} minutos"
[views] [views]
other = "visualizações" other = "visualizações"
@@ -126,13 +125,10 @@ other = "visualizações"
[author] [author]
other = "Autor" other = "Autor"
[lastMod] [updatedOnDate]
other = "O artigo foi atualizado em %s" other = "Atualizado em {{ .Date }}"
[license] [readMarkdown]
other = "Publicado sobre a licença %s"
[seeMarkdown]
other = "Leia em Markdown" other = "Leia em Markdown"
[back] [back]

View File

@@ -17,7 +17,7 @@ other = "Articole"
# === Taxonomy === # === Taxonomy ===
[allSome] [allSome]
other = "Toate %s" other = "Toate {{ .Some }}"
[tag] [tag]
other = "Etichetă" other = "Etichetă"
@@ -47,10 +47,7 @@ other = "Schimbare Temă"
# === partials/footer.html === # === partials/footer.html ===
[poweredBySome] [poweredBySome]
other = "Realizat de către %s" other = "Realizat de către {{ .Hugo }} | Temă - {{ .Theme }}"
[theme]
other = "Temă"
# === partials/footer.html === # === partials/footer.html ===
# === partials/comment.html === # === partials/comment.html ===
@@ -108,17 +105,19 @@ other = "Distribuie pe"
[contents] [contents]
other = "Cuprins" other = "Cuprins"
[publish] [publishedOnDate]
other = "publicat la" other = "publicat la {{ .Date }}"
[included] [includedInCategories]
other = "inclus în" other = "inclus în {{ .Categories }}"
[wordCount] [wordCount]
other = "aproximativ {{ .Count }} cuvinte" one = "Un cuvânt"
other = "{{ .Count }} cuvinte"
[readingTime] [readingTime]
other = "{{ .Count }} min" one = "Un minut"
other = "{{ .Count }} minute"
[views] [views]
other = "vizualizări" other = "vizualizări"
@@ -126,13 +125,10 @@ other = "vizualizări"
[author] [author]
other = "Autor" other = "Autor"
[lastMod] [updatedOnDate]
other = "Articolul a fost actualizat la %s" other = "Actualizat la {{ .Date }}"
[license] [readMarkdown]
other = "Publicat sub licența %s"
[seeMarkdown]
other = "Citire Markdown" other = "Citire Markdown"
[back] [back]

View File

@@ -17,7 +17,7 @@ other = "Статьи"
# === Taxonomy === # === Taxonomy ===
[allSome] [allSome]
other = "Все %s" other = "Все {{ .Some }}"
[tag] [tag]
other = "Тэг" other = "Тэг"
@@ -47,10 +47,7 @@ other = "Сменить Тему"
# === partials/footer.html === # === partials/footer.html ===
[poweredBySome] [poweredBySome]
other = "Сделано %s" other = "Сделано {{ .Hugo }} | Тема - {{ .Theme }}"
[theme]
other = "Тема"
# === partials/footer.html === # === partials/footer.html ===
# === partials/comment.html === # === partials/comment.html ===
@@ -108,17 +105,19 @@ other = "Поделиться в"
[contents] [contents]
other = "Содержание" other = "Содержание"
[publish] [publishedOnDate]
other = "Опубликовано" other = "Опубликовано {{ .Date }}"
[included] [includedInCategories]
other = "включен в" other = "включен в {{ .Categories }}"
[wordCount] [wordCount]
other = "около {{ .Count }} слов" one = "Одно слово"
other = "{{ .Count }} слов"
[readingTime] [readingTime]
other = "{{ .Count }} мин" one = "Одна минута"
other = "{{ .Count }} минут"
[views] [views]
other = "просмотров" other = "просмотров"
@@ -126,13 +125,10 @@ other = "просмотров"
[author] [author]
other = "Автор" other = "Автор"
[lastMod] [updatedOnDate]
other = "Статья была обновлена %s" other = "Oбновлена {{ .Date }}"
[license] [readMarkdown]
other = "Опубликовано под лицензии %s"
[seeMarkdown]
other = "Читать Markdown" other = "Читать Markdown"
[back] [back]

View File

@@ -17,7 +17,7 @@ other = "Постови"
# === Taxonomy === # === Taxonomy ===
[allSome] [allSome]
other = "Све %s" other = "Све {{ .Some }}"
[tag] [tag]
other = "Таг" other = "Таг"
@@ -47,10 +47,7 @@ other = "Промени Тему"
# === partials/footer.html === # === partials/footer.html ===
[poweredBySome] [poweredBySome]
other = "Покреће %s" other = "Покреће {{ .Hugo }} | Тема - {{ .Theme }}"
[theme]
other = "Тема"
# === partials/footer.html === # === partials/footer.html ===
# === partials/comment.html === # === partials/comment.html ===
@@ -105,17 +102,19 @@ other = "Подели на"
[contents] [contents]
other = "Садржаји" other = "Садржаји"
[publish] [publishedOnDate]
other = "објављено" other = "објављено {{ .Date }}"
[included] [includedInCategories]
other = "укључено" other = "укључено {{ .Categories }}"
[wordCount] [wordCount]
other = "око {{ .Count }} речи" one = "Једна реч"
other = "{{ .Count }} речи"
[readingTime] [readingTime]
other = "{{ .Count }} мин" one = "Један минут"
other = "{{ .Count }} минута"
[views] [views]
other = "прегледа" other = "прегледа"
@@ -123,13 +122,10 @@ other = "прегледа"
[author] [author]
other = "Аутор" other = "Аутор"
[lastMod] [updatedOnDate]
other = "Чланак је обновљен %s" other = "Ажурирано {{ .Date }}"
[license] [readMarkdown]
other = "Објављено под условима %s лиценце"
[seeMarkdown]
other = "Читај Markdown" other = "Читај Markdown"
[back] [back]

View File

@@ -17,7 +17,7 @@ other = "文章"
# === Taxonomy === # === Taxonomy ===
[allSome] [allSome]
other = "所有%s" other = "所有{{ .Some }}"
[tag] [tag]
other = "标签" other = "标签"
@@ -47,10 +47,7 @@ other = "切换主题"
# === partials/footer.html === # === partials/footer.html ===
[poweredBySome] [poweredBySome]
other = "由 %s 强力驱动" other = "由 {{ .Hugo }} 强力驱动 | 主题 - {{ .Theme }}"
[theme]
other = "主题"
# === partials/footer.html === # === partials/footer.html ===
# === partials/comment.html === # === partials/comment.html ===
@@ -111,17 +108,17 @@ other = "分享到"
[contents] [contents]
other = "目录" other = "目录"
[publish] [publishedOnDate]
other = "发布于" other = "发布于 {{ .Date }}"
[included] [includedInCategories]
other = "收录于" other = "收录于 {{ .Categories }}"
[wordCount] [wordCount]
other = "{{ .Count }} 字" other = "{{ .Count }} 字"
[readingTime] [readingTime]
other = "预计阅读 {{ .Count }} 分钟" other = "{{ .Count }} 分钟"
[views] [views]
other = "次阅读" other = "次阅读"
@@ -129,13 +126,10 @@ other = "次阅读"
[author] [author]
other = "作者" other = "作者"
[lastMod] [updatedOnDate]
other = "本文于 %s 更新" other = "更新于 {{ .Date }}"
[license] [readMarkdown]
other = "采用 %s 协议发布"
[seeMarkdown]
other = "阅读原始文档" other = "阅读原始文档"
[back] [back]

View File

@@ -1,5 +1,5 @@
{{- define "title" }} {{- define "title" }}
{{- T "pageNotFound" | printf "404 %s" }} - {{ .Site.Title -}} {{- T "pageNotFound" | printf "404 %v" }} - {{ .Site.Title -}}
{{- end -}} {{- end -}}
{{- define "content" -}} {{- define "content" -}}

View File

@@ -1,12 +1,12 @@
{{- define "title" }} {{- define "title" }}
{{- .Params.Title | default (T .Section) | default .Section | string | printf (T "allSome" | string) }} - {{ .Site.Title -}} {{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "allSome" }} - {{ .Site.Title -}}
{{- end -}} {{- end -}}
{{- define "content" -}} {{- define "content" -}}
<div class="page archive"> <div class="page archive">
{{- /* Title */ -}} {{- /* Title */ -}}
<h2 class="single-title animated pulse faster"> <h2 class="single-title animated pulse faster">
{{- .Params.Title | default (T .Section) | default .Section | string | printf (T "allSome" | string) -}} {{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "allSome" -}}
</h2> </h2>
{{- /* Paginate */ -}} {{- /* Paginate */ -}}
@@ -25,7 +25,7 @@
{{- .Title -}} {{- .Title -}}
</a> </a>
<span class="archive-item-date"> <span class="archive-item-date">
{{- .Date.Format ($.Site.Params.section.dateFormat | default "01-02") -}} {{- $.Site.Params.section.dateFormat | default "01-02" | .Date.Format -}}
</span> </span>
</article> </article>
{{- end -}} {{- end -}}

View File

@@ -23,22 +23,20 @@
{{- partial "plugin/link.html" $options -}} {{- partial "plugin/link.html" $options -}}
</span> </span>
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormat | default "2006-01-02") -}} {{- with .Site.Params.dateFormat | default "2006-01-02" | .PublishDate.Format -}}
&nbsp;<span class="post-publish"> &nbsp;<span class="post-publish">
{{ T "publish" }}&nbsp;<time datetime={{ $publish_date }}>{{ $publish_date }}</time> {{- printf `<time datetime="%v">%v</time>` . . | dict "Date" | T "publishedOnDate" | safeHTML -}}
</span> </span>
{{- end -}}
{{- with .Params.categories -}} {{- $categories := slice -}}
&nbsp; {{- range .Params.categories -}}
<span class="post-category"> {{- $category := . | anchorize | printf "/categories/%v" | $.Site.GetPage -}}
{{- T "included" -}} {{- $categories = $categories | append (printf `<a href="%v"><i class="far fa-folder fa-fw"></i>%v</a>` $category.RelPermalink $category.Title) -}}
{{- range $index, $value := . -}} {{- end -}}
{{- if gt $index 0 }}&nbsp;{{ end -}} {{- with delimit $categories "&nbsp;" -}}
{{- $category := $value | anchorize | printf "/categories/%s" | $.Site.GetPage -}} &nbsp;<span class="post-category">
<a href="{{ $category.RelPermalink }}"> {{- dict "Categories" . | T "includedInCategories" | safeHTML -}}
<i class="far fa-folder fa-fw"></i>{{ $category.Title }}
</a>
{{- end -}}
</span> </span>
{{- end -}} {{- end -}}
</div> </div>
@@ -60,7 +58,7 @@
<i class="fas fa-tags fa-fw"></i>&nbsp; <i class="fas fa-tags fa-fw"></i>&nbsp;
{{- range $index, $value := . -}} {{- range $index, $value := . -}}
{{- if gt $index 0 }},&nbsp;{{ end -}} {{- if gt $index 0 }},&nbsp;{{ end -}}
{{- $tag := $value | anchorize | printf "/tags/%s" | $.Site.GetPage -}} {{- $tag := $value | anchorize | printf "/tags/%v" | $.Site.GetPage -}}
<a href="{{ $tag.RelPermalink }}">{{ $tag.Title }}</a> <a href="{{ $tag.RelPermalink }}">{{ $tag.Title }}</a>
{{- end -}} {{- end -}}
</div> </div>

View File

@@ -12,7 +12,7 @@
{{- $uri = .Permalink -}} {{- $uri = .Permalink -}}
{{- end -}} {{- end -}}
{{- $meta := dict "uri" $uri "title" .Title "tags" .Params.tags "categories" .Params.categories -}} {{- $meta := dict "uri" $uri "title" .Title "tags" .Params.tags "categories" .Params.categories -}}
{{- $meta = .PublishDate.Format ($.Site.Params.dateFormat | default "2006-01-02") | dict "date" | merge $meta -}} {{- $meta = $.Site.Params.dateFormat | default "2006-01-02" | .PublishDate.Format | dict "date" | merge $meta -}}
{{- with .Description -}} {{- with .Description -}}
{{- $index = $index | append (dict "content" . "objectID" $uri | merge $meta) -}} {{- $index = $index | append (dict "content" . "objectID" $uri | merge $meta) -}}
{{- end -}} {{- end -}}
@@ -23,11 +23,11 @@
{{- $content = $content | replaceRE `<span class="lnt?"> *\d*\n?</span>` "" -}} {{- $content = $content | replaceRE `<span class="lnt?"> *\d*\n?</span>` "" -}}
{{- range $i, $contenti := split $content "<h2 id=" -}} {{- range $i, $contenti := split $content "<h2 id=" -}}
{{- if gt $i 0 -}} {{- if gt $i 0 -}}
{{- $contenti = printf "<h2 id=%s" $contenti -}} {{- $contenti = printf "<h2 id=%v" $contenti -}}
{{- end -}} {{- end -}}
{{- range $j, $contentj := split $contenti "<h3 id=" -}} {{- range $j, $contentj := split $contenti "<h3 id=" -}}
{{- if gt $j 0 -}} {{- if gt $j 0 -}}
{{- $contentj = printf "<h3 id=%s" $contentj -}} {{- $contentj = printf "<h3 id=%v" $contentj -}}
{{- end -}} {{- end -}}
{{/* Plainify, unescape and remove (\n, \t) */}} {{/* Plainify, unescape and remove (\n, \t) */}}
{{- $contentj = $contentj | plainify | htmlUnescape | replaceRE `[\n\t ]+` " " -}} {{- $contentj = $contentj | plainify | htmlUnescape | replaceRE `[\n\t ]+` " " -}}
@@ -35,7 +35,7 @@
{{- $contentj = substr $contentj 0 $.Site.Params.search.contentLength -}} {{- $contentj = substr $contentj 0 $.Site.Params.search.contentLength -}}
{{- end -}} {{- end -}}
{{- if $contentj | and (ne $contentj " ") -}} {{- if $contentj | and (ne $contentj " ") -}}
{{- $one := printf "%s:%d:%d" $uri $i $j | dict "content" $contentj "objectID" | merge $meta -}} {{- $one := printf "%v:%v:%v" $uri $i $j | dict "content" $contentj "objectID" | merge $meta -}}
{{- $index = $index | append $one -}} {{- $index = $index | append $one -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View File

@@ -9,7 +9,7 @@
{{- $disqus := $comment.disqus | default dict -}} {{- $disqus := $comment.disqus | default dict -}}
{{- if $disqus.enable -}} {{- if $disqus.enable -}}
<div id="disqus_thread" class="comment"></div> <div id="disqus_thread" class="comment"></div>
{{- $source := printf "https://%s.disqus.com/embed.js" $disqus.shortname -}} {{- $source := printf "https://%v.disqus.com/embed.js" $disqus.shortname -}}
{{- dict "source" $source "defer" true | dict "scratch" .Scratch "data" | partial "scratch/script.html" -}} {{- dict "source" $source "defer" true | dict "scratch" .Scratch "data" | partial "scratch/script.html" -}}
<noscript> <noscript>
Please enable JavaScript to view the comments powered by <a href="https://disqus.com/?ref_noscript">Disqus</a>. Please enable JavaScript to view the comments powered by <a href="https://disqus.com/?ref_noscript">Disqus</a>.
@@ -51,7 +51,7 @@
{{- with $valine.serverURLs -}} {{- with $valine.serverURLs -}}
{{- $commentConfig = dict "serverURLs" . | dict "valine" | merge $commentConfig -}} {{- $commentConfig = dict "serverURLs" . | dict "valine" | merge $commentConfig -}}
{{- end -}} {{- end -}}
{{- $commentConfig = $valine.emoji | default "google.yml" | printf "data/emoji/%s" | resources.Get | transform.Unmarshal | dict "valine" | merge $commentConfig -}} {{- $commentConfig = $valine.emoji | default "google.yml" | printf "data/emoji/%v" | resources.Get | transform.Unmarshal | dict "valine" | merge $commentConfig -}}
<noscript> <noscript>
Please enable JavaScript to view the comments powered by <a href="https://valine.js.org/">Valine</a>. Please enable JavaScript to view the comments powered by <a href="https://valine.js.org/">Valine</a>.
</noscript> </noscript>
@@ -67,7 +67,7 @@
data-width="{{ $facebook.width }}" data-width="{{ $facebook.width }}"
data-numposts="{{ $facebook.numPosts }}" data-numposts="{{ $facebook.numPosts }}"
></div> ></div>
{{- $source := printf "https://connect.facebook.net/%s/sdk.js#xfbml=1&version=v5.0&appId=%s&autoLogAppEvents=1" ($facebook.languageCode | default (T "facebookLanguageCode")) $facebook.appId -}} {{- $source := printf "https://connect.facebook.net/%v/sdk.js#xfbml=1&version=v5.0&appId=%v&autoLogAppEvents=1" ($facebook.languageCode | default (T "facebookLanguageCode")) $facebook.appId -}}
{{- dict "source" $source "defer" true | dict "scratch" .Scratch "data" | partial "scratch/script.html" -}} {{- dict "source" $source "defer" true | dict "scratch" .Scratch "data" | partial "scratch/script.html" -}}
<noscript> <noscript>
Please enable JavaScript to view the comments powered by <a href="https://developers.facebook.com/docs/plugins/comments/"></a>Facebook</a>. Please enable JavaScript to view the comments powered by <a href="https://developers.facebook.com/docs/plugins/comments/"></a>Facebook</a>.
@@ -78,22 +78,22 @@
{{- $telegram := $comment.telegram | default dict -}} {{- $telegram := $comment.telegram | default dict -}}
{{- if $telegram.enable -}} {{- if $telegram.enable -}}
<div id="telegram-comments" class="comment"></div> <div id="telegram-comments" class="comment"></div>
{{- $attr := printf `data-comments-app-website="%s"` $telegram.siteID -}} {{- $attr := printf `data-comments-app-website="%v"` $telegram.siteID -}}
{{- $attr = printf `%s data-limit="%s"` $attr ($telegram.limit | default 5) -}} {{- $attr = printf `%v data-limit="%v"` $attr ($telegram.limit | default 5) -}}
{{- with $telegram.height -}} {{- with $telegram.height -}}
{{- $attr = printf `%s data-height="%s"` $attr . -}} {{- $attr = printf `%v data-height="%v"` $attr . -}}
{{- end -}} {{- end -}}
{{- with $telegram.color -}} {{- with $telegram.color -}}
{{- $attr = printf `%s data-color="%s"` $attr . -}} {{- $attr = printf `%v data-color="%v"` $attr . -}}
{{- end -}} {{- end -}}
{{- if $telegram.colorful -}} {{- if $telegram.colorful -}}
{{- $attr = printf `%s data-colorful="1"` $attr -}} {{- $attr = printf `%v data-colorful="1"` $attr -}}
{{- end -}} {{- end -}}
{{- if $telegram.dislikes -}} {{- if $telegram.dislikes -}}
{{- $attr = printf `%s data-dislikes="1"` $attr -}} {{- $attr = printf `%v data-dislikes="1"` $attr -}}
{{- end -}} {{- end -}}
{{- if $telegram.outlined -}} {{- if $telegram.outlined -}}
{{- $attr = printf `%s data-outlined="1"` $attr -}} {{- $attr = printf `%v data-outlined="1"` $attr -}}
{{- end -}} {{- end -}}
{{- dict "source" "https://comments.app/js/widget.js?2" "defer" true "attr" $attr | dict "scratch" .Scratch "data" | partial "scratch/script.html" -}} {{- dict "source" "https://comments.app/js/widget.js?2" "defer" true "attr" $attr | dict "scratch" .Scratch "data" | partial "scratch/script.html" -}}
<noscript> <noscript>

View File

@@ -11,8 +11,9 @@
{{- /* Hugo and LoveIt */ -}} {{- /* Hugo and LoveIt */ -}}
{{- if ne .Site.Params.footer.hugo false -}} {{- if ne .Site.Params.footer.hugo false -}}
<div class="footer-line"> <div class="footer-line">
{{- $hugo := printf `<a href="https://gohugo.io/" target="_blank" rel="noopener noreffer" title="Hugo %s">Hugo</a>` hugo.Version -}} {{- $hugo := printf `<a href="https://gohugo.io/" target="_blank" rel="noopener noreffer" title="Hugo %v">Hugo</a>` hugo.Version -}}
{{- $hugo | string | printf (T "poweredBySome" | string) | safeHTML }} | {{ T "theme" }} - <a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="noopener noreffer" title="LoveIt {{ .Scratch.Get `version` }}"><i class="far fa-kiss-wink-heart fa-fw"></i> LoveIt</a> {{- $theme := .Scratch.Get "version" | printf `<a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="noopener noreffer" title="LoveIt %v"><i class="far fa-kiss-wink-heart fa-fw"></i> LoveIt</a>` -}}
{{- dict "Hugo" $hugo "Theme" $theme | T "poweredBySome" | safeHTML }}
</div> </div>
{{- end -}} {{- end -}}

View File

@@ -2,7 +2,7 @@
<div class="home-profile"> <div class="home-profile">
{{- $avatar := $profile.avatarURL -}} {{- $avatar := $profile.avatarURL -}}
{{- with $profile.gravatarEmail -}} {{- with $profile.gravatarEmail -}}
{{- $avatar = md5 . | printf "https://www.gravatar.com/avatar/%s?s=240&d=mp" -}} {{- $avatar = md5 . | printf "https://www.gravatar.com/avatar/%v?s=240&d=mp" -}}
{{- end -}} {{- end -}}
{{- if $avatar -}} {{- if $avatar -}}
<div class="home-avatar"> <div class="home-avatar">

View File

@@ -6,7 +6,7 @@
{{- if not .Site.Params.version -}} {{- if not .Site.Params.version -}}
{{- errorf "Configuration Error 配置文件错误\n\nYou haven't configured the LoveIt version param correctly yet. See https://hugoloveit.com/theme-documentation-basics/#basic-configuration\n你还没有正确配置 LoveIt 的版本参数. 参考 https://hugoloveit.com/zh-cn/theme-documentation-basics/#basic-configuration\n" -}} {{- errorf "Configuration Error 配置文件错误\n\nYou haven't configured the LoveIt version param correctly yet. See https://hugoloveit.com/theme-documentation-basics/#basic-configuration\n你还没有正确配置 LoveIt 的版本参数. 参考 https://hugoloveit.com/zh-cn/theme-documentation-basics/#basic-configuration\n" -}}
{{- else if ne .Site.Params.version $VERSION -}} {{- else if ne .Site.Params.version $VERSION -}}
{{- errorf (printf "Compatibility Error 兼容性错误\n\n%s -> %s:\nYou have an incompatible update. See https://github.com/dillonzq/LoveIt/releases\n你进行了一次不兼容的更新. 参考 https://github.com/dillonzq/LoveIt/releases\n" .Site.Params.version $VERSION) -}} {{- errorf (printf "Compatibility Error 兼容性错误\n\n%v -> %v:\nYou have an incompatible update. See https://github.com/dillonzq/LoveIt/releases\n你进行了一次不兼容的更新. 参考 https://github.com/dillonzq/LoveIt/releases\n" .Site.Params.version $VERSION) -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
@@ -15,11 +15,11 @@
{{- if eq hugo.Environment "production" -}} {{- if eq hugo.Environment "production" -}}
{{- $cdn := .Site.Params.cdn -}} {{- $cdn := .Site.Params.cdn -}}
{{- with $cdn.data -}} {{- with $cdn.data -}}
{{- $cdnData := printf "data/cdn/%s" . | resources.Get | transform.Unmarshal -}} {{- $cdnData := printf "data/cdn/%v" . | resources.Get | transform.Unmarshal -}}
{{- $cdn = dict "simpleIconsPrefix" $cdnData.prefix.simpleIcons -}} {{- $cdn = dict "simpleIconsPrefix" $cdnData.prefix.simpleIcons -}}
{{- $prefix := $cdnData.prefix.libFiles | default "" -}} {{- $prefix := $cdnData.prefix.libFiles | default "" -}}
{{- range $key, $value := $cdnData.libFiles -}} {{- range $key, $value := $cdnData.libFiles -}}
{{- $cdn = printf "%s%s" $prefix $value | dict $key | merge $cdn -}} {{- $cdn = printf "%v%v" $prefix $value | dict $key | merge $cdn -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- .Scratch.Set "cdn" $cdn -}} {{- .Scratch.Set "cdn" $cdn -}}

View File

@@ -5,7 +5,7 @@
window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js', new Date()); window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());
gtag('config', '{{ . }}'{{ if $.google.anonymizeIP }}, { 'anonymize_ip': true }{{ end }}); gtag('config', '{{ . }}'{{ if $.google.anonymizeIP }}, { 'anonymize_ip': true }{{ end }});
</script> </script>
{{- printf "https://www.googletagmanager.com/gtag/js?id=%s" . | dict "async" true "source" | partial "plugin/script.html" -}} {{- printf "https://www.googletagmanager.com/gtag/js?id=%v" . | dict "async" true "source" | partial "plugin/script.html" -}}
{{- end -}} {{- end -}}
{{- /* Fathom Analytics */ -}} {{- /* Fathom Analytics */ -}}
@@ -15,6 +15,6 @@
fathom('set', 'siteId', '{{ . }}'); fathom('set', 'siteId', '{{ . }}');
fathom('trackPageview'); fathom('trackPageview');
</script> </script>
{{- dict "source" ($.fathom.server | default "cdn.usefathom.com" | printf "https://%s/tracker.js") "async" true "attr" "id=fathom-script" | partial "plugin/script.html" -}} {{- dict "source" ($.fathom.server | default "cdn.usefathom.com" | printf "https://%v/tracker.js") "async" true "attr" "id=fathom-script" | partial "plugin/script.html" -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View File

@@ -11,7 +11,7 @@
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- with $features | uniq -}} {{- with $features | uniq -}}
{{- delimit . "%2C" | printf "https://polyfill.io/v3/polyfill.min.js?features=%s" | dict "source" | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}} {{- delimit . "%2C" | printf "https://polyfill.io/v3/polyfill.min.js?features=%v" | dict "source" | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View File

@@ -8,7 +8,7 @@
{{- $prefix = . -}} {{- $prefix = . -}}
{{- end -}} {{- end -}}
{{- $prefix = $prefix | strings.TrimSuffix "/" -}} {{- $prefix = $prefix | strings.TrimSuffix "/" -}}
{{- $src = printf "%s/%s.svg" $prefix . -}} {{- $src = printf "%v/%v.svg" $prefix . -}}
{{- end -}} {{- end -}}
{{- if (urls.Parse $src).Host | not -}} {{- if (urls.Parse $src).Host | not -}}
{{- $src = (resources.Get $src | minify).RelPermalink -}} {{- $src = (resources.Get $src | minify).RelPermalink -}}

View File

@@ -2,9 +2,9 @@
{{- with .url -}} {{- with .url -}}
{{- $href = . | relLangURL -}} {{- $href = . | relLangURL -}}
{{- else -}} {{- else -}}
{{- $template := .template | default "%s" -}} {{- $template := .template | default "%v" -}}
{{- with .prefix -}} {{- with .prefix -}}
{{- $template = . | strings.TrimSuffix "/" | printf "%s/%%s" -}} {{- $template = . | strings.TrimSuffix "/" | printf "%v/%%v" -}}
{{- end -}} {{- end -}}
{{- $href = printf (string $template) .id -}} {{- $href = printf (string $template) .id -}}
{{- end -}} {{- end -}}

View File

@@ -1,17 +1,18 @@
{{- $params := .Scratch.Get "params" -}} {{- $params := .Scratch.Get "params" -}}
{{- $modify_date := .Lastmod.Format (.Site.Params.dateformat | default "2006-01-02") -}}
<div class="post-footer" id="post-footer"> <div class="post-footer" id="post-footer">
<div class="post-info"> <div class="post-info">
<div class="post-info-line"> <div class="post-info-line">
<div class="post-info-mod"> <div class="post-info-mod">
<span> <span>
{{- $modify_date | string | printf (T "lastMod" | string) -}} {{- with .Site.Params.dateformat | default "2006-01-02" | .Lastmod.Format -}}
{{- if .Site.Params.gitRepo -}} {{- dict "Date" . | T "updatedOnDate" -}}
{{- with .GitInfo -}} {{- if $.Site.Params.gitRepo -}}
&nbsp;<a class="git-hash" href="{{ printf `%s/commit/%s` $.Site.Params.gitRepo .Hash }}" target="_blank" title="commit by {{ .AuthorName }}({{ .AuthorEmail }}) {{ .Hash }}: {{ .Subject }}"> {{- with $.GitInfo -}}
<i class="fas fa-hashtag fa-fw"></i>{{- .AbbreviatedHash -}} &nbsp;<a class="git-hash" href="{{ printf `%v/commit/%v` $.Site.Params.gitRepo .Hash }}" target="_blank" title="commit by {{ .AuthorName }}({{ .AuthorEmail }}) {{ .Hash }}: {{ .Subject }}">
</a> <i class="fas fa-hashtag fa-fw"></i>{{- .AbbreviatedHash -}}
</a>
{{- end -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
</span> </span>
@@ -19,7 +20,7 @@
<div class="post-info-license"> <div class="post-info-license">
{{- with $params.license | string -}} {{- with $params.license | string -}}
<span> <span>
{{- printf (T "license" | string) . | safeHTML -}} {{- . | safeHTML -}}
</span> </span>
{{- end -}} {{- end -}}
</div> </div>
@@ -30,7 +31,7 @@
{{- with .OutputFormats.Get "markdown" -}} {{- with .OutputFormats.Get "markdown" -}}
<span> <span>
<a class="link-to-markdown" href="{{ .RelPermalink }}" target="_blank"> <a class="link-to-markdown" href="{{ .RelPermalink }}" target="_blank">
{{- T "seeMarkdown" -}} {{- T "readMarkdown" -}}
</a> </a>
</span> </span>
{{- end -}} {{- end -}}
@@ -50,7 +51,7 @@
<i class="fas fa-tags fa-fw"></i>&nbsp; <i class="fas fa-tags fa-fw"></i>&nbsp;
{{- range $index, $value := . -}} {{- range $index, $value := . -}}
{{- if gt $index 0 }},&nbsp;{{ end -}} {{- if gt $index 0 }},&nbsp;{{ end -}}
{{- $tag := $value | anchorize | printf "/tags/%s" | $.Site.GetPage -}} {{- $tag := $value | anchorize | printf "/tags/%v" | $.Site.GetPage -}}
<a href="{{ $tag.RelPermalink }}">{{ $tag.Title }}</a> <a href="{{ $tag.RelPermalink }}">{{ $tag.Title }}</a>
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View File

@@ -1,13 +1,13 @@
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"> <rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel> <channel>
<title> <title>
{{- .Params.Title | default (T .Section) | default .Section | string | printf (T "allSome" | string) }} - {{ .Site.Title -}} {{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "allSome" }} - {{ .Site.Title -}}
</title> </title>
<link> <link>
{{- .Permalink -}} {{- .Permalink -}}
</link> </link>
<description> <description>
{{- .Params.Title | default (T .Section) | default .Section | string | printf (T "allSome" | string) }} | {{ .Site.Title -}} {{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "allSome" }} | {{ .Site.Title -}}
</description> </description>
<generator>Hugo -- gohugo.io</generator> <generator>Hugo -- gohugo.io</generator>
{{- with .Site.LanguageCode -}} {{- with .Site.LanguageCode -}}

View File

@@ -37,23 +37,21 @@
{{- partial "plugin/link.html" $options -}} {{- partial "plugin/link.html" $options -}}
</span> </span>
{{- with .Params.categories -}} {{- $categories := slice -}}
&nbsp; {{- range .Params.categories -}}
<span class="post-category"> {{- $category := . | anchorize | printf "/categories/%v" | $.Site.GetPage -}}
{{- T "included" -}} {{- $categories = $categories | append (printf `<a href="%v"><i class="far fa-folder fa-fw"></i>%v</a>` $category.RelPermalink $category.Title) -}}
{{- range $index, $value := . -}} {{- end -}}
{{- if gt $index 0 }}&nbsp;{{ end -}} {{- with delimit $categories "&nbsp;" -}}
{{- $category := $value | anchorize | printf "/categories/%s" | $.Site.GetPage -}} &nbsp;<span class="post-category">
<a href="{{ $category.RelPermalink }}"> {{- dict "Categories" . | T "includedInCategories" | safeHTML -}}
<i class="far fa-folder fa-fw"></i>{{ $category.Title }}
</a>
{{- end -}}
</span> </span>
{{- end -}} {{- end -}}
</div> </div>
<div class="post-meta-line"> <div class="post-meta-line">
{{- $publish_date := .PublishDate.Format (.Site.Params.dateformat | default "2006-01-02") -}} {{- with .Site.Params.dateformat | default "2006-01-02" | .PublishDate.Format -}}
<i class="far fa-calendar-alt fa-fw"></i>&nbsp;<time datetime={{ $publish_date }}>{{ $publish_date }}</time>&nbsp; <i class="far fa-calendar-alt fa-fw"></i>&nbsp;<time datetime="{{ . }}">{{ . }}</time>&nbsp;
{{- end -}}
<i class="fas fa-pencil-alt fa-fw"></i>&nbsp;{{ T "wordCount" .WordCount }}&nbsp; <i class="fas fa-pencil-alt fa-fw"></i>&nbsp;{{ T "wordCount" .WordCount }}&nbsp;
<i class="far fa-clock fa-fw"></i>&nbsp;{{ T "readingTime" .ReadingTime }}&nbsp; <i class="far fa-clock fa-fw"></i>&nbsp;{{ T "readingTime" .ReadingTime }}&nbsp;
{{- $comment := .Scratch.Get "comment" | default dict -}} {{- $comment := .Scratch.Get "comment" | default dict -}}

View File

@@ -1,11 +1,11 @@
{{- $content := .Inner | .Page.RenderString -}} {{- $content := .Inner | .Page.RenderString -}}
{{- $id := dict "scratch" .Page.Scratch | partial "function/id.html" -}} {{- $id := dict "scratch" .Page.Scratch | partial "function/id.html" -}}
{{- $tag := .Get 1 | default "div" -}} {{- $tag := .Get 1 | default "div" -}}
{{- printf `<%s id="%s">%s</%s>` $tag $id $content $tag | safeHTML -}} {{- printf `<%v id="%v">%v</%v>` $tag $id $content $tag | safeHTML -}}
{{- $style := .Get 0 | printf "#%s{%s}" $id -}} {{- $style := .Get 0 | printf "#%v{%v}" $id -}}
{{- $path := printf "style/%s/%s" (md5 .Page.RelPermalink) $id -}} {{- $path := printf "style/%v/%v" (md5 .Page.RelPermalink) $id -}}
{{- $res := resources.FromString (printf "%s.scss" $path) $style -}} {{- $res := resources.FromString (printf "%v.scss" $path) $style -}}
{{- $res = $res | toCSS (dict "targetPath" (printf "%s.css" $path) "outputStyle" "compressed") -}} {{- $res = $res | toCSS (dict "targetPath" (printf "%v.css" $path) "outputStyle" "compressed") -}}
{{- $styleArr := (.Page.Scratch.Get "this").styleArr | default slice -}} {{- $styleArr := (.Page.Scratch.Get "this").styleArr | default slice -}}
{{- $styleArr | append $res.Content | .Page.Scratch.SetInMap "this" "styleArr" -}} {{- $styleArr | append $res.Content | .Page.Scratch.SetInMap "this" "styleArr" -}}

View File

@@ -27,5 +27,5 @@
{{- dict $key $group | merge $typeitMap | .Page.Scratch.SetInMap "this" "typeitMap" -}} {{- dict $key $group | merge $typeitMap | .Page.Scratch.SetInMap "this" "typeitMap" -}}
<div class="typeit"> <div class="typeit">
{{- printf `<%s id="%s" class="%s"></%s>` $tag $id (delimit $classList " ") $tag | safeHTML -}} {{- printf `<%v id="%v" class="%v"></%v>` $tag $id (delimit $classList " ") $tag | safeHTML -}}
</div> </div>

View File

@@ -1,13 +1,13 @@
{{- $version := .Get 0 -}} {{- $version := .Get 0 -}}
{{- $url := printf "https://github.com/dillonzq/LoveIt/releases/tag/v%s" $version -}} {{- $url := printf "https://github.com/dillonzq/LoveIt/releases/tag/v%v" $version -}}
{{- $type := .Get 1 | default "new" | lower -}} {{- $type := .Get 1 | default "new" | lower -}}
{{- $label := T $type -}} {{- $label := T $type -}}
{{- $color := cond (eq $type "changed") "ff9101" "00b1ff" | cond (eq $type "deleted") "ff5252" -}} {{- $color := cond (eq $type "changed") "ff9101" "00b1ff" | cond (eq $type "deleted") "ff5252" -}}
{{- $pathTemplate := cond .Site.IsMultiLingual (printf "svg/version/%%s-%%s.%s.svg" .Page.Language.Lang) "svg/version/%s-%s.svg" -}} {{- $pathTemplate := cond .Site.IsMultiLingual (printf "svg/version/%%v-%%v.%v.svg" .Page.Language.Lang) "svg/version/%v-%v.svg" -}}
{{- $path := printf $pathTemplate $version $type -}} {{- $path := printf $pathTemplate $version $type -}}
{{- $res := resources.Get "svg/version.template.svg" -}} {{- $res := resources.Get "svg/version.template.svg" -}}
{{- $res = $res | resources.ExecuteAsTemplate $path (dict "version" $version "label" $label "color" $color) | minify -}} {{- $res = $res | resources.ExecuteAsTemplate $path (dict "version" $version "label" $label "color" $color) | minify -}}
{{- $alt := printf "LoveIt %s | %s" $label $version -}} {{- $alt := printf "LoveIt %v | %v" $label $version -}}
<a href="{{ $url }}" rel="noopener noreffer" target="_blank"> <a href="{{ $url }}" rel="noopener noreffer" target="_blank">
{{- dict "src" $res.RelPermalink "alt" $alt "class" "version" | partial "plugin/image.html" -}} {{- dict "src" $res.RelPermalink "alt" $alt "class" "version" | partial "plugin/image.html" -}}
</a> </a>

View File

@@ -12,7 +12,7 @@
{{- else if eq $taxonomy "tag" -}} {{- else if eq $taxonomy "tag" -}}
<i class="fas fa-tag fa-fw"></i>&nbsp;{{ .Title }} <i class="fas fa-tag fa-fw"></i>&nbsp;{{ .Title }}
{{- else -}} {{- else -}}
{{- printf "%s - %s" (T $taxonomy | default $taxonomy) .Title -}} {{- printf "%v - %v" (T $taxonomy | default $taxonomy) .Title -}}
{{- end -}} {{- end -}}
</h2> </h2>
@@ -32,7 +32,7 @@
{{- .Title -}} {{- .Title -}}
</a> </a>
<span class="archive-item-date"> <span class="archive-item-date">
{{- .Date.Format ($.Site.Params.list.dateFormat | default "01-02") -}} {{- $.Site.Params.list.dateFormat | default "01-02" | .Date.Format -}}
</span> </span>
</article> </article>
{{- end -}} {{- end -}}

View File

@@ -1,5 +1,5 @@
{{- define "title" -}} {{- define "title" -}}
{{- .Params.Title | default (T .Data.Plural) | default .Data.Plural | string | printf (T "allSome" | string) }} - {{ .Site.Title -}} {{- .Params.Title | default (T .Data.Plural) | default .Data.Plural | dict "Some" | T "allSome" }} - {{ .Site.Title -}}
{{- end -}} {{- end -}}
{{- define "content" -}} {{- define "content" -}}
@@ -10,7 +10,7 @@
<div class="page archive"> <div class="page archive">
{{- /* Title */ -}} {{- /* Title */ -}}
<h2 class="single-title animated pulse faster"> <h2 class="single-title animated pulse faster">
{{- .Params.Title | default (T $taxonomies) | default $taxonomies | string | printf (T "allSome" | string) -}} {{- .Params.Title | default (T $taxonomies) | default $taxonomies | dict "Some" | T "allSome" -}}
</h2> </h2>
{{- /* Categories Page */ -}} {{- /* Categories Page */ -}}
@@ -19,7 +19,7 @@
{{- range $terms -}} {{- range $terms -}}
{{- $term := .Term -}} {{- $term := .Term -}}
{{- $pages := .Pages -}} {{- $pages := .Pages -}}
{{- with $.Site.GetPage "taxonomy" (printf "%s/%s" $type $term) -}} {{- with $.Site.GetPage "taxonomy" (printf "%v/%v" $type $term) -}}
<div class="card-item"> <div class="card-item">
<div class="card-item-wrapper"> <div class="card-item-wrapper">
<h3 class="card-item-title"> <h3 class="card-item-title">

View File

@@ -31,7 +31,7 @@
}, },
"husky": { "husky": {
"hooks": { "hooks": {
"pre-commit": "npm run build && npm run copy && git add ." "pre-commit": "npm run build && npm run copy && git add resources assets/js"
} }
}, },
"repository": { "repository": {

File diff suppressed because one or more lines are too long