Spoiler shortcode for hugo narrow theme 为 Hugo Narrow 主题提供 spoiler 短代码
  • HTML 73.7%
  • CSS 26.3%
Find a file
2026-05-18 01:50:42 +08:00
assets/css/custom add spoiler shortcode implementation 2026-05-18 01:40:31 +08:00
layouts/_shortcodes add spoiler shortcode implementation 2026-05-18 01:40:31 +08:00
go.mod init hugo mod 2026-05-18 00:07:52 +08:00
hugo.yaml add spoiler shortcode implementation 2026-05-18 01:40:31 +08:00
LICENSE Initial commit 2026-05-17 16:06:09 +00:00
README.md add Chinese translation for README 2026-05-18 01:50:42 +08:00
README.zh-cn.md add Chinese translation for README 2026-05-18 01:50:42 +08:00

hugo-narrow-shortcode-spoiler

简体中文

Spoiler shortcode for the Hugo Narrow theme.

Installation

Import this module with hugo-narrow:

module:
  imports:
    - path: git.hana.im/Hanamaru/hugo-narrow-shortcode-spoiler
    - path: github.com/tom2almighty/hugo-narrow

Usage

Inline spoiler:

This is {{< spoiler "hidden text" />}}.

Named parameter:

{{< spoiler text="hidden text" />}}

Inner content:

{{< spoiler >}}hidden text{{< /spoiler >}}

Markdown content:

{{< spoiler markdown=true >}}
**hidden** text
{{< /spoiler >}}

Selectable hidden text:

{{< spoiler text="hidden text" selectable=true />}}

Parameters

Name Type Default Description
text string "" Spoiler text. If omitted, the shortcode uses inner content.
markdown boolean false Render inner content as Markdown.
selectable boolean false Allow selecting hidden text before reveal.