Merge branch 'v0' into v1

* v0:
  🔧 Chore: update default hugo.toml
  🚨 Fix: the author key in site configuration is deprecated. Use params.author instead
  📝 Docs: add post "Tips about algolia"
  ⬆️ Chore: bump babel and core-js
This commit is contained in:
Cell
2023-12-05 10:12:18 +08:00
11 changed files with 134 additions and 20 deletions
+1 -1
View File
@@ -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'
+114
View File
@@ -112,6 +112,13 @@ enableEmoji = true
# You can turn it off, but we would really appreciate if you dont, 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"]
+3 -3
View File
@@ -15,12 +15,12 @@
{{- . -}}
</language>
{{- end -}}
{{- with .Site.Author.email -}}
{{- with .Site.Params.author.email -}}
<managingEditor>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}}
</managingEditor>
<webMaster>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}}
</webMaster>
{{- end -}}
{{- with .Site.Copyright -}}
+1 -1
View File
@@ -33,7 +33,7 @@
{{- /* Author */ -}}
{{- if ne .Site.Params.footer.author false -}}
<span class="author" itemprop="copyrightHolder">
{{ 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) -}}
</span>
{{- end -}}
+2 -2
View File
@@ -1,7 +1,7 @@
{{- $params := .Scratch.Get "params" -}}
<meta name="author" content="{{ .Site.Author.name }}">
<meta name="author-link" content="{{ .Site.Author.link }}">
<meta name="author" content="{{ .Site.Params.author.name }}">
<meta name="author-link" content="{{ .Site.Params.author.link }}">
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage | and .Summary }}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
{{- $keywords := .Keywords -}}
+2 -2
View File
@@ -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 -}}
+2 -2
View File
@@ -28,10 +28,10 @@
{{- $url = .RelPermalink -}}
{{- end -}}
<a href="{{ $url }}"{{ with .Title | default .Name }} title="{{ . }}"{{ end }}{{ if (urls.Parse $url).Host }} rel="noopener noreferrer" target="_blank"{{ end }}>
{{- dict "Src" $avatar "Alt" $.Site.Author.name | partial "plugin/image.html" -}}
{{- dict "Src" $avatar "Alt" $.Site.Params.author.name | partial "plugin/image.html" -}}
</a>
{{- 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 -}}
</div>
{{- end -}}
+2 -2
View File
@@ -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 -}}
+1 -1
View File
@@ -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 -}}
+3 -3
View File
@@ -15,12 +15,12 @@
{{- . -}}
</language>
{{- end -}}
{{- with .Site.Author.email -}}
{{- with .Site.Params.author.email -}}
<managingEditor>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}}
</managingEditor>
<webMaster>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}}
</webMaster>
{{- end -}}
{{- with .Site.Copyright -}}
+3 -3
View File
@@ -15,12 +15,12 @@
{{- . -}}
</language>
{{- end -}}
{{- with .Site.Author.email -}}
{{- with .Site.Params.author.email -}}
<managingEditor>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}}
</managingEditor>
<webMaster>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end -}}
</webMaster>
{{- end -}}
{{- with .Site.Copyright -}}