From 7114391230df7a6dbca73b4994ede889a6dd39e8 Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Sun, 8 Oct 2023 20:15:46 +0200 Subject: [PATCH] sync theme --- themes/PaperMod/assets/css/core/reset.css | 2 + themes/PaperMod/assets/js/fastsearch.js | 7 ++- themes/PaperMod/i18n/th.yaml | 33 ++++++++++++ .../PaperMod/layouts/partials/post_meta.html | 2 + .../layouts/partials/share_icons.html | 12 ++++- .../layouts/partials/social_icons.html | 2 +- themes/PaperMod/layouts/partials/svg.html | 53 ++++++++++++++++++- .../partials/templates/schema_json.html | 2 +- 8 files changed, 107 insertions(+), 6 deletions(-) create mode 100644 themes/PaperMod/i18n/th.yaml diff --git a/themes/PaperMod/assets/css/core/reset.css b/themes/PaperMod/assets/css/core/reset.css index f509cf6..7393d57 100644 --- a/themes/PaperMod/assets/css/core/reset.css +++ b/themes/PaperMod/assets/css/core/reset.css @@ -7,6 +7,8 @@ html { -webkit-tap-highlight-color: transparent; overflow-y: scroll; + -webkit-text-size-adjust: 100%; + text-size-adjust: 100%; } a, diff --git a/themes/PaperMod/assets/js/fastsearch.js b/themes/PaperMod/assets/js/fastsearch.js index 06ebcfb..9484e75 100644 --- a/themes/PaperMod/assets/js/fastsearch.js +++ b/themes/PaperMod/assets/js/fastsearch.js @@ -77,7 +77,12 @@ sInput.onkeyup = function (e) { // run a search query (for "term") every time a letter is typed // in the search box if (fuse) { - const results = fuse.search(this.value.trim()); // the actual query being run using fuse.js + let results; + if (params.fuseOpts) { + results = fuse.search(this.value.trim(), {limit: params.fuseOpts.limit}); // the actual query being run using fuse.js along with options + } else { + results = fuse.search(this.value.trim()); // the actual query being run using fuse.js + } if (results.length !== 0) { // build our html if result exists let resultSet = ''; // our results bucket diff --git a/themes/PaperMod/i18n/th.yaml b/themes/PaperMod/i18n/th.yaml new file mode 100644 index 0000000..d8036ae --- /dev/null +++ b/themes/PaperMod/i18n/th.yaml @@ -0,0 +1,33 @@ +- id: prev_page + translation: "ก่อนหน้า" + +- id: next_page + translation: "ถัดไป" + +- id: read_time + translation: + one : "1 นาที" + other: "{{ .Count }} นาที" + +- id: words + translation: + one : "คำ" + other: "{{ .Count }} คำ" + +- id: toc + translation: "สารบัญ" + +- id: translations + translation: "การแปล" + +- id: home + translation: "หน้าหลัก" + +- id: edit_post + translation: "แก้ไข" + +- id: code_copy + translation: "คัดลอก" + +- id: code_copied + translation: "คัดลอกแล้ว!" diff --git a/themes/PaperMod/layouts/partials/post_meta.html b/themes/PaperMod/layouts/partials/post_meta.html index 15b8b1b..8bc0e50 100644 --- a/themes/PaperMod/layouts/partials/post_meta.html +++ b/themes/PaperMod/layouts/partials/post_meta.html @@ -12,9 +12,11 @@ {{- $scratch.Add "meta" (slice (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }} {{- end }} +{{- if not (.Param "hideAuthor") -}} {{- with (partial "author.html" .) }} {{- $scratch.Add "meta" (slice .) }} {{- end }} +{{- end }} {{- with ($scratch.Get "meta") }} {{- delimit . " · " -}} diff --git a/themes/PaperMod/layouts/partials/share_icons.html b/themes/PaperMod/layouts/partials/share_icons.html index 59ed050..4281c94 100644 --- a/themes/PaperMod/layouts/partials/share_icons.html +++ b/themes/PaperMod/layouts/partials/share_icons.html @@ -68,4 +68,14 @@ {{- end }} - \ No newline at end of file + {{- if (cond ($custom) (in $ShareButtons "ycombinator") (true)) }} + + + + + + {{- end }} + diff --git a/themes/PaperMod/layouts/partials/social_icons.html b/themes/PaperMod/layouts/partials/social_icons.html index 3f8d6a3..876b77c 100644 --- a/themes/PaperMod/layouts/partials/social_icons.html +++ b/themes/PaperMod/layouts/partials/social_icons.html @@ -1,6 +1,6 @@
{{- range . }} - + {{ partial "svg.html" . }} {{- end }} diff --git a/themes/PaperMod/layouts/partials/svg.html b/themes/PaperMod/layouts/partials/svg.html index e224640..37441e6 100644 --- a/themes/PaperMod/layouts/partials/svg.html +++ b/themes/PaperMod/layouts/partials/svg.html @@ -195,6 +195,10 @@ stroke-linecap="round" stroke-linejoin="round"> +{{- else if (eq $icon_name "firefish") -}} + + + {{- else if (eq $icon_name "flickr") -}} +{{- else if (eq $icon_name "googleplaystore") -}} + + + {{- else if (eq $icon_name "googlepodcasts") -}} +{{- else if (eq $icon_name "leetcode") -}} + + + {{- else if (eq $icon_name "letterboxd") -}} @@ -479,6 +493,18 @@ +{{- else if (eq $icon_name "printables") -}} + + + +{{- else if (eq $icon_name "pixelfed") -}} + + + +{{- else if (eq $icon_name "pleroma") -}} + + + {{- else if (eq $icon_name "qq") -}} @@ -497,6 +523,12 @@ +{{- else if (eq $icon_name "rootme") -}} + + + + {{- else if (eq $icon_name "rss") -}} @@ -589,17 +621,28 @@ - {{- else if (eq $icon_name "telegram") -}} +{{- else if (eq $icon_name "thingiverse") -}} + + + +{{- else if (eq $icon_name "threads") -}} + + + {{- else if (eq $icon_name "threema") -}} +{{- else if (eq $icon_name "tidal") -}} + + + {{- else if (eq $icon_name "tiktok") -}} @@ -613,7 +656,7 @@ {{- else if (eq $icon_name "tumblr") -}} - + {{- else if (eq $icon_name "twitch") -}} +{{- else if (eq $icon_name "wechat") -}} + + + + {{- else if (eq $icon_name "xda") -}}