diff --git a/archetypes/friends.md b/archetypes/friends.md index bd4c99d0..cba8e826 100644 --- a/archetypes/friends.md +++ b/archetypes/friends.md @@ -3,7 +3,7 @@ title: {{ replace .TranslationBaseName "-" " " | title }} subtitle: type: friends date: {{ .Date }} -description: "{{ .Site.Author.name }}'s friends" +description: "{{ .Site.Params.author.name }}'s friends" keywords: - 'Hugo FixIt' - 'friends template' diff --git a/hugo.toml b/hugo.toml index 8c24806a..16c3ac8b 100644 --- a/hugo.toml +++ b/hugo.toml @@ -112,6 +112,13 @@ enableEmoji = true # You can turn it off, but we would really appreciate if you don’t, as this is a good way to watch FixIt's popularity on the rise. disableThemeInject = false + # Author Configuration + [params.author] + name = "" + email = "" + link = "" + avatar = "" + # FixIt 0.2.0 | NEW App icon config [params.app] # optional site title override for the app when added to an iOS home screen or Android launcher @@ -877,3 +884,110 @@ enableEmoji = true [module.hugoVersion] extended = true min = "0.110.0" + +# ------------------------------------------------------------------------------------- +# Markup related configuration in Hugo +# See: https://gohugo.io/getting-started/configuration-markup/ +# ------------------------------------------------------------------------------------- + +[markup] + # Syntax Highlighting (https://gohugo.io/content-management/syntax-highlighting) + [markup.highlight] + ########## necessary configurations ########## + # https://github.com/hugo-fixit/FixIt/issues/43 + codeFences = true + lineNos = true + lineNumbersInTable = true + noClasses = false + ########## necessary configurations ########## + guessSyntax = true + # Goldmark is from Hugo 0.60 the default library used for Markdown + [markup.goldmark] + [markup.goldmark.extensions] + definitionList = true + footnote = true + linkify = true + strikethrough = true + table = true + taskList = true + typographer = true + [markup.goldmark.renderer] + # whether to use HTML tags directly in the document + unsafe = true + # Table Of Contents settings + [markup.tableOfContents] + startLevel = 2 + endLevel = 6 + +# ------------------------------------------------------------------------------------- +# Sitemap Configuration +# See: https://gohugo.io/templates/sitemap-template/#configuration +# ------------------------------------------------------------------------------------- + +[sitemap] + changefreq = "weekly" + filename = "sitemap.xml" + priority = 0.5 + +# ------------------------------------------------------------------------------------- +# Permalinks Configuration +# See: https://gohugo.io/content-management/urls/#permalinks +# ------------------------------------------------------------------------------------- + +[Permalinks] + # posts = ":year/:month/:filename" + posts = "posts/:slugorfilename" + +# ------------------------------------------------------------------------------------- +# Privacy Configuration +# See: https://gohugo.io/about/hugo-and-gdpr/ +# ------------------------------------------------------------------------------------- + +[privacy] + [privacy.twitter] + enableDNT = true + [privacy.youtube] + privacyEnhanced = true + +# ------------------------------------------------------------------------------------- +# Media Types +# See: https://gohugo.io/templates/output-formats/#media-types +# ------------------------------------------------------------------------------------- + +[mediaTypes] + # Options to make output .md files + [mediaTypes."text/markdown"] + suffixes = ["md"] + # Options to make output .txt files + [mediaTypes."text/plain"] + suffixes = ["txt"] + +# ------------------------------------------------------------------------------------- +# Output Format Definitions +# See: https://gohugo.io/templates/output-formats/#output-format-definitions +# ------------------------------------------------------------------------------------- + +[outputFormats] + # Options to make output .md files + [outputFormats.MarkDown] + mediaType = "text/markdown" + isPlainText = true + isHTML = false + # FixIt 0.2.15 | NEW Options to make output baidu_urls.txt file + [outputFormats.BaiduUrls] + baseName = "baidu_urls" + mediaType = "text/plain" + isPlainText = true + isHTML = false + +# ------------------------------------------------------------------------------------- +# Customizing Output Formats +# See: https://gohugo.io/templates/output-formats/#customizing-output-formats +# ------------------------------------------------------------------------------------- + +[outputs] + home = ["HTML", "RSS", "JSON", "BaiduUrls"] + page = ["HTML", "MarkDown"] + section = ["HTML", "RSS"] + taxonomy = ["HTML"] + term = ["HTML", "RSS"] diff --git a/layouts/index.rss.xml b/layouts/index.rss.xml index 117c4433..8b353881 100644 --- a/layouts/index.rss.xml +++ b/layouts/index.rss.xml @@ -15,12 +15,12 @@ {{- . -}} {{- end -}} - {{- with .Site.Author.email -}} + {{- with .Site.Params.author.email -}} - {{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}} + {{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}} - {{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}} + {{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}} {{- end -}} {{- with .Site.Copyright -}} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 533a5935..b01c13d0 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -33,7 +33,7 @@ {{- /* Author */ -}} {{- if ne .Site.Params.footer.author false -}} - {{ partial "plugin/link.html" (dict "Destination" ($.Site.Author.link | default .Site.Home.RelPermalink) "Content" .Site.Author.name) -}} + {{ partial "plugin/link.html" (dict "Destination" ($.Site.Params.author.link | default .Site.Home.RelPermalink) "Content" .Site.Params.author.name) -}} {{- end -}} diff --git a/layouts/partials/head/meta.html b/layouts/partials/head/meta.html index 89080805..6721ee87 100644 --- a/layouts/partials/head/meta.html +++ b/layouts/partials/head/meta.html @@ -1,7 +1,7 @@ {{- $params := .Scratch.Get "params" -}} - - + + {{- $keywords := .Keywords -}} diff --git a/layouts/partials/head/seo.html b/layouts/partials/head/seo.html index 617539ca..9439f714 100644 --- a/layouts/partials/head/seo.html +++ b/layouts/partials/head/seo.html @@ -32,7 +32,7 @@ {{- with .Site.LanguageCode -}} "inLanguage": "{{ . }}", {{- end -}} - {{- with .Site.Author.name -}} + {{- with .Site.Params.author.name -}} "author": { "@type": "Person", "name": {{ . | safeHTML }} @@ -70,7 +70,7 @@ {{- /* Page SEO */ -}} {{- else if .IsPage -}} - {{- $authorName := .Site.Author.name | default (T "single.author") -}} + {{- $authorName := .Site.Params.author.name | default (T "single.author") -}} {{- with .Params.author -}} {{- if reflect.IsMap . -}} {{- $authorName = cond (isset . "name") .name $authorName -}} diff --git a/layouts/partials/home/profile.html b/layouts/partials/home/profile.html index 1941b576..e56af6ca 100644 --- a/layouts/partials/home/profile.html +++ b/layouts/partials/home/profile.html @@ -28,10 +28,10 @@ {{- $url = .RelPermalink -}} {{- end -}} - {{- dict "Src" $avatar "Alt" $.Site.Author.name | partial "plugin/image.html" -}} + {{- dict "Src" $avatar "Alt" $.Site.Params.author.name | partial "plugin/image.html" -}} {{- else -}} - {{- dict "Src" $avatar "Alt" $.Site.Author.name | partial "plugin/image.html" -}} + {{- dict "Src" $avatar "Alt" $.Site.Params.author.name | partial "plugin/image.html" -}} {{- end -}} {{- end -}} diff --git a/layouts/partials/init/patch.html b/layouts/partials/init/patch.html index af15bd5b..5fb01c5a 100644 --- a/layouts/partials/init/patch.html +++ b/layouts/partials/init/patch.html @@ -3,7 +3,7 @@ {{- /* Author data patch */ -}} {{- $authorDefault := dict "name" "Anonymous" "link" "" "email" "" "avatar" "" -}} -{{- $author := .Site.Author | merge $authorDefault -}} +{{- $author := .Site.Params.author | merge $authorDefault -}} {{- $authorPost := dict -}} {{- $gravatar := .Site.Params.gravatar -}} {{- if reflect.IsMap $params.author -}} @@ -11,7 +11,7 @@ {{- else if isset $params "author" -}} {{- $authorPost = dict "name" $params.author -}} {{- end -}} -{{- if isset $authorPost "name" | and (ne $authorPost.name .Site.Author.name) -}} +{{- if isset $authorPost "name" | and (ne $authorPost.name .Site.Params.author.name) -}} {{- $author = $authorPost | merge $authorDefault | merge $author -}} {{- else -}} {{- with $authorPost.link -}}{{ $author = dict "link" . | merge $author }}{{- end -}} diff --git a/layouts/partials/rss/item.html b/layouts/partials/rss/item.html index e370b42c..b320b5cb 100644 --- a/layouts/partials/rss/item.html +++ b/layouts/partials/rss/item.html @@ -1,5 +1,5 @@ {{- $params := .Page.Params | merge .Site.Params.Page -}} -{{- $authorName := .Site.Author.name | default (T "single.author") -}} +{{- $authorName := .Site.Params.author.name | default (T "single.author") -}} {{- with .Params.author -}} {{- if reflect.IsMap . -}} {{- $authorName = cond (isset . "name") .name $authorName -}} diff --git a/layouts/posts/rss.xml b/layouts/posts/rss.xml index 1c298ba4..7d7f76d4 100644 --- a/layouts/posts/rss.xml +++ b/layouts/posts/rss.xml @@ -15,12 +15,12 @@ {{- . -}} {{- end -}} - {{- with .Site.Author.email -}} + {{- with .Site.Params.author.email -}} - {{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}} + {{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}} - {{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}} + {{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}} {{- end -}} {{- with .Site.Copyright -}} diff --git a/layouts/taxonomy/rss.xml b/layouts/taxonomy/rss.xml index 50a1e884..d3ac817a 100644 --- a/layouts/taxonomy/rss.xml +++ b/layouts/taxonomy/rss.xml @@ -15,12 +15,12 @@ {{- . -}} {{- end -}} - {{- with .Site.Author.email -}} + {{- with .Site.Params.author.email -}} - {{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}} + {{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}} - {{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}} + {{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}} {{- end -}} {{- with .Site.Copyright -}}