From 91b583817a2bca52d03022735a28e2f5d5e14070 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Fri, 28 Jun 2024 14:17:48 +0800 Subject: [PATCH 01/46] :bug: Fix: fix custom-assets block postion --- layouts/partials/assets.html | 6 +++--- layouts/partials/init/index.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index abda23e72..0d77ad3c8 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -284,6 +284,9 @@ {{- end -}} {{- dict "Source" (resources.Get "js/theme.js") "Build" $options "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} +{{- /* Custom Assets */ -}} +{{- block "custom-assets" . }}{{ end -}} + {{- /* Custom script */ -}} {{- with ((resources.Get "js/custom.js") | default (resources.Get "js/_custom.js")) -}} {{- $options := dict "targetPath" "js/custom.min.js" "minify" hugo.IsProduction -}} @@ -306,6 +309,3 @@ {{- end -}} {{- partial "plugin/analytics.html" . -}} - -{{- /* Custom Assets */ -}} -{{- block "custom-assets" . }}{{ end -}} diff --git a/layouts/partials/init/index.html b/layouts/partials/init/index.html index 2ad8c3e64..e36e5bdd7 100644 --- a/layouts/partials/init/index.html +++ b/layouts/partials/init/index.html @@ -1,4 +1,4 @@ -{{- .Scratch.Set "version" "v0.3.8" -}} +{{- .Scratch.Set "version" "v0.3.9-RC" -}} {{- .Scratch.Set "this" dict -}} {{- partial "init/detection-env.html" . -}} From 052d128922d88aadbd4dadb58cf27a805d3d6fa4 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Sun, 30 Jun 2024 13:33:21 +0800 Subject: [PATCH 02/46] :bug: Fix: fix code title overflow in code header --- assets/css/_partials/_single/_code.scss | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/assets/css/_partials/_single/_code.scss b/assets/css/_partials/_single/_code.scss index 03dc239f7..12826ae9b 100644 --- a/assets/css/_partials/_single/_code.scss +++ b/assets/css/_partials/_single/_code.scss @@ -78,6 +78,7 @@ pre:not(.mermaid[data-processed='true']) { position: relative; .code-header { + --#{$prefix}bg-code-header: #{darken($code-background-color, 3%)}; display: flex; justify-content: space-between; align-items: center; @@ -87,13 +88,13 @@ pre:not(.mermaid[data-processed='true']) { font-weight: bold; line-height: 1.4em; color: $code-info-color; - background-color: darken($code-background-color, 3%); + background-color: var(--#{$prefix}bg-code-header); @include border-radius($global-border-radius); @include transition(border-radius 0.2s ease); [data-theme='dark'] & { color: $code-info-color-dark; - background-color: darken($code-background-color-dark, 6%); + --#{$prefix}bg-code-header: #{darken($code-background-color-dark, 3%)}; } &:hover { @@ -119,6 +120,13 @@ pre:not(.mermaid[data-processed='true']) { position: absolute; left: 50%; transform: translateX(-50%); + background-color: var(--#{$prefix}bg-code-header); + padding-inline: 1em; + max-width: 80%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + @include z-index(0, 1); } } @@ -217,11 +225,11 @@ pre:not(.mermaid[data-processed='true']) { &.open { .code-header { - background-color: darken($code-background-color, 6%); + --#{$prefix}bg-code-header: #{darken($code-background-color, 6%)}; @include border-radius($global-border-radius $global-border-radius 0 0); [data-theme='dark'] & { - background-color: darken($code-background-color-dark, 3%); + --#{$prefix}bg-code-header: #{darken($code-background-color-dark, 6%)}; } } From cf91f230e8b0b32c66c3d75edcf799971b1d08de Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Thu, 4 Jul 2024 23:07:31 +0800 Subject: [PATCH 03/46] :memo: Docs: update default hugo.toml --- hugo.toml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hugo.toml b/hugo.toml index 1f2249c5e..1126b7efa 100644 --- a/hugo.toml +++ b/hugo.toml @@ -157,10 +157,22 @@ enableEmoji = true definitionList = true footnote = true linkify = true - strikethrough = true + strikethrough = false table = true taskList = true typographer = true + # https://gohugo.io/getting-started/configuration-markup/#extras + [markup.goldmark.extensions.extras] + [markup.goldmark.extensions.extras.delete] + enable = true + [markup.goldmark.extensions.extras.insert] + enable = true + [markup.goldmark.extensions.extras.mark] + enable = true + [markup.goldmark.extensions.extras.subscript] + enable = true + [markup.goldmark.extensions.extras.superscript] + enable = true [markup.goldmark.renderer] # whether to use HTML tags directly in the document unsafe = true From 44d0c7611ddb2cd16360d823f76279a4b85db566 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Thu, 4 Jul 2024 23:37:08 +0800 Subject: [PATCH 04/46] :recycle: Refactor: deprecate .Sites.First in favor of .Sites.Default .Sites.First was deprecated in Hugo v0.127.0 and will be removed in a future release. Use .Sites.Default instead. --- README.md | 2 +- README.zh-cn.md | 2 +- hugo.toml | 2 +- layouts/partials/init/detection-env.html | 2 +- layouts/partials/init/detection-version.html | 2 +- theme.toml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c18c683b0..6ffc6fd8c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # FixIt Theme | Hugo [![GitHub release (latest by date)](https://img.shields.io/github/v/release/hugo-fixit/FixIt?style=flat)](https://github.com/hugo-fixit/FixIt/releases) -[![Hugo](https://img.shields.io/badge/Hugo-%5E0.123.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/) +[![Hugo](https://img.shields.io/badge/Hugo-%5E0.127.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/) [![License](https://img.shields.io/github/license/hugo-fixit/FixIt?style=flat)](/LICENSE) 👉 English README | [简体中文说明](README.zh-cn.md) diff --git a/README.zh-cn.md b/README.zh-cn.md index 11eceba50..6ba1639f7 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -1,7 +1,7 @@ # FixIt 主题 | Hugo [![GitHub release (latest by date)](https://img.shields.io/github/v/release/hugo-fixit/FixIt?style=flat)](https://github.com/hugo-fixit/FixIt/releases) -[![Hugo](https://img.shields.io/badge/Hugo-%5E0.123.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/) +[![Hugo](https://img.shields.io/badge/Hugo-%5E0.127.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/) [![License](https://img.shields.io/github/license/hugo-fixit/FixIt?style=flat)](/LICENSE) 👉 [English README](README.md) | 简体中文说明 diff --git a/hugo.toml b/hugo.toml index 1126b7efa..145e01484 100644 --- a/hugo.toml +++ b/hugo.toml @@ -133,7 +133,7 @@ enableEmoji = true [module] [module.hugoVersion] extended = true - min = "0.123.0" + min = "0.127.0" # ------------------------------------------------------------------------------------- # Markup related configuration in Hugo diff --git a/layouts/partials/init/detection-env.html b/layouts/partials/init/detection-env.html index fb9899948..e61671790 100644 --- a/layouts/partials/init/detection-env.html +++ b/layouts/partials/init/detection-env.html @@ -26,7 +26,7 @@ {{- if ne .Site.Params.dev.enable true -}} {{- .Scratch.Set "devOpts" dict -}} {{- end -}} - {{- if eq .Site .Sites.First -}} + {{- if eq .Site .Sites.Default -}} {{- warnf "FixIt %v\n%v\n\n" (.Scratch.Get "version") (T "init.devEnvWarn") -}} {{- end -}} {{- end -}} diff --git a/layouts/partials/init/detection-version.html b/layouts/partials/init/detection-version.html index 6944857c2..f53e803ee 100644 --- a/layouts/partials/init/detection-version.html +++ b/layouts/partials/init/detection-version.html @@ -10,7 +10,7 @@ {{- end -}} {{- /* FixIt theme version detection */ -}} -{{- if eq .Site .Sites.First -}} +{{- if eq .Site .Sites.Default -}} {{- if not .Site.Params.version -}} {{- errorf "FixIt %v\n%v\n\n" $version (T "init.configurationError") -}} {{- else if gt "0.2.0" (strings.TrimPrefix "v" .Site.Params.version) -}} diff --git a/theme.toml b/theme.toml index 9ebab62df..7ea28e150 100644 --- a/theme.toml +++ b/theme.toml @@ -7,7 +7,7 @@ licenselink = "https://github.com/hugo-fixit/FixIt/blob/master/LICENSE" description = "A Clean, Elegant but Advanced Hugo Theme for Hugo." homepage = "https://github.com/hugo-fixit/FixIt" demosite = "https://fixit.lruihao.cn" -min_version = "0.123.0" +min_version = "0.127.0" tags = [ "blog", From 061a3e3e2b76e9cdbeea8f38c40d209eee8f9c76 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Thu, 4 Jul 2024 23:40:08 +0800 Subject: [PATCH 05/46] :recycle: Refactor: deprecate .Site.IsMultiLingual in favor of hugo.IsMultilingual .Site.IsMultiLingual was deprecated in Hugo v0.124.0 and will be removed in a future release. Use hugo.IsMultilingual --- layouts/partials/header.html | 4 ++-- layouts/shortcodes/version.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index a9680b236..438fd7563 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -106,7 +106,7 @@ - {{- if .Site.IsMultiLingual -}} + {{- if hugo.IsMultilingual -}}