diff --git a/hugo.toml b/hugo.toml index 352da4e..4f58bfa 100644 --- a/hugo.toml +++ b/hugo.toml @@ -1,34 +1,34 @@ baseURL = "https://1bl4z3r.github.io/hermit-V2/" # baseURL - The absolute URL (protocol, host, path, and trailing slash) of your published site -#[languages] -# [languages.en] -# title = 'My blog' -# weight = 1 -# [languages.en.params] -# linkedin = 'https://linkedin.com/whoever' -# [languages.fr] -# title = 'Mon blogue' -# weight = 2 -# [languages.fr.params] -# linkedin = 'https://linkedin.com/fr/whoever' -# [languages.it] -# title = 'Il mio blog' -# weight = 3 -# [languages.fr.params] -# linkedin = 'https://linkedin.com/fr/whoever' +# defaultContentLanguage - Content without language indicator will default to this language. +defaultContentLanguage = "en" +[languages] + [languages.en] + title = 'Hugo Hermit - V2' + [languages.en.params] + homeSubtitle = "A minimal and fast theme for Hugo." + weight = 1 + [languages.fr] + title = 'Hugo Hermit - V2 (FR)' + [languages.fr.params] + homeSubtitle = "Un thème minimal et rapide pour Hugo." + weight = 2 + [languages.it] + title = 'Hugo Hermit - V2 (IT)' + [languages.it.params] + homeSubtitle = "Un tema minimale e veloce per Hugo." + weight = 3 + +defaultContentLanguageInSubdir = true # languageCode - A language tag as defined by RFC 5646. This value is used to populate: # The element in the internal RSS template # The lang attribute of the element in the internal alias template languageCode = "en-us" -# defaultContentLanguage - Content without language indicator will default to this language. -defaultContentLanguage = "en" - - # title - Site title -title = "Hugo Hermit - V2" +# title = "Hugo Hermit - V2" # enableGitInfo - Enable .GitInfo object for each page (if the Hugo site is versioned by Git). This will then update the Lastmod parameter for each page using the last git commit date for that content file. #enableGitInfo = true @@ -53,6 +53,7 @@ enableEmoji = true [author] name = "1BL4Z3R" + about = "about-hugo" [blackfriday] # hrefTargetBlank = true @@ -74,9 +75,9 @@ enableEmoji = true # images = [""] themeColor = "#494f5c" - homeSubtitle = "A minimal and fast theme for Hugo." + #homeSubtitle = "A minimal and fast theme for Hugo." - footerCopyright = ' · CC BY-NC 4.0' + footerCopyright = ' CC BY-NC 4.0' # bgImg = "" # Homepage background-image URL # Prefix of link to the git commit detail page. GitInfo must be enabled. @@ -85,7 +86,7 @@ enableEmoji = true # Toggling this option needs to rebuild SCSS, requires Hugo extended version justifyContent = false # Set "text-align: justify" to `.content`. - relatedPosts = false # Add a related content section to all single posts page + relatedPosts = true # Add a related content section to all single posts page code_copy_button = true # Turn on/off the code-copy-button for code-fields @@ -109,6 +110,12 @@ enableEmoji = true # You can enable Per-Page MathJax support by adding `mathjax : true` in Page frontmatter global_mathjax = false + # Toggle Reading time for articles + readTime = true + + # Specify Separator between wordCount and readTime + readTimeSeparator = "\u002F||\u005C Reading Time:" + # --------------------------------------------------- # Hugo - V2 specific configurations end # --------------------------------------------------- diff --git a/layouts/partials/readTime.html b/layouts/partials/readTime.html new file mode 100644 index 0000000..46420c1 --- /dev/null +++ b/layouts/partials/readTime.html @@ -0,0 +1,10 @@ +{{ if .Site.Params.readTime }} + {{ .Site.Params.readTimeSeparator }} + {{ $rT := mul (div (.WordCount) 220.0) 60 }} + {{ $rTH := math.Floor (div $rT 3600) }} + {{ $rTM := math.Floor (div (mod $rT 3600) 60) }} + {{ $rTS := mod (mod $rT 3600) 60 }} + {{ if gt $rTH 0 }}{{ $rTH }}{{ cond (gt $rTH 1) " Hours" " Hour" }}{{- end -}} + {{ if gt $rTM 0 }}{{ cond (gt $rTH 0) ", " "" }}{{ $rTM }}{{ cond (gt $rTM 1) " Minutes" " Minute" }}{{- end -}} + {{ if gt $rTS 0 }}{{ cond (gt $rTM 0) ", " "" }}{{ $rTS }}{{ cond (gt $rTS 1) " Seconds" " Second" }}{{- end -}} +{{ end }} \ No newline at end of file diff --git a/layouts/partials/svg.html b/layouts/partials/svg.html index 5bb5042..1d05fd7 100644 --- a/layouts/partials/svg.html +++ b/layouts/partials/svg.html @@ -46,6 +46,8 @@ {{- else if (eq .name "rss") -}} +{{- else if (eq .name "author") -}} + {{- else if (eq .name "scrollup") -}} {{- else -}} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 00b6090..714546a 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -26,8 +26,16 @@ {{- with .Params.description }}

{{.}}

{{- end }} - {{- with $.Param "author" }} -

{{ . }}

+ + {{- if and .Params.author .Params.authorLink}} + {{ $relreflink := relref . .Params.authorLink }} +

{{ partial "svg.html" (dict "context" . "name" "author") }}{{ .Params.author }}

+ {{- else if .Params.author }} + {{ $relreflink := relref . .Site.Author.about }} +

{{ partial "svg.html" (dict "context" . "name" "author") }}{{ .Params.author }}

+ {{- else }} + {{ $relreflink := relref . .Site.Author.about }} +

{{ partial "svg.html" (dict "context" . "name" "author") }}{{ .Site.Author.name }}

{{- end }} {{- with .Params.tags }}

@@ -37,7 +45,7 @@ {{- end }}

{{- end }} -

{{ i18n "wordCount" . }}

+

{{ i18n "wordCount" . }} {{ partial "readTime.html" . }}

{{ dateFormat .Site.Params.dateformNumTime .Date.Local }} {{ if .Lastmod }} {{ if not (eq .Lastmod .Date ) }} diff --git a/theme.toml b/theme.toml index 948a54d..c301e26 100644 --- a/theme.toml +++ b/theme.toml @@ -1,10 +1,10 @@ name = "Hermit-V2" license = "MIT" -licenselink = "https://github.com/Track3/hermit/blob/master/LICENSE" +licenselink = "https://github.com/1bl4z3r/hermit-V2/blob/main/LICENSE" description = "A minimal and fast hugo theme for bloggers." homepage = "https://github.com/1bl4z3r/hermit-V2" demosite = "https://1bl4z3r.github.io/hermit-V2/" -tags = ["blog", "minimal", "dark", "responsive", fast] +tags = ["blog", "minimal", "dark", "responsive", "fast"] features = [ "single column", "featured image",