From 83869e0fc82356011bb155370d51a4ce3e6924c9 Mon Sep 17 00:00:00 2001 From: Dillon Date: Tue, 12 May 2020 20:51:07 +0800 Subject: [PATCH 01/13] feat(analytics): update Google analytics.js to gtag.js (#349) --- exampleSite/config.toml | 3 --- .../content/posts/theme-documentation-basics.en.md | 2 -- .../content/posts/theme-documentation-basics.fr.md | 2 -- .../content/posts/theme-documentation-basics.zh-cn.md | 2 -- layouts/_default/baseof.html | 2 +- layouts/partials/plugin/analytics.html | 10 ++++------ 6 files changed, 5 insertions(+), 16 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 0041afe..f590e6d 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -975,9 +975,6 @@ enableEmoji = true # whether to anonymize IP # 是否匿名化用户 IP anonymizeIP = true - # whether to use cookie - # 是否使用 cookie - cookie = false # Fathom Analytics [params.analytics.fathom] id = "" diff --git a/exampleSite/content/posts/theme-documentation-basics.en.md b/exampleSite/content/posts/theme-documentation-basics.en.md index 8aba838..9980639 100644 --- a/exampleSite/content/posts/theme-documentation-basics.en.md +++ b/exampleSite/content/posts/theme-documentation-basics.en.md @@ -596,8 +596,6 @@ Please open the code block below to view the complete sample configuration :(far id = "" # whether to anonymize IP anonymizeIP = true - # whether to use cookie - cookie = false # Fathom Analytics [params.analytics.fathom] id = "" diff --git a/exampleSite/content/posts/theme-documentation-basics.fr.md b/exampleSite/content/posts/theme-documentation-basics.fr.md index 3c6a4ac..a9a5d65 100644 --- a/exampleSite/content/posts/theme-documentation-basics.fr.md +++ b/exampleSite/content/posts/theme-documentation-basics.fr.md @@ -601,8 +601,6 @@ Please open the code block below to view the complete sample configuration :(far id = "" # whether to anonymize IP anonymizeIP = true - # whether to use cookie - cookie = false # Fathom Analytics [params.analytics.fathom] id = "" diff --git a/exampleSite/content/posts/theme-documentation-basics.zh-cn.md b/exampleSite/content/posts/theme-documentation-basics.zh-cn.md index b68bb02..f5b5db0 100644 --- a/exampleSite/content/posts/theme-documentation-basics.zh-cn.md +++ b/exampleSite/content/posts/theme-documentation-basics.zh-cn.md @@ -599,8 +599,6 @@ hugo id = "" # 是否匿名化用户 IP anonymizeIP = true - # 是否使用 cookie - cookie = false # Fathom Analytics [params.analytics.fathom] id = "" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index a196159..4bcabfd 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,3 +1,4 @@ +{{- .Scratch.Set "version" "0.2.7" -}} {{- $version := "0.2.X" -}} {{- /* LoveIt theme version detection */ -}} @@ -10,7 +11,6 @@ {{- end -}} {{- $params := .Params | merge .Site.Params.page -}} -{{- .Scratch.Set "version" "0.2.6" -}} {{- if eq hugo.Environment "production" -}} {{- .Scratch.Set "cdn" .Site.Params.cdn -}} diff --git a/layouts/partials/plugin/analytics.html b/layouts/partials/plugin/analytics.html index 7714da6..ec2eb9a 100644 --- a/layouts/partials/plugin/analytics.html +++ b/layouts/partials/plugin/analytics.html @@ -2,18 +2,16 @@ {{- /* Google Analytics */ -}} {{- with .google.id -}} - {{- dict "source" "https://www.google-analytics.com/analytics.js" "async" true | partial "plugin/script.html" -}} + {{- printf "https://www.googletagmanager.com/gtag/js?id=%s" . | dict "async" true "source" | partial "plugin/script.html" -}} {{- end -}} {{- /* Fathom Analytics */ -}} {{- with .fathom.id -}} From fcba1590b666e50771e3440c5c702f868ce90196 Mon Sep 17 00:00:00 2001 From: Victor Pogor Date: Tue, 12 May 2020 15:53:58 +0300 Subject: [PATCH 02/13] feat(i18n): added romanian and russian languages (#335) * feat(i18n): added romanian and russian languages * fix(i18n): typo * fix(i18n): typo --- i18n/ro.toml | 190 +++++++++++++++++++++++++++++++++++++++++++++++++++ i18n/ru.toml | 190 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 380 insertions(+) create mode 100644 i18n/ro.toml create mode 100644 i18n/ru.toml diff --git a/i18n/ro.toml b/i18n/ro.toml new file mode 100644 index 0000000..c5e5065 --- /dev/null +++ b/i18n/ro.toml @@ -0,0 +1,190 @@ +# Translations for Romanian +# https://gohugo.io/content-management/multilingual/#translation-of-strings + +# === baseof == +[backToTop] +other = "Înapoi Sus" + +[viewComments] +other = "Vizualizare Comentarii" +# === baseof == + +# === Post === +[posts] +other = "Articole" +# === Post === + +# === Taxonomy === +[allSome] +other = "Toate %s" + +[tag] +other = "Etichetă" + +[tags] +other = "Etichete" + +[category] +other = "Categorie" + +[categories] +other = "Categorii" +# === Taxonomy === + +# === Pagination === +[more] +other = "Mai mult" +# === Pagination === + +# === partials/header.html === +[selectLanguage] +other = "Selectare Limbă" + +[switchTheme] +other = "Schimbare Temă" +# === partials/header.html === + +# === partials/footer.html === +[poweredBySome] +other = "Realizat de către %s" + +[theme] +other = "Temă" +# === partials/footer.html === + +# === partials/comment.html === +[valineLang] +other = "ro" + +[valinePlaceholder] +other = "Comentariul dvs ..." + +[facebookLanguageCode] +other = "ro_RO" +# === partials/comment.html === + +# === partials/assets.html === +[search] +other = "Căutare" + +[searchPlaceholder] +other = "Căutarea titlului sau conținutului articolului ..." + +[clear] +other = "Golire" + +[cancel] +other = "Anulare" + +[noResultsFound] +other = "Nici un rezultat gasit" + +[lunrLanguageCode] +other = "ro" + +[copyToClipboard] +other = "Copiați în clipboard" +# === partials/assets.html === + +# === partials/plugin/share.html === +[shareOn] +other = "Distribuie pe" +# === partials/plugin/share.html === + +# === posts/single.html === +[contents] +other = "Cuprins" + +[publish] +other = "publicat la" + +[included] +other = "inclus în" + +[wordCount] +other = "aproximativ {{ .Count }} cuvinte" + +[readingTime] +other = "{{ .Count }} min" + +[views] +other = "vizualizări" + +[author] +other = "Autor" + +[lastMod] +other = "Articolul a fost actualizat la %s" + +[license] +other = "Publicat sub licența %s" + +[seeMarkdown] +other = "Citire Markdown" + +[back] +other = "Înapoi" + +[home] +other = "Acasă" + +[readMore] +other = "Citește mai mult" +# === posts/single.html === + +# === 404.html === +[pageNotFound] +other = "Pagina nu a fost găsită" + +[pageNotFoundText] +other = "Pagina pe care o căutați nu există. Ne cerem scuze." +# === 404.html === + +# === shortcodes/admonition.html === +[note] +other = "Notă" + +[abstract] +other = "Rezumat" + +[info] +other = "Info" + +[tip] +other = "Sfat" + +[success] +other = "Succes" + +[question] +other = "Întrebare" + +[warning] +other = "Avertizare" + +[failure] +other = "Eșec" + +[danger] +other = "Pericol" + +[bug] +other = "Bug" + +[example] +other = "Exemplu" + +[quote] +other = "Citat" +# === shortcodes/admonition.html === + +# === shortcodes/version.html === +[new] +other = "NOU" + +[changed] +other = "SCHIMBAT" + +[deleted] +other = "ȘTERS" +# === shortcodes/version.html === diff --git a/i18n/ru.toml b/i18n/ru.toml new file mode 100644 index 0000000..b30b482 --- /dev/null +++ b/i18n/ru.toml @@ -0,0 +1,190 @@ +# Translations for Russian +# https://gohugo.io/content-management/multilingual/#translation-of-strings + +# === baseof == +[backToTop] +other = "Наверх" + +[viewComments] +other = "Посмотреть комментарии" +# === baseof == + +# === Post === +[posts] +other = "Статьи" +# === Post === + +# === Taxonomy === +[allSome] +other = "Все %s" + +[tag] +other = "Тэг" + +[tags] +other = "Тэги" + +[category] +other = "Категория" + +[categories] +other = "Категории" +# === Taxonomy === + +# === Pagination === +[more] +other = "Больше" +# === Pagination === + +# === partials/header.html === +[selectLanguage] +other = "Выбор Языка" + +[switchTheme] +other = "Сменить Тему" +# === partials/header.html === + +# === partials/footer.html === +[poweredBySome] +other = "Сделано %s" + +[theme] +other = "Тема" +# === partials/footer.html === + +# === partials/comment.html === +[valineLang] +other = "ru" + +[valinePlaceholder] +other = "Ваш комментарий ..." + +[facebookLanguageCode] +other = "ru_RU" +# === partials/comment.html === + +# === partials/assets.html === +[search] +other = "Поиск" + +[searchPlaceholder] +other = "Поиск заголовков или содержимого ..." + +[clear] +other = "Очистить" + +[cancel] +other = "Отменить" + +[noResultsFound] +other = "Результатов не найдено" + +[lunrLanguageCode] +other = "ru" + +[copyToClipboard] +other = "Копировать в буфер обмена" +# === partials/assets.html === + +# === partials/plugin/share.html === +[shareOn] +other = "Поделиться в" +# === partials/plugin/share.html === + +# === posts/single.html === +[contents] +other = "Содержание" + +[publish] +other = "Опубликовано" + +[included] +other = "включен в" + +[wordCount] +other = "около {{ .Count }} слов" + +[readingTime] +other = "{{ .Count }} мин" + +[views] +other = "просмотров" + +[author] +other = "Автор" + +[lastMod] +other = "Статья была обновлена %s" + +[license] +other = "Опубликовано под лицензии %s" + +[seeMarkdown] +other = "Читать Markdown" + +[back] +other = "Назад" + +[home] +other = "Домой" + +[readMore] +other = "Читать больше" +# === posts/single.html === + +# === 404.html === +[pageNotFound] +other = "Страница не найдена" + +[pageNotFoundText] +other = "Страница, которую вы ищете, не существует. Приносим извинения." +# === 404.html === + +# === shortcodes/admonition.html === +[note] +other = "Замечание" + +[abstract] +other = "Краткое описание" + +[info] +other = "Инфо" + +[tip] +other = "Совет" + +[success] +other = "Удачто" + +[question] +other = "Вопрос" + +[warning] +other = "Предупреждение" + +[failure] +other = "Отказ" + +[danger] +other = "Опасность" + +[bug] +other = "Ошибка" + +[example] +other = "Пример" + +[quote] +other = "Цитата" +# === shortcodes/admonition.html === + +# === shortcodes/version.html === +[new] +other = "НОВЫЙ" + +[changed] +other = "ИЗМЕНЕН" + +[deleted] +other = "УДАЛЕН" +# === shortcodes/version.html === From 13b051b5859157f61dd60f694f12fbe48ddbefb9 Mon Sep 17 00:00:00 2001 From: Dillon Date: Tue, 12 May 2020 21:11:20 +0800 Subject: [PATCH 03/13] chore(docs): update docs for i18n --- README.md | 2 ++ README.zh-cn.md | 2 ++ exampleSite/content/{about.en.md => about/index.en.md} | 0 exampleSite/content/{about.fr.md => about/index.fr.md} | 0 .../content/{about.zh-cn.md => about/index.zh-cn.md} | 0 .../index.en.md} | 0 .../index.fr.md} | 0 .../index.zh-cn.md} | 0 .../{emoji-support.en.md => emoji-support/index.en.md} | 0 .../{emoji-support.fr.md => emoji-support/index.fr.md} | 0 .../index.zh-cn.md} | 0 .../index.en.md} | 4 +++- .../index.fr.md} | 4 +++- .../index.zh-cn.md} | 4 +++- .../index.en.md} | 0 .../index.fr.md} | 0 .../index.zh-cn.md} | 0 .../index.en.md} | 0 .../index.fr.md} | 0 .../index.zh-cn.md} | 0 .../index.en.md} | 0 .../index.fr.md} | 0 .../index.zh-cn.md} | 0 i18n/ro.toml | 6 +++++- i18n/ru.toml | 6 +++++- 25 files changed, 23 insertions(+), 5 deletions(-) rename exampleSite/content/{about.en.md => about/index.en.md} (100%) rename exampleSite/content/{about.fr.md => about/index.fr.md} (100%) rename exampleSite/content/{about.zh-cn.md => about/index.zh-cn.md} (100%) rename exampleSite/content/posts/{basic-markdown-syntax.en.md => basic-markdown-syntax/index.en.md} (100%) rename exampleSite/content/posts/{basic-markdown-syntax.fr.md => basic-markdown-syntax/index.fr.md} (100%) rename exampleSite/content/posts/{basic-markdown-syntax.zh-cn.md => basic-markdown-syntax/index.zh-cn.md} (100%) rename exampleSite/content/posts/{emoji-support.en.md => emoji-support/index.en.md} (100%) rename exampleSite/content/posts/{emoji-support.fr.md => emoji-support/index.fr.md} (100%) rename exampleSite/content/posts/{emoji-support.zh-cn.md => emoji-support/index.zh-cn.md} (100%) rename exampleSite/content/posts/{theme-documentation-basics.en.md => theme-documentation-basics/index.en.md} (99%) rename exampleSite/content/posts/{theme-documentation-basics.fr.md => theme-documentation-basics/index.fr.md} (99%) rename exampleSite/content/posts/{theme-documentation-basics.zh-cn.md => theme-documentation-basics/index.zh-cn.md} (99%) rename exampleSite/content/posts/{theme-documentation-built-in-shortcodes.en.md => theme-documentation-built-in-shortcodes/index.en.md} (100%) rename exampleSite/content/posts/{theme-documentation-built-in-shortcodes.fr.md => theme-documentation-built-in-shortcodes/index.fr.md} (100%) rename exampleSite/content/posts/{theme-documentation-built-in-shortcodes.zh-cn.md => theme-documentation-built-in-shortcodes/index.zh-cn.md} (100%) rename exampleSite/content/posts/{theme-documentation-content.en.md => theme-documentation-content/index.en.md} (100%) rename exampleSite/content/posts/{theme-documentation-content.fr.md => theme-documentation-content/index.fr.md} (100%) rename exampleSite/content/posts/{theme-documentation-content.zh-cn.md => theme-documentation-content/index.zh-cn.md} (100%) rename exampleSite/content/posts/{theme-documentation-extended-shortcodes.en.md => theme-documentation-extended-shortcodes/index.en.md} (100%) rename exampleSite/content/posts/{theme-documentation-extended-shortcodes.fr.md => theme-documentation-extended-shortcodes/index.fr.md} (100%) rename exampleSite/content/posts/{theme-documentation-extended-shortcodes.zh-cn.md => theme-documentation-extended-shortcodes/index.zh-cn.md} (100%) diff --git a/README.md b/README.md index dadb575..b958d87 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,8 @@ LoveIt supports the following languages: * Spanish * German * Serbian +* Russian +* Romanian * [Contribute with a new language](https://github.com/dillonzq/LoveIt/pulls) [Languages Compatibility](https://hugoloveit.com/theme-documentation-basics/#language-compatibility) diff --git a/README.zh-cn.md b/README.zh-cn.md index d68d0b7..c078e89 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -130,6 +130,8 @@ LoveIt 支持下列语言: * 西班牙语 * 德语 * 塞尔维亚语 +* 俄语 +* 罗马尼亚语 * [贡献一种新的语言](https://github.com/dillonzq/LoveIt/pulls) [语言兼容性](https://hugoloveit.com/zh-cn/theme-documentation-basics/#language-compatibility) diff --git a/exampleSite/content/about.en.md b/exampleSite/content/about/index.en.md similarity index 100% rename from exampleSite/content/about.en.md rename to exampleSite/content/about/index.en.md diff --git a/exampleSite/content/about.fr.md b/exampleSite/content/about/index.fr.md similarity index 100% rename from exampleSite/content/about.fr.md rename to exampleSite/content/about/index.fr.md diff --git a/exampleSite/content/about.zh-cn.md b/exampleSite/content/about/index.zh-cn.md similarity index 100% rename from exampleSite/content/about.zh-cn.md rename to exampleSite/content/about/index.zh-cn.md diff --git a/exampleSite/content/posts/basic-markdown-syntax.en.md b/exampleSite/content/posts/basic-markdown-syntax/index.en.md similarity index 100% rename from exampleSite/content/posts/basic-markdown-syntax.en.md rename to exampleSite/content/posts/basic-markdown-syntax/index.en.md diff --git a/exampleSite/content/posts/basic-markdown-syntax.fr.md b/exampleSite/content/posts/basic-markdown-syntax/index.fr.md similarity index 100% rename from exampleSite/content/posts/basic-markdown-syntax.fr.md rename to exampleSite/content/posts/basic-markdown-syntax/index.fr.md diff --git a/exampleSite/content/posts/basic-markdown-syntax.zh-cn.md b/exampleSite/content/posts/basic-markdown-syntax/index.zh-cn.md similarity index 100% rename from exampleSite/content/posts/basic-markdown-syntax.zh-cn.md rename to exampleSite/content/posts/basic-markdown-syntax/index.zh-cn.md diff --git a/exampleSite/content/posts/emoji-support.en.md b/exampleSite/content/posts/emoji-support/index.en.md similarity index 100% rename from exampleSite/content/posts/emoji-support.en.md rename to exampleSite/content/posts/emoji-support/index.en.md diff --git a/exampleSite/content/posts/emoji-support.fr.md b/exampleSite/content/posts/emoji-support/index.fr.md similarity index 100% rename from exampleSite/content/posts/emoji-support.fr.md rename to exampleSite/content/posts/emoji-support/index.fr.md diff --git a/exampleSite/content/posts/emoji-support.zh-cn.md b/exampleSite/content/posts/emoji-support/index.zh-cn.md similarity index 100% rename from exampleSite/content/posts/emoji-support.zh-cn.md rename to exampleSite/content/posts/emoji-support/index.zh-cn.md diff --git a/exampleSite/content/posts/theme-documentation-basics.en.md b/exampleSite/content/posts/theme-documentation-basics/index.en.md similarity index 99% rename from exampleSite/content/posts/theme-documentation-basics.en.md rename to exampleSite/content/posts/theme-documentation-basics/index.en.md index 9980639..092eb61 100644 --- a/exampleSite/content/posts/theme-documentation-basics.en.md +++ b/exampleSite/content/posts/theme-documentation-basics/index.en.md @@ -843,7 +843,7 @@ In `config/css/_custom.scss`, you can add some css style code to customize the s ### 4.1 Compatibility {#language-compatibility} -{{< version 0.2.6 changed >}} +{{< version 0.2.7 changed >}} | Language | Hugo Code | HTML `lang` Attribute | Theme Docs | Lunr.js Support | |:-------------------- |:---------:|:---------------------:|:-----------------------------:|:-----------------------------:| @@ -857,6 +857,8 @@ In `config/css/_custom.scss`, you can add some css style code to customize the s | German | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | German | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | Serbian | `sr` | `sr` | :(far fa-square fa-fw): | :(far fa-square fa-fw): | +| Russian | `ru` | `ru` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | +| Romanian | `ro` | `ro` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | ### 4.2 Basic Configuration diff --git a/exampleSite/content/posts/theme-documentation-basics.fr.md b/exampleSite/content/posts/theme-documentation-basics/index.fr.md similarity index 99% rename from exampleSite/content/posts/theme-documentation-basics.fr.md rename to exampleSite/content/posts/theme-documentation-basics/index.fr.md index a9a5d65..6951bec 100644 --- a/exampleSite/content/posts/theme-documentation-basics.fr.md +++ b/exampleSite/content/posts/theme-documentation-basics/index.fr.md @@ -848,7 +848,7 @@ In `config/css/_custom.scss`, you can add some css style code to customize the s ### 4.1 Compatibility {#language-compatibility} -{{< version 0.2.6 changed >}} +{{< version 0.2.7 changed >}} | Language | Hugo Code | HTML `lang` Attribute | Theme Docs | Lunr.js Support | |:-------------------- |:---------:|:---------------------:|:-----------------------------:|:-----------------------------:| @@ -861,6 +861,8 @@ In `config/css/_custom.scss`, you can add some css style code to customize the s | Spanish | `es` | `es` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | German | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | Serbian | `sr` | `sr` | :(far fa-square fa-fw): | :(far fa-square fa-fw): | +| Russian | `ru` | `ru` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | +| Romanian | `ro` | `ro` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | ### 4.2 Basic Configuration diff --git a/exampleSite/content/posts/theme-documentation-basics.zh-cn.md b/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md similarity index 99% rename from exampleSite/content/posts/theme-documentation-basics.zh-cn.md rename to exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md index f5b5db0..0ea875c 100644 --- a/exampleSite/content/posts/theme-documentation-basics.zh-cn.md +++ b/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md @@ -847,7 +847,7 @@ $code-font-family: Fira Mono, Source Code Pro, Menlo, Consolas, Monaco, monospac ### 4.1 兼容性 {#language-compatibility} -{{< version 0.2.6 changed >}} +{{< version 0.2.7 changed >}} | 语言 | Hugo 代码 | HTML `lang` 属性 | 主题文档 | Lunr.js 支持 | |:---- |:----:|:----:|:----:|:----:| @@ -860,6 +860,8 @@ $code-font-family: Fira Mono, Source Code Pro, Menlo, Consolas, Monaco, monospac | 西班牙语 | `es` | `es` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | 德语 | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | 塞尔维亚语 | `pl` | `pl` | :(far fa-square fa-fw): | :(far fa-square fa-fw): | +| 俄语 | `ru` | `ru` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | +| 罗马尼亚语 | `ro` | `ro` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | ### 4.2 基本配置 diff --git a/exampleSite/content/posts/theme-documentation-built-in-shortcodes.en.md b/exampleSite/content/posts/theme-documentation-built-in-shortcodes/index.en.md similarity index 100% rename from exampleSite/content/posts/theme-documentation-built-in-shortcodes.en.md rename to exampleSite/content/posts/theme-documentation-built-in-shortcodes/index.en.md diff --git a/exampleSite/content/posts/theme-documentation-built-in-shortcodes.fr.md b/exampleSite/content/posts/theme-documentation-built-in-shortcodes/index.fr.md similarity index 100% rename from exampleSite/content/posts/theme-documentation-built-in-shortcodes.fr.md rename to exampleSite/content/posts/theme-documentation-built-in-shortcodes/index.fr.md diff --git a/exampleSite/content/posts/theme-documentation-built-in-shortcodes.zh-cn.md b/exampleSite/content/posts/theme-documentation-built-in-shortcodes/index.zh-cn.md similarity index 100% rename from exampleSite/content/posts/theme-documentation-built-in-shortcodes.zh-cn.md rename to exampleSite/content/posts/theme-documentation-built-in-shortcodes/index.zh-cn.md diff --git a/exampleSite/content/posts/theme-documentation-content.en.md b/exampleSite/content/posts/theme-documentation-content/index.en.md similarity index 100% rename from exampleSite/content/posts/theme-documentation-content.en.md rename to exampleSite/content/posts/theme-documentation-content/index.en.md diff --git a/exampleSite/content/posts/theme-documentation-content.fr.md b/exampleSite/content/posts/theme-documentation-content/index.fr.md similarity index 100% rename from exampleSite/content/posts/theme-documentation-content.fr.md rename to exampleSite/content/posts/theme-documentation-content/index.fr.md diff --git a/exampleSite/content/posts/theme-documentation-content.zh-cn.md b/exampleSite/content/posts/theme-documentation-content/index.zh-cn.md similarity index 100% rename from exampleSite/content/posts/theme-documentation-content.zh-cn.md rename to exampleSite/content/posts/theme-documentation-content/index.zh-cn.md diff --git a/exampleSite/content/posts/theme-documentation-extended-shortcodes.en.md b/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.en.md similarity index 100% rename from exampleSite/content/posts/theme-documentation-extended-shortcodes.en.md rename to exampleSite/content/posts/theme-documentation-extended-shortcodes/index.en.md diff --git a/exampleSite/content/posts/theme-documentation-extended-shortcodes.fr.md b/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.fr.md similarity index 100% rename from exampleSite/content/posts/theme-documentation-extended-shortcodes.fr.md rename to exampleSite/content/posts/theme-documentation-extended-shortcodes/index.fr.md diff --git a/exampleSite/content/posts/theme-documentation-extended-shortcodes.zh-cn.md b/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.zh-cn.md similarity index 100% rename from exampleSite/content/posts/theme-documentation-extended-shortcodes.zh-cn.md rename to exampleSite/content/posts/theme-documentation-extended-shortcodes/index.zh-cn.md diff --git a/i18n/ro.toml b/i18n/ro.toml index c5e5065..c9f3d2b 100644 --- a/i18n/ro.toml +++ b/i18n/ro.toml @@ -1,4 +1,5 @@ # Translations for Romanian +# Traduceri pentru limba română # https://gohugo.io/content-management/multilingual/#translation-of-strings # === baseof == @@ -54,7 +55,7 @@ other = "Temă" # === partials/comment.html === [valineLang] -other = "ro" +other = "en" [valinePlaceholder] other = "Comentariul dvs ..." @@ -82,6 +83,9 @@ other = "Nici un rezultat gasit" [lunrLanguageCode] other = "ro" +[lunrLanguageLib] +other = "lib/lunr/lunr.ro.js" + [copyToClipboard] other = "Copiați în clipboard" # === partials/assets.html === diff --git a/i18n/ru.toml b/i18n/ru.toml index b30b482..bfb7dc3 100644 --- a/i18n/ru.toml +++ b/i18n/ru.toml @@ -1,4 +1,5 @@ # Translations for Russian +# Переводы на русский # https://gohugo.io/content-management/multilingual/#translation-of-strings # === baseof == @@ -54,7 +55,7 @@ other = "Тема" # === partials/comment.html === [valineLang] -other = "ru" +other = "en" [valinePlaceholder] other = "Ваш комментарий ..." @@ -82,6 +83,9 @@ other = "Результатов не найдено" [lunrLanguageCode] other = "ru" +[lunrLanguageLib] +other = "lib/lunr/lunr.ru.js" + [copyToClipboard] other = "Копировать в буфер обмена" # === partials/assets.html === From 7d0603ece0d0e16c24063e9b30fc753ff8ac389d Mon Sep 17 00:00:00 2001 From: Dillon Date: Tue, 12 May 2020 21:51:38 +0800 Subject: [PATCH 04/13] fix(paginate): paginate error for empty content (#350) --- layouts/_default/section.html | 38 ++++++++++++++++++----------------- layouts/index.html | 2 +- layouts/taxonomy/list.html | 38 ++++++++++++++++++----------------- 3 files changed, 41 insertions(+), 37 deletions(-) diff --git a/layouts/_default/section.html b/layouts/_default/section.html index e81c187..9d07c92 100644 --- a/layouts/_default/section.html +++ b/layouts/_default/section.html @@ -10,25 +10,27 @@ {{- /* Paginate */ -}} - {{- $pages := .Pages.GroupByDate "2006" -}} - {{- with .Site.Params.section.paginate | default .Site.Params.paginate -}} - {{- $pages = $.Paginate $pages . -}} - {{- else -}} - {{- $pages = .Paginate $pages -}} - {{- end -}} - {{- range $pages.PageGroups -}} -

{{ .Key }}

- {{- range .Pages -}} -
- - {{- .Title -}} - - - {{- .Date.Format ($.Site.Params.section.dateFormat | default "01-02") -}} - -
+ {{- if .Pages -}} + {{- $pages := .Pages.GroupByDate "2006" -}} + {{- with .Site.Params.section.paginate | default .Site.Params.paginate -}} + {{- $pages = $.Paginate $pages . -}} + {{- else -}} + {{- $pages = .Paginate $pages -}} {{- end -}} + {{- range $pages.PageGroups -}} +

{{ .Key }}

+ {{- range .Pages -}} +
+ + {{- .Title -}} + + + {{- .Date.Format ($.Site.Params.section.dateFormat | default "01-02") -}} + +
+ {{- end -}} + {{- end -}} + {{- partial "paginator.html" . -}} {{- end -}} - {{- partial "paginator.html" . -}} {{- end -}} diff --git a/layouts/index.html b/layouts/index.html index 82da87b..7800611 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -16,7 +16,7 @@ {{- end -}} {{- /* Posts */ -}} - {{- if ne .Site.Params.home.posts.enable false -}} + {{- if ne .Site.Params.home.posts.enable false | and .Site.RegularPages -}} {{- /* Paginate */ -}} {{- $pages := where .Site.RegularPages "Type" "posts" -}} {{- if .Site.Params.page.hiddenFromHomePage -}} diff --git a/layouts/taxonomy/list.html b/layouts/taxonomy/list.html index 8e6d553..249d066 100644 --- a/layouts/taxonomy/list.html +++ b/layouts/taxonomy/list.html @@ -17,25 +17,27 @@ {{- /* Paginate */ -}} - {{- $pages := .Pages.GroupByDate "2006" -}} - {{- with .Site.Params.list.paginate | default .Site.Params.paginate -}} - {{- $pages = $.Paginate $pages . -}} - {{- else -}} - {{- $pages = .Paginate $pages -}} - {{- end -}} - {{- range $pages.PageGroups -}} -

{{ .Key }}

- {{- range .Pages -}} -
- - {{- .Title -}} - - - {{- .Date.Format ($.Site.Params.list.dateFormat | default "01-02") -}} - -
+ {{- if .Pages -}} + {{- $pages := .Pages.GroupByDate "2006" -}} + {{- with .Site.Params.list.paginate | default .Site.Params.paginate -}} + {{- $pages = $.Paginate $pages . -}} + {{- else -}} + {{- $pages = .Paginate $pages -}} {{- end -}} + {{- range $pages.PageGroups -}} +

{{ .Key }}

+ {{- range .Pages -}} +
+ + {{- .Title -}} + + + {{- .Date.Format ($.Site.Params.list.dateFormat | default "01-02") -}} + +
+ {{- end -}} + {{- end -}} + {{- partial "paginator.html" . -}} {{- end -}} - {{- partial "paginator.html" . -}} {{- end -}} From 7c4962e39af0de5a47f0dbd0cb1f8d31b0486e99 Mon Sep 17 00:00:00 2001 From: Dillon Date: Tue, 12 May 2020 22:40:49 +0800 Subject: [PATCH 05/13] fix(compatibility): compatibility for version 0.1.X (#351) --- layouts/_default/baseof.html | 6 ++++++ layouts/partials/assets.html | 9 +++++++-- layouts/partials/comment.html | 30 ++++++++++++++++-------------- layouts/posts/single.html | 13 ++++++++++--- 4 files changed, 39 insertions(+), 19 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 4bcabfd..cf923ba 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -17,11 +17,17 @@ {{- .Scratch.Set "fingerprint" .Site.Params.fingerprint -}} {{- .Scratch.Set "analytics" .Site.Params.analytics -}} {{- .Scratch.Set "comment" $params.comment -}} + {{- if eq .Params.comment true -}} + {{- .Scratch.Set "comment" .Site.Params.comment -}} + {{- else if eq .Params.comment false -}} + {{- .Scratch.Set "comment" dict -}} + {{- end -}} {{- else if eq .Site .Sites.First -}} {{- warnf "\n\nCurrent environment is \"development\". The \"comment system\", \"CDN\" and \"fingerprint\" will be disabled.\n当前运行环境是 \"development\". \"评论系统\", \"CDN\" 和 \"fingerprint\" 不会启用.\n" -}} {{- end -}} {{- .Scratch.Set "params" $params -}} + {{- $this := dict "desktop" .Site.Params.header.desktopMode "mobile" .Site.Params.header.mobileMode | dict "headerMode" | dict "config" -}} {{- .Scratch.Set "this" $this -}} diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index edb52c8..236c851 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -89,8 +89,13 @@ {{- end -}} {{- /* KaTeX */ -}} -{{- if $params.math.enable -}} - {{- $math := $params.math -}} +{{- $math := $params.math -}} +{{- if eq $math true -}} + {{- $math = .Site.Params.page.math | default dict -}} +{{- else if eq $math false -}} + {{- $math = dict "enable" false -}} +{{- end -}} +{{- if $math.enable -}} {{- $source := $cdn.katexCSS | default "lib/katex/katex.min.css" -}} {{- dict "source" $source "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}} {{- $source := $cdn.katexJS | default "lib/katex/katex.min.js" -}} diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html index 71ea677..1f18b30 100644 --- a/layouts/partials/comment.html +++ b/layouts/partials/comment.html @@ -1,14 +1,15 @@ {{- $cdn := .Scratch.Get "cdn" | default dict -}} {{- $fingerprint := .Scratch.Get "fingerprint" -}} -{{- $comment := .Scratch.Get "comment" | default (dict "disqus" dict "gitalk" dict "valine" dict "facebook" dict "telegram" dict "commento" dict "utterances" dict) -}} +{{- $comment := .Scratch.Get "comment" | default dict -}} {{- $commentConfig := dict -}} {{- if $comment.enable -}}
{{- /* Disqus Comment System */ -}} - {{- if $comment.disqus.enable -}} + {{- $disqus := $comment.disqus | default dict -}} + {{- if $disqus.enable -}}
- {{- $source := printf "https://%s.disqus.com/embed.js" $comment.disqus.shortname -}} + {{- $source := printf "https://%s.disqus.com/embed.js" $disqus.shortname -}} {{- dict "source" $source "defer" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}