From d2c4d7c18f0464c979769d46e2ef8f27abcd69d5 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Fri, 13 Dec 2024 10:54:07 +0800 Subject: [PATCH] :bug: Fix: blockquote render hook text parsing (#519) --- README.md | 2 +- README.zh-cn.md | 2 +- assets/css/_shortcodes/_admonition.scss | 4 ---- hugo.toml | 2 +- layouts/_default/_markup/render-blockquote-alert.html | 6 +----- theme.toml | 2 +- 6 files changed, 5 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c2aa8a6ce..f2e8a776f 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ # FixIt [![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.134.1-ff4088?style=flat&logo=hugo)](https://gohugo.io/) +[![Hugo](https://img.shields.io/badge/Hugo-%5E0.140.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/) [![License](https://img.shields.io/github/license/hugo-fixit/FixIt?style=flat)](/LICENSE) [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/hugo-fixit/FixIt) diff --git a/README.zh-cn.md b/README.zh-cn.md index 9a8d0afff..17b887782 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -19,7 +19,7 @@ # FixIt [![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.134.1-ff4088?style=flat&logo=hugo)](https://gohugo.io/) +[![Hugo](https://img.shields.io/badge/Hugo-%5E0.140.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/) [![License](https://img.shields.io/github/license/hugo-fixit/FixIt?style=flat)](/LICENSE) [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/hugo-fixit/FixIt) diff --git a/assets/css/_shortcodes/_admonition.scss b/assets/css/_shortcodes/_admonition.scss index d952e1026..a72fdb3b0 100644 --- a/assets/css/_shortcodes/_admonition.scss +++ b/assets/css/_shortcodes/_admonition.scss @@ -25,10 +25,6 @@ &:empty { display: none; } - // BUG of Hugo https://github.com/gohugoio/hugo/issues/12913 - &:has(> p:only-child:empty) { - display: none; - } } i.icon { diff --git a/hugo.toml b/hugo.toml index f8decf497..18d80b0e2 100644 --- a/hugo.toml +++ b/hugo.toml @@ -135,7 +135,7 @@ enableEmoji = true [module] [module.hugoVersion] extended = true - min = "0.134.1" + min = "0.140.0" # ------------------------------------------------------------------------------------- # Markup related configuration in Hugo diff --git a/layouts/_default/_markup/render-blockquote-alert.html b/layouts/_default/_markup/render-blockquote-alert.html index 8e077cf90..a065ccc2f 100644 --- a/layouts/_default/_markup/render-blockquote-alert.html +++ b/layouts/_default/_markup/render-blockquote-alert.html @@ -2,16 +2,12 @@ {{- if .AlertTitle | or .AlertSign | or (.AlertType | in $basicTypes | not) -}} {{- /* The extended syntax is compatible with Obsidian and FixIt admonition shortcode. */ -}} - {{- /* === Dirty hack === */ -}} - {{- /* BUG of Hugo https://github.com/gohugoio/hugo/issues/12913 */ -}} - {{- $title := replaceRE "" .AlertTitle -}} - {{- /* === Dirty hack === */ -}} {{- $openMap := dict "+" true "-" false -}} {{- $open := index $openMap .AlertSign | default true -}} {{- $foldable := ne .AlertSign "" -}} {{- dict "Type" .AlertType - "Title" $title + "Title" .AlertTitle "Open" $open "Text" .Text "Foldable" $foldable diff --git a/theme.toml b/theme.toml index be4424bfd..7a22fe49d 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.134.1" +min_version = "0.140.0" tags = [ "blog",