Spoiler shortcode for hugo narrow theme
为 Hugo Narrow 主题提供 spoiler 短代码
- HTML 73.7%
- CSS 26.3%
| assets/css/custom | ||
| layouts/_shortcodes | ||
| go.mod | ||
| hugo.yaml | ||
| LICENSE | ||
| README.md | ||
| README.zh-cn.md | ||
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. |