<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="/atom.xsl"?><feed xmlns="http://www.w3.org/2005/Atom"><title>Markdown</title><subtitle>克喵的小站，记录着我的一些文字~</subtitle><link href="https://blog.518339.xyz/tags/markdown/" rel="alternate"/><link href="https://blog.518339.xyz/tags/markdown/atom.xml" rel="self" type="application/atom+xml"/><id>https://blog.518339.xyz/tags/markdown/</id><updated>2026-10-02T07:00:00+08:00</updated><generator uri="https://gohugo.io/">Hugo 0.166.0</generator><author><name>克喵Moretti</name><email>mcy@kemiaosw.top</email></author><entry><title>Solitude Hugo Shortcode 使用指南</title><link href="https://blog.518339.xyz/p/shortcode-showcase.html" rel="alternate"/><link rel="enclosure" href="https://blog.518339.xyz/img/posts/cover-shortcodes-v2.webp" type="image/webp"/><id>https://blog.518339.xyz/p/shortcode-showcase.html</id><published>2026-08-22T10:00:00+08:00</published><updated>2026-10-02T07:00:00+08:00</updated><author><name>克喵Moretti</name><email>mcy@kemiaosw.top</email></author><summary type="text">Shortcode 是 Hugo 在 Markdown 之外提供的内容组件语法。Solitude 用它承载提示框、标签页、图库、图表等富内容；迁移旧文章时，也应把 Hexo 外挂标签改写为对应的 Hugo shortcode。
本文既是使用手册，也是可构建的效果页。每个组件都按 用途 → 写法 → 参数 → 效果 展开，代码可以直接复制到 Markdown 文件中。 开始之前 Hugo shortcode 有两种边界符：{{&amp;amp;lt; …</summary><content type="html"><![CDATA[<p>Shortcode 是 Hugo 在 Markdown 之外提供的内容组件语法。Solitude 用它承载提示框、标签页、图库、图表等富内容；迁移旧文章时，也应把 Hexo 外挂标签改写为对应的 Hugo shortcode。</p>




  

<aside class="solitude-tag note info flat no-icon has-icon">
  <span class="note-icon" aria-hidden="true"><i class="fas fa-circle-info"></i></span>
  <div class="note-content">本文既是使用手册，也是可构建的效果页。每个组件都按 <strong>用途 → 写法 → 参数 → 效果</strong> 展开，代码可以直接复制到 Markdown 文件中。</div>
</aside>

<h2 id="开始之前">开始之前</h2>
<p>Hugo shortcode 有两种边界符：<code>{{&lt; shortcode &gt;}}</code> 适合普通参数，<code>{{% shortcode %}}</code> 会先处理内部 Markdown。Solitude 的块级组件已经按各自用途处理正文，通常直接使用尖括号写法即可。</p>
<table>
	<thead>
			<tr>
					<th>内容类型</th>
					<th>推荐组件</th>
					<th>适合场景</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>行内强调</td>
					<td><code>span</code>、<code>label</code>、<code>keyboard</code></td>
					<td>一句话中的状态、术语或快捷键</td>
			</tr>
			<tr>
					<td>块级提示</td>
					<td><code>note</code>、<code>subnote</code>、<code>fold</code></td>
					<td>说明、警告、补充资料</td>
			</tr>
			<tr>
					<td>导航与引用</td>
					<td><code>button</code>、<code>link</code>、<code>card</code></td>
					<td>行动入口、站内外资源</td>
			</tr>
			<tr>
					<td>结构化内容</td>
					<td><code>tabs</code>、<code>timeline</code>、<code>gallery</code>、<code>series</code></td>
					<td>分组、步骤、图片与文章集合</td>
			</tr>
			<tr>
					<td>动态内容</td>
					<td><code>mermaid</code>、<code>chartjs</code>、<code>typeit</code></td>
					<td>流程、数据与动态文字</td>
			</tr>
	</tbody>
</table>




  

<aside class="solitude-tag note warning simple no-icon has-icon">
  <span class="note-icon" aria-hidden="true"><i class="fas fa-triangle-exclamation"></i></span>
  <div class="note-content">Shortcode 名称和参数区分大小写。块级组件还要成对书写结束标签，否则 Hugo 会在构建阶段直接报错。</div>
</aside>

<h2 id="文本与状态">文本与状态</h2>
<h3 id="彩色文本与标签">彩色文本与标签</h3>
<p><code>p</code> 用于整段文字，<code>span</code> 用于行内文字，<code>label</code> 用于短小的状态标记。颜色参数可使用 <code>blue</code>、<code>green</code>、<code>orange</code>、<code>red</code>、<code>purple</code> 等主题色名称。</p>
<p><strong>写法</strong></p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; p color=&#34;blue&#34; &gt;}}这是一段蓝色文字{{&lt; /p &gt;}}
正文中的 {{&lt; span color=&#34;red&#34; &gt;}}重点文字{{&lt; /span &gt;}}
{{&lt; label color=&#34;green&#34; &gt;}}已完成{{&lt; /label &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<p><strong>效果</strong></p>
<p class="solitude-tag tag-text tag-paragraph blue">这是一段蓝色文字，用于在正文中形成较强的段落提示。</p>

<p>正文中的 <span class="solitude-tag tag-text tag-span red">重点文字</span>
 可以和普通内容自然排列。</p>
<p><mark class="solitude-tag hl-label tag-label green">已完成</mark>

<mark class="solitude-tag hl-label tag-label blue">信息</mark>

<mark class="solitude-tag hl-label tag-label orange">注意</mark>

<mark class="solitude-tag hl-label tag-label purple">扩展</mark>
</p>
<h3 id="提示框">提示框</h3>
<p><code>note</code> 是主要提示组件，<code>subnote</code> 适合在一个主题下继续补充次级信息。</p>
<p><strong>写法</strong></p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; note type=&#34;info&#34; style=&#34;flat&#34; &gt;}}
提示内容，支持 Markdown。
{{&lt; /note &gt;}}

{{&lt; subnote type=&#34;warning&#34; &gt;}}次级提示{{&lt; /subnote &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<table>
	<thead>
			<tr>
					<th>参数</th>
					<th>是否必填</th>
					<th>说明</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><code>type</code></td>
					<td>否</td>
					<td><code>info</code>、<code>success</code>、<code>warning</code>、<code>danger</code>、<code>primary</code> 或默认样式</td>
			</tr>
			<tr>
					<td><code>style</code></td>
					<td>否</td>
					<td><code>flat</code>、<code>simple</code>、<code>modern</code>；默认使用 <code>flat</code></td>
			</tr>
			<tr>
					<td>正文</td>
					<td>是</td>
					<td>支持 Markdown 的提示内容</td>
			</tr>
	</tbody>
</table>
<p><strong>效果</strong></p>
<p>



  

<aside class="solitude-tag note info flat no-icon has-icon">
  <span class="note-icon" aria-hidden="true"><i class="fas fa-circle-info"></i></span>
  <div class="note-content">信息提示适合解释前置条件或补充背景。</div>
</aside>





  

<aside class="solitude-tag note success modern no-icon has-icon">
  <span class="note-icon" aria-hidden="true"><i class="fas fa-circle-check"></i></span>
  <div class="note-content">构建与内容检查已经通过，可以继续发布流程。</div>
</aside>





  

<aside class="solitude-tag note warning simple no-icon has-icon">
  <span class="note-icon" aria-hidden="true"><i class="fas fa-triangle-exclamation"></i></span>
  <div class="note-content">修改配置后请重新构建站点，避免继续使用旧的资源指纹。</div>
</aside>





  

<aside class="solitude-tag note danger flat no-icon has-icon">
  <span class="note-icon" aria-hidden="true"><i class="fas fa-circle-exclamation"></i></span>
  <div class="note-content">危险提示应只用于确实需要读者立即注意的问题。</div>
</aside>




  

<aside class="solitude-tag note subnote warning flat no-icon has-icon">
  <span class="note-icon" aria-hidden="true"><i class="fas fa-triangle-exclamation"></i></span>
  <div class="note-content">这是紧跟主要内容的次级提醒。</div>
</aside>
</p>
<h3 id="选择快捷键与隐藏文字">选择、快捷键与隐藏文字</h3>
<p>这组组件适合展示只读状态和行内补充信息。<code>checkbox</code> 与 <code>radio</code> 仅负责表达，不会提交表单。</p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; checkbox checked=true &gt;}}已完成事项{{&lt; /checkbox &gt;}}
{{&lt; radio checked=false &gt;}}未选择事项{{&lt; /radio &gt;}}
{{&lt; keyboard &gt;}}⌘ K{{&lt; /keyboard &gt;}}
{{&lt; spoiler &gt;}}移入或聚焦后显示{{&lt; /spoiler &gt;}}
{{&lt; bubble position=&#34;left&#34; &gt;}}气泡消息{{&lt; /bubble &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<p><div class="solitude-tag checkbox tag-choice "><input type="checkbox" aria-label="已完成事项" checked disabled><span class="tag-choice-content">已完成事项</span></div>

<div class="solitude-tag checkbox tag-choice blue"><input type="checkbox" aria-label="尚未完成事项"  disabled><span class="tag-choice-content">尚未完成事项</span></div>

<div class="solitude-tag checkbox tag-choice "><input type="radio" aria-label="已选择事项" checked disabled><span class="tag-choice-content">已选择事项</span></div>

<div class="solitude-tag checkbox tag-choice plus"><input type="checkbox" aria-label="新增检查项" checked disabled><span class="tag-choice-content">新增检查项</span></div>
</p>
<p>按下 <kbd class="solitude-tag keyboard-tag tag-keyboard">⌘ K</kbd>
 打开搜索；答案是 <span class="solitude-tag spoiler tag-spoiler block-text" tabindex="0" aria-label="Hidden text">隐藏内容</span>
。<span class="solitude-tag bubble tag-bubble"><span class="bubble-content" tabindex="0">气泡消息</span><span class="bubble-notation bg-blue">left</span></span>
</p>
<h2 id="链接按钮与媒体">链接、按钮与媒体</h2>
<h3 id="按钮与链接卡片">按钮与链接卡片</h3>
<p><code>button</code> 提供主题按钮，并通过 <code>option</code> 组合颜色、描边和整行样式；<code>link</code> 将链接呈现为带说明的资源卡片。站外链接会自动在新窗口打开并附带安全属性。</p>
<p><strong>写法</strong></p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; button url=&#34;https://gohugo.io/&#34; text=&#34;Hugo 官网&#34; icon=&#34;fas fa-link&#34; &gt;}}
{{&lt; button url=&#34;/&#34; text=&#34;描边按钮&#34; icon=&#34;fas fa-house&#34; option=&#34;blue outline&#34; &gt;}}
{{&lt; link url=&#34;/&#34; title=&#34;站内链接&#34; desc=&#34;返回示例站首页&#34; &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<table>
	<thead>
			<tr>
					<th>参数</th>
					<th>适用组件</th>
					<th>说明</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><code>url</code></td>
					<td>全部</td>
					<td>目标地址</td>
			</tr>
			<tr>
					<td><code>text</code></td>
					<td><code>button</code></td>
					<td>按钮文字</td>
			</tr>
			<tr>
					<td><code>icon</code></td>
					<td><code>button</code></td>
					<td>图标类名</td>
			</tr>
			<tr>
					<td><code>option</code></td>
					<td><code>button</code></td>
					<td>可组合 <code>outline</code>、颜色、<code>block</code> 等样式</td>
			</tr>
			<tr>
					<td><code>title</code> / <code>desc</code></td>
					<td><code>link</code></td>
					<td>卡片标题与说明</td>
			</tr>
	</tbody>
</table>
<p><strong>效果</strong></p>
<p><a class="solitude-tag st-btn tag-button  has-icon " href="https://gohugo.io/" target="_blank" rel="noopener noreferrer"><i class="solitude fas fa-arrow-up-right-from-square" aria-hidden="true"></i><span>Hugo 官网</span></a>

<a class="solitude-tag st-btn tag-button blue outline has-icon " href="/" ><i class="solitude fas fa-house" aria-hidden="true"></i><span>描边按钮</span></a>

<a class="solitude-tag st-btn tag-button block has-icon " href="/" ><i class="solitude fas fa-arrow-right" aria-hidden="true"></i><span>适合移动端换行的整行按钮</span></a>
</p>
<p><div class="solitude-tag tag-link-card"><a class="solitude-tag tag-link" href="https://gohugo.io/" target="_blank" rel="noopener noreferrer" aria-label="Hugo：The world’s fastest framework for building websites"><div class="tag-link-tips"><i class="fas fa-arrow-up-right-from-square" aria-hidden="true"></i>引用站外链接</div><div class="tag-link-bottom"><div class="tag-link-left"><i class="solitude fas fa-link"></i></div><div class="tag-link-right"><div class="tag-link-title">Hugo</div><div class="tag-link-sitename">The world’s fastest framework for building websites</div></div><i class="solitude fas fa-chevron-right"></i></div></a></div>

<div class="solitude-tag tag-link-card"><a class="solitude-tag tag-link" href="/"  aria-label="站内链接与超长标题在窄屏下的截断和换行验证：返回示例站首页，检查移动端触控面积与键盘焦点状态。"><div class="tag-link-tips"><i class="fas fa-house" aria-hidden="true"></i>站内链接</div><div class="tag-link-bottom"><div class="tag-link-left"><i class="solitude fas fa-link"></i></div><div class="tag-link-right"><div class="tag-link-title">站内链接与超长标题在窄屏下的截断和换行验证</div><div class="tag-link-sitename">返回示例站首页，检查移动端触控面积与键盘焦点状态。</div></div><i class="solitude fas fa-chevron-right"></i></div></a></div>
</p>
<h3 id="图片">图片</h3>
<p><code>img</code> 用于带说明的块级图片，<code>inlineImg</code> 用于跟随文字排列的小图片。</p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; img src=&#34;/img/default.avif&#34; alt=&#34;示例图片&#34; caption=&#34;主题默认封面&#34; &gt;}}
{{&lt; inlineImg src=&#34;/img/avatar.webp&#34; alt=&#34;Logo&#34; height=&#34;24px&#34; &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<figure class="solitude-tag tag-image-wrap"><img class="solitude-tag tag-image" src="/img/demo/cover-shortcodes-v2.webp" alt="Solitude Shortcode 示例封面" loading="lazy" ><figcaption>本地 Shortcode 示例素材</figcaption></figure>

<p>Solitude <img class="solitude-tag inline-img tag-inline-image no-lightbox" src="/img/avatar.webp" alt="Solitude Logo" style="height:24px" loading="lazy">
 与 Hugo 可以出现在同一行文字中。</p>
<h3 id="视频与音频">视频与音频</h3>
<p>YouTube、哔哩哔哩、原生音频和原生视频分别使用独立组件。外部媒体是否可播放仍取决于来源站点、网络环境与浏览器策略。</p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; youtube id=&#34;dQw4w9WgXcQ&#34; &gt;}}
{{&lt; bvideo bvid=&#34;BV1xx411c7mD&#34; &gt;}}
{{&lt; audio url=&#34;/media/example.mp3&#34; name=&#34;示例音频&#34; &gt;}}
{{&lt; video url=&#34;/media/example.mp4&#34; poster=&#34;/img/default.avif&#34; &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<p><div class="solitude-tag video-container tag-video-embed tag-video-youtube"><iframe src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ" title="YouTube video player" loading="lazy" allowfullscreen></iframe></div>

<div class="solitude-tag video-container tag-video-embed tag-video-bilibili"><iframe src="https://player.bilibili.com/player.html?autoplay=0&bvid=BV1xx411c7mD" title="Bilibili video player" loading="lazy" allowfullscreen></iframe></div>

<div class="solitude-tag audio tag-audio"><span class="tag-media-icon" aria-hidden="true"><i class="fas fa-music"></i></span><audio controls preload="metadata" aria-label="本地示例音频"><source src="/media/shortcodes/t-rex-roar.mp3">Your browser does not support the audio tag.</audio></div>

<div class="solitude-tag video tag-video"><video controls preload="metadata" poster="/img/demo/cover-shortcodes-v2.webp"><source src="/media/shortcodes/flower.mp4">Your browser does not support the video tag.</video></div>
</p>
<h2 id="折叠隐藏与卡片">折叠、隐藏与卡片</h2>
<h3 id="折叠面板">折叠面板</h3>
<p><code>fold</code> 使用原生 <code>details</code> 结构，支持鼠标、触摸和键盘操作。添加 <code>open=true</code> 可让内容默认展开。</p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; fold title=&#34;展开内容&#34; open=true &gt;}}
折叠区域内支持 **Markdown**。
{{&lt; /fold &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<details class="solitude-tag tag-fold" ><summary class="tag-fold-summary"><span class="tag-fold-title">展开内容</span><span class="tag-fold-icon" aria-hidden="true"></span></summary><div class="tag-fold-content">折叠区域内支持 <strong>Markdown</strong>。</div></details>

<details class="solitude-tag tag-fold" open><summary class="tag-fold-summary"><span class="tag-fold-title">默认展开的长标题折叠面板，用于检查移动端省略和多行正文布局</span><span class="tag-fold-icon" aria-hidden="true"></span></summary><div class="tag-fold-content">展开状态同样使用柔和表面、清晰分隔和可见的键盘焦点，不依赖鼠标悬停。</div></details>

<h3 id="点击后显示">点击后显示</h3>
<p>三个隐藏组件的区别只在呈现方式：<code>hideInline</code> 适合一句话，<code>hideBlock</code> 适合独立内容块，<code>hideToggle</code> 适合带标题的可切换区域。</p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; hideInline text=&#34;查看答案&#34; &gt;}}答案{{&lt; /hideInline &gt;}}
{{&lt; hideBlock text=&#34;展开内容&#34; &gt;}}块级内容{{&lt; /hideBlock &gt;}}
{{&lt; hideToggle title=&#34;阅读更多&#34; &gt;}}可切换内容{{&lt; /hideToggle &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<p>哪个组件适合藏在一句话里？<span class="solitude-tag tag-hide tag-hide-inline"><button type="button" class="tag-hide-button" aria-expanded="false" aria-controls="tag-hide-content-33">查看答案</button><span id="tag-hide-content-33" class="tag-hide-content" hidden>hideInline</span></span>
</p>
<p><div class="solitude-tag tag-hide tag-hide-block"><button type="button" class="tag-hide-button" aria-expanded="false" aria-controls="tag-hide-content-34">点击展开</button><div id="tag-hide-content-34" class="tag-hide-content" hidden>块级隐藏内容可以包含 <strong>Markdown</strong>。</div></div>

<div class="solitude-tag tag-hide tag-hide-toggle"><button type="button" class="tag-hide-button" aria-expanded="false" aria-controls="tag-hide-content-35">可切换内容</button><div id="tag-hide-content-35" class="tag-hide-content" hidden>这里同样支持 Markdown，并保留明确的展开状态。</div></div>
</p>
<h3 id="内容卡片">内容卡片</h3>
<p><code>card</code> 用于推荐项目、文章或资源。封面是可选项，没有封面时会自动切换到纯内容布局。</p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; card title=&#34;Hugo 卡片&#34; url=&#34;https://gohugo.io/&#34;
    cover=&#34;/img/default.avif&#34; tag=&#34;资源&#34; star=&#34;5&#34; &gt;}}
卡片说明
{{&lt; /card &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<table>
	<thead>
			<tr>
					<th>参数</th>
					<th>说明</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><code>title</code></td>
					<td>卡片标题，也可使用 <code>name</code></td>
			</tr>
			<tr>
					<td><code>url</code></td>
					<td>可选的跳转地址</td>
			</tr>
			<tr>
					<td><code>cover</code></td>
					<td>可选封面，也可使用 <code>bg</code></td>
			</tr>
			<tr>
					<td><code>tag</code> / <code>star</code></td>
					<td>分类标签与评分</td>
			</tr>
			<tr>
					<td><code>width</code> / <code>height</code></td>
					<td>可选尺寸，建议优先沿用默认响应式宽度</td>
			</tr>
	</tbody>
</table>
<p>






<article
  class="solitude-tag card_box tag-card has-cover has-action"
  style="width:100%;"
>
  
    <div class="card_cover" aria-hidden="true" style="background-image:url('/img/demo/cover-shortcodes-v2.webp')"></div>
  
  <div class="card_body">
    <div class="card_top">
      
      <span class="card_tag">封面卡片</span>
    </div>
    <div class="card_mask card_info">
      <div class="card_content">
        <span class="card_title">Hugo 卡片</span>
        <span class="card_description">展示主题与重点内容</span>
      </div>
      <div class="card_footer">
        <div class="card_rating" aria-label="评分 5 / 5">
          <i class="fa-solid fa-star" aria-hidden="true"></i>
        </div>
        
          <a
            class="card_action"
            href="https://gohugo.io/"
            aria-label="查看详情：Hugo 卡片"
            target="_blank" rel="noopener noreferrer"
          ><i class="fa-solid fa-arrow-right" aria-hidden="true"></i></a>
        
      </div>
    </div>
  </div>
</article>








<article
  class="solitude-tag card_box tag-card no-cover has-action"
  style="width:100%;"
>
  
  <div class="card_body">
    <div class="card_top">
      
      <span class="card_tag">纯内容</span>
    </div>
    <div class="card_mask card_info">
      <div class="card_content">
        <span class="card_title">无封面卡片</span>
        <span class="card_description">简洁，也保持完整层级</span>
      </div>
      <div class="card_footer">
        <div class="card_rating" aria-label="评分 4 / 5">
          <i class="fa-solid fa-star" aria-hidden="true"></i>
        </div>
        
          <a
            class="card_action"
            href="https://gohugo.io/"
            aria-label="查看详情：无封面卡片"
            target="_blank" rel="noopener noreferrer"
          ><i class="fa-solid fa-arrow-right" aria-hidden="true"></i></a>
        
      </div>
    </div>
  </div>
</article>
</p>
<h2 id="数据与可视化">数据与可视化</h2>
<h3 id="mermaid-流程图">Mermaid 流程图</h3>
<p><code>mermaid</code> 直接接收 Mermaid 语法，适合流程图、时序图、状态图等结构化图形。</p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; mermaid &gt;}}
flowchart LR
  Hexo --&gt; Hugo
  Hugo --&gt; HTML
{{&lt; /mermaid &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<div class="solitude-tag tag-mermaid mermaid">flowchart LR
Hexo --&gt; Hugo
Hugo --&gt; HTML</div>

<h3 id="chartjs-图表">Chart.js 图表</h3>
<p><code>chartjs</code> 支持 <code>id</code>、<code>layout</code>、<code>width</code> 和 <code>description</code> 参数。正文必须是合法 JSON。</p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; chartjs description=&#34;三期构建趋势&#34; &gt;}}
{&#34;type&#34;:&#34;line&#34;,&#34;data&#34;:{&#34;labels&#34;:[&#34;一&#34;,&#34;二&#34;,&#34;三&#34;],&#34;datasets&#34;:[{&#34;label&#34;:&#34;趋势&#34;,&#34;data&#34;:[1,3,2]}]}}
{{&lt; /chartjs &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<div class="solitude-tag chartjs-container tag-chart " data-chartjs-id="chartjs-39" ><pre class="chartjs-src" hidden>{&#34;type&#34;:&#34;line&#34;,&#34;data&#34;:{&#34;labels&#34;:[&#34;一&#34;,&#34;二&#34;,&#34;三&#34;],&#34;datasets&#34;:[{&#34;label&#34;:&#34;趋势&#34;,&#34;data&#34;:[1,3,2]}]}}</pre><div class="chartjs-desc">三期构建趋势</div></div>

<h3 id="乐谱与动态文字">乐谱与动态文字</h3>
<p><code>score</code> 使用 ABC 记谱文本，<code>typeit</code> 用 <code>speed</code> 控制逐字显示速度。</p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; typeit speed=&#34;60&#34; &gt;}}TypeIt 动态文本{{&lt; /typeit &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<div class="solitude-tag abc-music-sheet tag-score" data-params="{}" aria-label="Music notation">X:1
T:Hugo migration
M:4/4
K:C
C D E F|G A B c|</div>

<div class="solitude-tag tag-typeit typeit"><span id="typeit-41" data-typeit data-speed="60">TypeIt 动态文本</span></div>

<h2 id="仓库与站点资源">仓库与站点资源</h2>
<h3 id="仓库卡片">仓库卡片</h3>
<p>四个仓库组件使用同样的 <code>repo=&quot;组织/仓库&quot;</code> 写法；自建 Gitea 还需要提供 <code>host</code>。仓库数据由浏览器访问对应平台 API，因此加载状态可能受网络或频率限制影响。</p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; github repo=&#34;gohugoio/hugo&#34; &gt;}}
{{&lt; gitlab repo=&#34;gitlab-org/gitlab&#34; &gt;}}
{{&lt; gitee repo=&#34;mirrors/hugo&#34; &gt;}}
{{&lt; gitea repo=&#34;go-gitea/gitea&#34; host=&#34;https://gitea.com&#34; &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<p><article class="solitude-tag repo-card tag-repo" data-repo-provider="github" data-repo-endpoint="https://api.github.com/repos/gohugoio/hugo" aria-busy="true"><div class="repo-card-header"><span class="repo-provider"><i class="fab fa-github" aria-hidden="true"></i>GitHub</span><img class="repo-language no-lightbox" alt="" loading="lazy" hidden></div><a class="repo-title" href="https://github.com/gohugoio/hugo" target="_blank" rel="noopener noreferrer">hugo</a><p class="repo-desc">正在读取仓库信息…</p><div class="repo-card-footer"><div class="repo-gist" aria-label="Repository statistics"><span><i class="fas fa-star" aria-hidden="true"></i><span class="repo-stars">—</span></span><span><i class="fas fa-code-branch" aria-hidden="true"></i><span class="repo-forks">—</span></span></div><span class="repo-status" role="status">加载中</span></div></article>


<article class="solitude-tag repo-card tag-repo" data-repo-provider="gitlab" data-repo-endpoint="https://gitlab.com/api/v4/projects/gitlab-org%2Fgitlab" aria-busy="true"><div class="repo-card-header"><span class="repo-provider"><i class="fab fa-gitlab" aria-hidden="true"></i>GitLab</span><img class="repo-language no-lightbox" alt="" loading="lazy" hidden></div><a class="repo-title" href="https://gitlab.com/gitlab-org/gitlab" target="_blank" rel="noopener noreferrer">gitlab</a><p class="repo-desc">正在读取仓库信息…</p><div class="repo-card-footer"><div class="repo-gist" aria-label="Repository statistics"><span><i class="fas fa-star" aria-hidden="true"></i><span class="repo-stars">—</span></span><span><i class="fas fa-code-branch" aria-hidden="true"></i><span class="repo-forks">—</span></span></div><span class="repo-status" role="status">加载中</span></div></article>


<article class="solitude-tag repo-card tag-repo" data-repo-provider="gitee" data-repo-endpoint="https://gitee.com/api/v5/repos/mirrors/hugo" aria-busy="true"><div class="repo-card-header"><span class="repo-provider"><i class="fab fa-git-alt" aria-hidden="true"></i>Gitee</span><img class="repo-language no-lightbox" alt="" loading="lazy" hidden></div><a class="repo-title" href="https://gitee.com/mirrors/hugo" target="_blank" rel="noopener noreferrer">hugo</a><p class="repo-desc">正在读取仓库信息…</p><div class="repo-card-footer"><div class="repo-gist" aria-label="Repository statistics"><span><i class="fas fa-star" aria-hidden="true"></i><span class="repo-stars">—</span></span><span><i class="fas fa-code-branch" aria-hidden="true"></i><span class="repo-forks">—</span></span></div><span class="repo-status" role="status">加载中</span></div></article>


<article class="solitude-tag repo-card tag-repo" data-repo-provider="gitea" data-repo-endpoint="https://gitea.com/api/v1/repos/go-gitea/gitea" aria-busy="true"><div class="repo-card-header"><span class="repo-provider"><i class="fab fa-git-alt" aria-hidden="true"></i>Gitea</span><img class="repo-language no-lightbox" alt="" loading="lazy" hidden></div><a class="repo-title" href="https://gitea.com/go-gitea/gitea" target="_blank" rel="noopener noreferrer">gitea</a><p class="repo-desc">正在读取仓库信息…</p><div class="repo-card-footer"><div class="repo-gist" aria-label="Repository statistics"><span><i class="fas fa-star" aria-hidden="true"></i><span class="repo-stars">—</span></span><span><i class="fas fa-code-branch" aria-hidden="true"></i><span class="repo-forks">—</span></span></div><span class="repo-status" role="status">加载中</span></div></article>

</p>
<h3 id="友链列表">友链列表</h3>
<p><code>flink</code> 的正文是 YAML 数据。一个组件可以包含多个分组，每个分组下可以继续放置多个站点。</p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; flink &gt;}}
- class_name: 官方资源
  class_desc: Hugo 官方网站
  link_list:
    - name: Hugo
      link: https://gohugo.io/
      avatar: https://gohugo.io/images/hugo-logo-wide.svg
      descr: 世界上最快的网站构建框架
{{&lt; /flink &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>

<div class="solitude-tag flink tag-flink">
  
    <div class="flink-name">官方资源</div>
    <div class="flink-desc">Hugo 官方网站</div>
    <div class="flink-list">
      
        <div class="flink-list-item">
          <a class="cf-friends-link" href="https://gohugo.io/" title="Hugo" target="_blank" rel="noopener noreferrer">
            <img class="flink-avatar cf-friends-avatar no-lightbox" src="https://gohugo.io/images/hugo-logo-wide.svg" alt="" loading="lazy">
            <div class="flink-item-info">
              <span class="flink-item-name cf-friends-name">Hugo</span>
              <span class="flink-item-desc" title="世界上最快的网站构建框架">世界上最快的网站构建框架</span>
            </div>
          </a>
        </div>
      
    </div>
  
</div>

<h2 id="布局与内容集合">布局与内容集合</h2>
<h3 id="图库与图库分组">图库与图库分组</h3>
<p><code>gallery</code> 负责瀑布流容器，内部使用 <code>galleryItem</code> 放置不同宽高的图片；<code>columns</code> 可指定桌面端列数。<code>galleryGroup</code> 则用于创建带封面、说明和链接的图库入口。</p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; gallery columns=&#34;2&#34; &gt;}}
{{&lt; galleryItem src=&#34;/img/default.avif&#34; alt=&#34;Gallery 1&#34; &gt;}}
{{&lt; galleryItem src=&#34;/img/default.avif&#34; alt=&#34;Gallery 2&#34; &gt;}}
{{&lt; galleryItem src=&#34;/img/default.avif&#34; alt=&#34;Gallery 3&#34; &gt;}}
{{&lt; galleryItem src=&#34;/img/default.avif&#34; alt=&#34;Gallery 4&#34; &gt;}}
{{&lt; /gallery &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<div class="solitude-tag tag-gallery gallery-container" data-columns="2">
<div class="solitude-tag tag-gallery-item gallery-item"><img class="nolazyload" src="/img/demo/about/music-listening-v2.webp" alt="音乐主题示例图片" loading="lazy"></div>

<div class="solitude-tag tag-gallery-item gallery-item"><img class="nolazyload" src="/img/demo/generated/solitude-crystal-orbit.png" alt="Solitude 水晶轨道" loading="lazy"></div>

<div class="solitude-tag tag-gallery-item gallery-item"><img class="nolazyload" src="/img/demo/about/personality-enfj-v2.png" alt="ENFJ 性格主题图片" loading="lazy"></div>

<div class="solitude-tag tag-gallery-item gallery-item"><img class="nolazyload" src="/img/demo/about/personal-photo-selfie-wide.png" alt="宽幅生活照片" loading="lazy"></div>

<div class="solitude-tag tag-gallery-item gallery-item"><img class="nolazyload" src="/img/demo/about/game-apex-v1.webp" alt="游戏主题示例图片" loading="lazy"></div>

</div>

<figure class="solitude-tag tag-gallery-group gallery-group"><img class="gallery-group-img no-lightbox" src="/img/demo/cover-shortcodes-v2.webp" alt="Group Image Gallery"><figcaption><div class="gallery-group-name">图库分组</div><p>用于聚合同一主题下的一组图片。</p><a href="/"></a></figcaption></figure>

<h3 id="标签页">标签页</h3>
<p><code>tabs</code> 作为容器，每个 <code>tab</code> 提供标题和内容。为同一篇文章里的每组标签页设置唯一 <code>id</code>，可以避免状态互相影响。</p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; tabs id=&#34;demo-tabs&#34; &gt;}}
{{&lt; tab title=&#34;第一个&#34; &gt;}}第一个标签页{{&lt; /tab &gt;}}
{{&lt; tab title=&#34;第二个&#34; &gt;}}第二个标签页{{&lt; /tab &gt;}}
{{&lt; /tabs &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<div class="solitude-tag tag-tabs tabs" id="demo-tabs" data-solitude-tabs><div class="tab-contents">
<section class="tab-item-content active" id="tab-0" data-tab-title="第一个" data-tab-icon="">第一个标签页</section>

<section class="tab-item-content" id="tab-1" data-tab-title="第二个" data-tab-icon="">第二个标签页</section>

<section class="tab-item-content" id="tab-2" data-tab-title="用于验证横向滚动的较长标签标题" data-tab-icon="">窄屏下标签导航可以横向滚动，并保留完整的键盘操作。</section>

</div></div>

<h3 id="时间线">时间线</h3>
<p>时间线由 <code>timeline</code> 和一个或多个 <code>timenode</code> 组成。时间与标题应保持简短，详细说明放在节点正文中。</p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; timeline title=&#34;迁移时间线&#34; &gt;}}
{{&lt; timenode time=&#34;2026-08-21&#34; title=&#34;Hugo 版本&#34; &gt;}}
完成原生主题迁移。
{{&lt; /timenode &gt;}}
{{&lt; /timeline &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<div class="solitude-tag timeline tag-timeline "><div class="timeline-item headline"><div class="timeline-item-title"><div class="item-circle">迁移时间线</div></div></div>
<div class="timeline-item solitude-tag timenode tag-timenode"><div class="timeline-item-title meta"><div class="item-circle"><p>2026-08-21</p></div></div><div class="timeline-item-content body"><strong>Hugo 版本</strong>完成原生主题迁移。</div></div>

<div class="timeline-item solitude-tag timenode tag-timenode"><div class="timeline-item-title meta"><div class="item-circle"><p>2026-08-25</p></div></div><div class="timeline-item-content body"><strong>文档重组</strong>补充写法、参数与真实效果，让组件更容易检索和复用。</div></div>

</div>

<h3 id="系列文章与视频集合">系列文章与视频集合</h3>
<p><code>series</code> 会读取文章 Front Matter 中同名的 <code>series</code>，并按日期生成文章列表。<code>videos</code> 则把正文中的每行地址渲染为一个原生视频播放器。</p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; series name=&#34;官方示例&#34; &gt;}}

{{&lt; videos col=&#34;2&#34; &gt;}}
/media/shortcodes/flower.mp4
/media/shortcodes/friday.mp4
{{&lt; /videos &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<ol class="solitude-tag series-items tag-series"><li><a href="/p/shortcode-showcase.html" title="Solitude Hugo Shortcode 使用指南">Solitude Hugo Shortcode 使用指南</a></li></ol>

<div class="solitude-tag videos tag-videos" data-columns="2"><video controls preload="metadata"><source src="/media/shortcodes/flower.mp4"></video><video controls preload="metadata"><source src="/media/shortcodes/friday.mp4"></video></div>

<h3 id="聊天记录">聊天记录</h3>
<p><code>chat</code> 使用简洁的行文本语法展示对话：<code>{.名称}</code> 切换到右侧发送者，<code>{名称}</code> 切换到左侧发送者；随后直接写消息内容，连续内容用 <code>\\</code> 换行；<code>{:内容}</code> 是居中的系统提示（包括时间和撤回提示）。</p>
<figure class="code-block" data-code-block data-language="go-html-template">
  <figcaption class="code-block__toolbar">
    <span class="code-block__language">go-html-template</span>
      <button class="code-block__copy" type="button" data-code-copy>复制</button>
  </figcaption>
  <div class="code-block__viewport">
    <pre class="code-block__fallback" tabindex="0"><code class="language-go-html-template">{{&lt; chat &gt;}}
{:2024-11-09 23:39:30}
{.也许}
{.我们可以聊聊天}
{~克喵}
{.我还可以有名字}
{!克喵撤回了一条消息}
{用户 1}
{有趣}
{我学到了。}
{{&lt; /chat &gt;}}</code></pre>
  </div>
  <button class="code-block__expand" type="button" data-code-expand hidden>展开全部</button>
</figure>
<div class="solitude-tag chat" role="log" aria-label="聊天记录"><div class="chat-system">2024-11-09 23:39:30</div><div class="chat-body chat-myself">也许</div><div class="chat-body chat-myself">我们可以聊聊天</div><div class="chat-caption chat-myself">纸鹿</div><div class="chat-body chat-myself">我还可以有名字</div><div class="chat-system">纸鹿撤回了一条消息</div><div class="chat-caption">用户 1</div><div class="chat-body">有趣<br></div><div class="chat-body">我学到了。</div></div>

<ol>
<li>先用标准 Markdown 完成正文，只在标准语法无法表达时引入 shortcode。</li>
<li>一个组件解决一种内容关系，避免为了装饰而层层嵌套。</li>
<li>图片和媒体补全替代文本或标题，并优先选择稳定、可控的资源地址。</li>
<li>发布前执行完整构建，再在桌面端与移动端检查长标题、代码块、表格和交互组件。</li>
</ol>




  

<aside class="solitude-tag note success modern no-icon has-icon">
  <span class="note-icon" aria-hidden="true"><i class="fas fa-circle-check"></i></span>
  <div class="note-content">如果你正在迁移 Hexo 文章，可以先按组件名称替换旧标签，再对照本文逐项调整参数。这样比一次性改写整篇文章更容易定位构建错误。</div>
</aside>

]]></content><category term="内容组件" scheme="category"/><category term="官方示例" scheme="series"/><category term="Shortcode" scheme="tag"/><category term="Markdown" scheme="tag"/><category term="Hugo" scheme="tag"/></entry></feed>