diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 6d0d4c6..2da8f8f 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -7,6 +7,11 @@ on:
- exampleSite
workflow_dispatch:
# manual run
+ inputs:
+ hugoVersion:
+ description: "Hugo Version"
+ required: false
+ default: "0.83.0"
jobs:
build:
@@ -26,7 +31,7 @@ jobs:
- name: Setup hugo
uses: peaceiris/actions-hugo@v2
with:
- hugo-version: '0.83.0'
+ hugo-version: "${{ github.event.inputs.hugoVersion }}"
- name: Build
run: hugo --buildDrafts --gc --verbose --minify
diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml
index 1ec9e57..75033f8 100644
--- a/.github/workflows/gh-pages.yml
+++ b/.github/workflows/gh-pages.yml
@@ -3,14 +3,19 @@ name: Build GH-Pages
on:
push:
paths-ignore:
- - 'images/**'
- - 'LICENSE'
- - 'README.md'
+ - "images/**"
+ - "LICENSE"
+ - "README.md"
branches:
- master
- exampleSite
workflow_dispatch:
# manual run
+ inputs:
+ hugoVersion:
+ description: "Hugo Version"
+ required: false
+ default: "0.83.0"
jobs:
deploy:
@@ -30,7 +35,7 @@ jobs:
- name: Setup hugo
uses: peaceiris/actions-hugo@v2
with:
- hugo-version: '0.83.0'
+ hugo-version: "${{ github.event.inputs.hugoVersion }}"
- name: Build
run: hugo --buildDrafts --gc --verbose --minify
diff --git a/assets/css/common/post-single.css b/assets/css/common/post-single.css
index 177488a..211e4bd 100644
--- a/assets/css/common/post-single.css
+++ b/assets/css/common/post-single.css
@@ -153,8 +153,7 @@
border-radius: var(--radius);
}
-.post-content .highlight:not(table),
-.post-content pre {
+.post-content .highlight:not(table) {
margin: 10px auto;
background: var(--hljs-bg) !important;
border-radius: var(--radius);
@@ -207,8 +206,8 @@
margin: auto 0;
padding: 10px;
color: rgb(213, 213, 214);
- background: 0 0;
- border-radius: 0;
+ background: var(--hljs-bg) !important;
+ border-radius: var(--radius);
overflow-x: auto;
word-break: break-all;
}
diff --git a/i18n/sv.yaml b/i18n/sv.yaml
new file mode 100644
index 0000000..65ce422
--- /dev/null
+++ b/i18n/sv.yaml
@@ -0,0 +1,28 @@
+- id: prev_page
+ translation: "Förra Sidan"
+
+- id: next_page
+ translation: "Nästa Sida"
+
+- id: read_time
+ translation:
+ one: "1 min"
+ other: "{{ .Count }} min"
+
+- id: toc
+ translation: "Innehållsförteckning"
+
+- id: translations
+ translation: "Översättningar"
+
+- id: home
+ translation: "Hem"
+
+- id: edit_post
+ translation: "Redigera"
+
+- id: code_copy
+ translation: "kopiera"
+
+- id: code_copied
+ translation: "kopierad!"
diff --git a/i18n/zh-tw.yaml b/i18n/zh-tw.yaml
index c6b0e7f..7b9d9db 100644
--- a/i18n/zh-tw.yaml
+++ b/i18n/zh-tw.yaml
@@ -9,6 +9,11 @@
one : "1 分鐘"
other: "{{ .Count }} 分鐘"
+- id: words
+ translation:
+ one: "字"
+ other: "{{ .Count }} 字"
+
- id: toc
translation: "目錄"
diff --git a/i18n/zh.yaml b/i18n/zh.yaml
index 7f15ab0..0280425 100644
--- a/i18n/zh.yaml
+++ b/i18n/zh.yaml
@@ -9,6 +9,11 @@
one : "1 分钟"
other: "{{ .Count }} 分钟"
+- id: words
+ translation:
+ one: "字"
+ other: "{{ .Count }} 字"
+
- id: toc
translation: "目录"
diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html
index 435d2a1..e400e2c 100644
--- a/layouts/_default/archives.html
+++ b/layouts/_default/archives.html
@@ -11,7 +11,7 @@
{{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
-{{- if .Site.Params.ShowAllPagesInArchive }}
+{{- if site.Params.ShowAllPagesInArchive }}
{{- $pages = site.RegularPages }}
{{- end }}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 38d6319..6623f69 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -1,5 +1,5 @@
-
+
{{- partial "head.html" . }}
@@ -9,7 +9,7 @@
{{- if (or (ne .Kind `page` ) (eq .Layout `archives`) (eq .Layout `search`)) -}}
{{- print "list" -}}
{{- end -}}
-{{- if eq $.Site.Params.defaultTheme `dark` -}}
+{{- if eq site.Params.defaultTheme `dark` -}}
{{- print " dark" }}
{{- end -}}
" id="top">
diff --git a/layouts/_default/index.json b/layouts/_default/index.json
index 2c86f7c..feeb437 100644
--- a/layouts/_default/index.json
+++ b/layouts/_default/index.json
@@ -1,5 +1,5 @@
{{- $.Scratch.Add "index" slice -}}
-{{- range .Site.RegularPages -}}
+{{- range site.RegularPages -}}
{{- if and (not .Params.searchHidden) (ne .Layout `archives`) (ne .Layout `search`) }}
{{- $.Scratch.Add "index" (dict "title" .Title "content" .Plain "permalink" .Permalink "summary" .Summary) -}}
{{- end }}
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 0cc1ad9..f4ff6ec 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,6 +1,6 @@
{{- define "main" }}
-{{- if (and .Site.Params.profileMode.enabled .IsHome) }}
+{{- if (and site.Params.profileMode.enabled .IsHome) }}
{{- partial "index_profile.html" . }}
{{- else }} {{/* if not profileMode */}}
@@ -32,7 +32,7 @@
{{- $paginator := .Paginate $pages }}
-{{- if and .IsHome .Site.Params.homeInfoParams (eq $paginator.PageNumber 1) }}
+{{- if and .IsHome site.Params.homeInfoParams (eq $paginator.PageNumber 1) }}
{{- partial "home_info.html" . }}
{{- end }}
@@ -41,7 +41,7 @@
{{- $class := "post-entry" }}
-{{- $user_preferred := or .Site.Params.disableSpecial1stPost .Site.Params.homeInfoParams }}
+{{- $user_preferred := or site.Params.disableSpecial1stPost site.Params.homeInfoParams }}
{{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) (not $user_preferred)) }}
{{- $class = "first-entry" }}
{{- else if $term }}
@@ -49,7 +49,7 @@
{{- end }}
- {{- $isHidden := (.Site.Params.cover.hidden | default .Site.Params.cover.hiddenInList) }}
+ {{- $isHidden := (site.Params.cover.hidden | default site.Params.cover.hiddenInList) }}
{{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }}
- {{- $isHidden := .Params.cover.hidden | default .Site.Params.cover.hiddenInSingle | default .Site.Params.cover.hidden }}
+ {{- $isHidden := .Params.cover.hidden | default site.Params.cover.hiddenInSingle | default site.Params.cover.hidden }}
{{- partial "cover.html" (dict "cxt" . "IsHome" false "isHidden" $isHidden) }}
{{- if (.Param "ShowToc") }}
{{- partial "toc.html" . }}
@@ -46,7 +46,7 @@
{{- if (.Param "ShowPostNavLinks") }}
{{- partial "post_nav_links.html" . }}
{{- end }}
- {{- if (and .Site.Params.ShowShareButtons (ne .Params.disableShare true)) }}
+ {{- if (and site.Params.ShowShareButtons (ne .Params.disableShare true)) }}
{{- partial "share_icons.html" . -}}
{{- end }}
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html
index d5a9e66..6fd2654 100644
--- a/layouts/_default/terms.html
+++ b/layouts/_default/terms.html
@@ -16,7 +16,7 @@
{{- range $key, $value := .Data.Terms.Alphabetical }}
{{- $name := .Name }}
{{- $count := .Count }}
- {{- with $.Site.GetPage (printf "/%s/%s" $type $name) }}
+ {{- with site.GetPage (printf "/%s/%s" $type $name) }}
{{ .Name }} {{ $count }}
diff --git a/layouts/partials/author.html b/layouts/partials/author.html
index 4582b12..8f2758f 100644
--- a/layouts/partials/author.html
+++ b/layouts/partials/author.html
@@ -1,5 +1,5 @@
-{{- if or .Params.author .Site.Params.author }}
-{{- $author := (.Params.author | default .Site.Params.author) }}
+{{- if or .Params.author site.Params.author }}
+{{- $author := (.Params.author | default site.Params.author) }}
{{- $author_type := (printf "%T" $author) }}
{{- if (or (eq $author_type "[]string") (eq $author_type "[]interface {}")) }}
{{- (delimit $author ", " ) }}
diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html
index 742254a..7e8257b 100644
--- a/layouts/partials/breadcrumbs.html
+++ b/layouts/partials/breadcrumbs.html
@@ -1,6 +1,6 @@
{{- if (.Param "ShowBreadCrumbs") -}}
- {{- $url := replace .Parent.Permalink (printf "%s" .Site.BaseURL) "" }}
+ {{- $url := replace .Parent.Permalink (printf "%s" site.BaseURL) "" }}
{{- $lang_url := strings.TrimPrefix (printf "%s/" .Lang) $url -}}
{{ i18n "home" | default "Home" }}
@@ -8,7 +8,7 @@
{{- range $index, $element := split $lang_url "/" }}
{{- $scratch.Add "path" (printf "%s/" $element )}}
- {{- $bc_pg := $.Site.GetPage ($scratch.Get "path") -}}
+ {{- $bc_pg := site.GetPage ($scratch.Get "path") -}}
{{- if (and ($bc_pg) (gt (len . ) 0))}}
{{- print " » " | safeHTML -}}
{{ $bc_pg.Name }}
diff --git a/layouts/partials/cover.html b/layouts/partials/cover.html
index b4e7c78..5c5f2fb 100644
--- a/layouts/partials/cover.html
+++ b/layouts/partials/cover.html
@@ -2,8 +2,8 @@
{{- if (and .Params.cover.image (not $.isHidden)) }}
{{- $alt := (.Params.cover.alt | default .Params.cover.caption | plainify) }}
- {{- $responsiveImages := (.Params.cover.responsiveImages | default .Site.Params.cover.responsiveImages) | default true }}
- {{- $addLink := (and .Site.Params.cover.linkFullImages (not $.IsHome)) }}
+ {{- $responsiveImages := (.Params.cover.responsiveImages | default site.Params.cover.responsiveImages) | default true }}
+ {{- $addLink := (and site.Params.cover.linkFullImages (not $.IsHome)) }}
{{- $cover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }}
{{- if $cover -}}{{/* i.e it is present in page bundle */}}
{{- if $addLink }}
- {{- .Params.editPost.Text | default (.Site.Params.editPost.Text | default (i18n "edit_post" | default "Edit")) -}}
+{{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated }} | {{- end -}}
+
+ {{- .Params.editPost.Text | default (site.Params.editPost.Text | default (i18n "edit_post" | default "Edit")) -}}
{{- end }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 8dee328..d76058f 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -1,9 +1,9 @@
{{- if not (.Param "hideFooter") }}
{{- end }}
-{{- if (not .Site.Params.disableScrollToTop) }}
+{{- if (not site.Params.disableScrollToTop) }}