<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Shortcodes on Liquid Stack</title><link>https://liquid-stack.pages.dev/zh/tags/shortcodes/</link><description>Recent content in Shortcodes on Liquid Stack</description><generator>Hugo -- gohugo.io</generator><language>zh-Hans</language><copyright>我的博客</copyright><lastBuildDate>Fri, 24 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://liquid-stack.pages.dev/zh/tags/shortcodes/index.xml" rel="self" type="application/rss+xml"/><item><title>Shortcodes 使用指南</title><link>https://liquid-stack.pages.dev/zh/p/using-shortcodes/</link><pubDate>Fri, 24 Jul 2026 00:00:00 +0000</pubDate><guid>https://liquid-stack.pages.dev/zh/p/using-shortcodes/</guid><description>&lt;p&gt;Shortcodes 是 Hugo 在 Markdown 中插入可复用结构的方式，适合提示框、嵌入内容和重复版式。&lt;/p&gt;
&lt;h2 id="先看现有-shortcodes"&gt;先看现有 Shortcodes
&lt;/h2&gt;&lt;p&gt;浏览 &lt;code&gt;layouts/shortcodes/&lt;/code&gt;，了解主题已经提供的能力。优先复用现有组件，避免为一次性排版复制大段 HTML。&lt;/p&gt;
&lt;h2 id="什么时候使用"&gt;什么时候使用
&lt;/h2&gt;&lt;p&gt;当一段内容需要固定结构、会在多篇文章中重复，或必须渲染为 HTML 时，Shortcode 比手写重复代码更合适。普通段落、列表和代码块仍然直接使用 Markdown。&lt;/p&gt;
&lt;h2 id="测试渲染结果"&gt;测试渲染结果
&lt;/h2&gt;&lt;p&gt;加入 Shortcode 后用本地预览检查桌面与移动端。若它依赖图片、视频或外部链接，也要检查资源路径与加载失败时的表现。&lt;/p&gt;</description></item></channel></rss>