<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Rocky‘s Blog - Template</title>
    <subtitle>月更 技术博客 CXX优先</subtitle>
    <link rel="self" type="application/atom+xml" href="https://suchaharcan.github.io/tags/template/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://suchaharcan.github.io/"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-06-21T00:00:00+00:00</updated>
    <id>https://suchaharcan.github.io/tags/template/atom.xml</id>
    <entry xml:lang="en">
        <title>Zola 模板开发要点与 Markdown 语法速查</title>
        <published>2026-06-21T00:00:00+00:00</published>
        <updated>2026-06-21T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Suchaharcan
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://suchaharcan.github.io/03Share_blog/zola-template-markdown-guide/"/>
        <id>https://suchaharcan.github.io/03Share_blog/zola-template-markdown-guide/</id>
        
        <content type="html" xml:base="https://suchaharcan.github.io/03Share_blog/zola-template-markdown-guide/">&lt;p&gt;本文分两部分：&lt;strong&gt;Zola 模板&lt;&#x2F;strong&gt;的核心机制（结合 &lt;a class=&quot;external&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.getzola.org&#x2F;documentation&#x2F;&quot;&gt;Zola 官方文档&lt;&#x2F;a&gt; 与本站实践），以及参考 &lt;a class=&quot;external&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;daudix&#x2F;daudix.one&#x2F;tree&#x2F;main&#x2F;content&quot;&gt;daudix.one&#x2F;content&lt;&#x2F;a&gt; 整理的 &lt;strong&gt;Markdown &#x2F; Shortcode&lt;&#x2F;strong&gt; 写法示例。本站使用 &lt;a class=&quot;external&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;SuchaharCan&#x2F;SuchaharCan.github.io&quot;&gt;ametrine&lt;&#x2F;a&gt; 主题（源自 Duckquill 系），示例均可在本仓库直接复现。&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;yi-zola-mo-ban-mu-lu-yu-you-xian-ji&quot;&gt;一、Zola 模板：目录与优先级&lt;&#x2F;h2&gt;
&lt;p&gt;Zola 的模板引擎是 &lt;strong&gt;Tera&lt;&#x2F;strong&gt;（语法接近 Jinja2 &#x2F; Liquid）。站点根目录结构：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;├── config.toml          # 全局配置&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;├── content&#x2F;             # Markdown 内容（按 section 组织）&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;├── templates&#x2F;           # 站点级模板（优先级高于 theme）&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;├── static&#x2F;              # 原样拷贝的静态资源&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;├── sass&#x2F;                # 可选，编译为 CSS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;└── themes&#x2F;ametrine&#x2F;     # 主题（可被 templates&#x2F; 同名文件覆盖）&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;覆盖规则&lt;&#x2F;strong&gt;：&lt;code&gt;templates&#x2F;&lt;&#x2F;code&gt; 下与主题同路径的文件会&lt;strong&gt;完全替换&lt;&#x2F;strong&gt;主题模板。例如：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;html&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{# templates&#x2F;article.html — 只改文章页，不动 theme #}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% extends &amp;quot;ametrine&#x2F;templates&#x2F;article.html&amp;quot; %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% block content %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#123;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#123;&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; super() &lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#125;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#125;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{# 追加滚动条、热力图等 #}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% endblock %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;blockquote&gt;
&lt;p&gt;原则：&lt;strong&gt;不改 &lt;code&gt;themes&#x2F;&lt;&#x2F;code&gt; 内文件&lt;&#x2F;strong&gt;，在 &lt;code&gt;templates&#x2F;&lt;&#x2F;code&gt; 里 extends + block 扩展。&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;er-mo-ban-lei-xing-yu-front-matter-bang-ding&quot;&gt;二、模板类型与 front matter 绑定&lt;&#x2F;h2&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;模板文件&lt;&#x2F;th&gt;&lt;th&gt;用途&lt;&#x2F;th&gt;&lt;th&gt;典型绑定方式&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;base.html&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;全站骨架（&lt;code&gt;&amp;lt;html&amp;gt;&lt;&#x2F;code&gt;、header、sidebar、footer）&lt;&#x2F;td&gt;&lt;td&gt;被其他模板 extends&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;section.html&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Section 索引页（&lt;code&gt;_index.md&lt;&#x2F;code&gt;）&lt;&#x2F;td&gt;&lt;td&gt;section 默认模板&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;page.html&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;独立 Page&lt;&#x2F;td&gt;&lt;td&gt;page 默认模板&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;article.html&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;单篇文章&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;page_template = &quot;article.html&quot;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;article_list.html&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;文章列表 + 分页&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;template = &quot;article_list.html&quot;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;自定义如 &lt;code&gt;archive.html&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;归档页等特殊布局&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;_index.md&lt;&#x2F;code&gt; 中 &lt;code&gt;template = &quot;archive.html&quot;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;Section 的 &lt;code&gt;_index.md&lt;&#x2F;code&gt; 示例（参考 daudix 的 blog&#x2F;_index.md）：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;toml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-invalid&quot;&gt;+++&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;title&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;效率-工作流&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;sort_by&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;date&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;template&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;article_list.html&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-comment&quot;&gt;      #&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment&quot;&gt; 列表页模板&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;page_template&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;article.html&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-comment&quot;&gt;      #&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment&quot;&gt; 该 section 下每篇文章的模板&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;paginate_by&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric&quot;&gt; 10&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;generate_feeds&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-language&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-section&quot;&gt;extra&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;no_header&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-language&quot;&gt; true&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-comment&quot;&gt;                    #&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment&quot;&gt; 传给模板，控制是否渲染 h1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-invalid&quot;&gt;+++&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;san-tera-he-xin-yu-fa&quot;&gt;三、Tera 核心语法&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;3-1-ji-cheng-yu-kuai-extends-block-super&quot;&gt;3.1 继承与块（extends &#x2F; block &#x2F; super）&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;html&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% extends &amp;quot;ametrine&#x2F;templates&#x2F;base.html&amp;quot; %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% block content %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-tag&quot;&gt;  &amp;lt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag&quot;&gt;main&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#123;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#123;&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; section.content | safe &lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#125;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#125;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag&quot;&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-tag&quot;&gt;main&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-tag&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% endblock content %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;在子模板中调用父块内容：&lt;code&gt;super()&lt;&#x2F;code&gt; 过滤器（写作 &lt;code&gt;&amp;amp;#123;&amp;amp;#123; super() &amp;amp;#125;&amp;amp;#125;&lt;&#x2F;code&gt;）（本站 &lt;code&gt;article.html&lt;&#x2F;code&gt; 即此模式）。&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-2-yin-ru-pian-duan-include-import&quot;&gt;3.2 引入片段（include &#x2F; import）&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;html&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% include &amp;quot;partials&#x2F;heatmap_component.html&amp;quot; %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% import &amp;quot;macros&#x2F;macros.html&amp;quot; as macros %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#123;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#123;&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; macros::translate(key=&amp;quot;skip_to_content&amp;quot;, default=&amp;quot;Skip&amp;quot;, language_strings=language_strings) &lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#125;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#125;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-3-chang-yong-bian-liang-gou-jian-shi-zhu-ru&quot;&gt;3.3 常用变量（构建时注入）&lt;&#x2F;h3&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;变量&lt;&#x2F;th&gt;&lt;th&gt;含义&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;config&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;zola.toml&lt;&#x2F;code&gt; 全文，含 &lt;code&gt;config.extra.*&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;page&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;当前页面（title、date、content、permalink、taxonomies…）&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;section&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;当前 section（pages 列表、title…）&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;lang&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;当前语言&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;current_url&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;当前页面 URL&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h3 id=&quot;3-4-chang-yong-han-shu-yu-guo-lu-qi&quot;&gt;3.4 常用函数与过滤器&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;html&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{# 跨 section 拉取文章 — archive.html 中的用法 #}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% set sec = get_section(path=&amp;quot;03Share_blog&#x2F;_index.md&amp;quot;) %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% set posts = sec.pages | sort(attribute=&amp;quot;date&amp;quot;) | reverse %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{# 加载外部数据 #}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% set strings = load_data(path=&amp;quot;i18n&#x2F;en.toml&amp;quot;) %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{# 过滤器链 #}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#123;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#123;&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; page.date | date(format=&amp;quot;%Y-%m-%d&amp;quot;) &lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#125;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#125;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#123;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#123;&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; heat_data | json_encode() | safe &lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#125;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#125;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% for year, posts in all_posts | group_by(attribute=&amp;quot;year&amp;quot;) %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-5-tu-pian-chu-li-build-shi&quot;&gt;3.5 图片处理（build 时）&lt;&#x2F;h3&gt;
&lt;p&gt;主题 &lt;code&gt;base.html&lt;&#x2F;code&gt; 中常见写法：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;html&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% set blurnail = resize_image(path=page.colocated_path ~ banner, width=4, height=2, op=&amp;quot;fill&amp;quot;, format=&amp;quot;webp&amp;quot;) %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;code&gt;page.colocated_path&lt;&#x2F;code&gt; 指向与 &lt;code&gt;index.md&lt;&#x2F;code&gt; 同目录，便于 co-located 资源。&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;si-shortcode-duan-dai-ma&quot;&gt;四、Shortcode（短代码）&lt;&#x2F;h2&gt;
&lt;p&gt;放在 &lt;code&gt;templates&#x2F;shortcodes&#x2F;*.html&lt;&#x2F;code&gt;，Markdown 中写作：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% shortcode_name(param=&amp;quot;value&amp;quot;) %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;内容&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% end %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;或自闭合：&lt;code&gt;{%% icon(name=&quot;github&quot;) %%}&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;在 Markdown 正文中展示 shortcode 字面量时，用 &lt;code&gt;{%%&lt;&#x2F;code&gt; &#x2F; &lt;code&gt;%%}&lt;&#x2F;code&gt; 转义，避免被 Zola 当作 shortcode 执行。&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;&lt;strong&gt;查找顺序&lt;&#x2F;strong&gt;：站点 &lt;code&gt;templates&#x2F;shortcodes&#x2F;&lt;&#x2F;code&gt; → 主题 &lt;code&gt;themes&#x2F;ametrine&#x2F;templates&#x2F;shortcodes&#x2F;&lt;&#x2F;code&gt;。&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;wu-markdown-yu-fa-shi-li&quot;&gt;五、Markdown 语法示例&lt;&#x2F;h2&gt;
&lt;p&gt;以下示例整理自 &lt;a class=&quot;external&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;daudix&#x2F;daudix.one&#x2F;tree&#x2F;main&#x2F;content&quot;&gt;daudix.one&lt;&#x2F;a&gt; 的常见写法，并标注 ametrine 支持情况。&lt;&#x2F;p&gt;
&lt;h3 id=&quot;5-1-front-matter-toml&quot;&gt;5.1 Front matter（TOML）&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;toml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-invalid&quot;&gt;+++&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;title&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;文章标题&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;description&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;摘要，用于列表卡片与 SEO&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;date&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; 2026-06-22&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;updated&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; 2026-06-22&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;draft&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-language&quot;&gt; true&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-comment&quot;&gt;                        #&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment&quot;&gt; 草稿，需 zola build --drafts&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-section&quot;&gt;taxonomies&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;tags&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; [&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;Zola&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;,&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;Devlog&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;categories&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; [&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;Featured&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-section&quot;&gt;extra&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;toc&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-language&quot;&gt; true&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-comment&quot;&gt;                          #&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment&quot;&gt; 目录&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;accent_color&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; [&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;hsl(254 44% 55%)&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;,&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;hsl(290 20% 71%)&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-comment&quot;&gt;  #&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment&quot;&gt; 浅色&#x2F;深色强调色&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;banner&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;banner.webp&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-comment&quot;&gt;              #&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment&quot;&gt; 与 index.md 同目录的横幅图&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-section&quot;&gt;extra&lt;&#x2F;span&gt;&lt;span class=&quot;z-source&quot;&gt;.&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-section&quot;&gt;fediverse&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;host&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;vmst.io&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;user&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;username&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;id&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;113295812044964246&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-comment&quot;&gt;           #&lt;&#x2F;span&gt;&lt;span class=&quot;z-comment&quot;&gt; 启用 Fediverse 评论&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-invalid&quot;&gt;+++&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;5-2-nei-bu-lian-jie&quot;&gt;5.2 内部链接&lt;&#x2F;h3&gt;
&lt;p&gt;Zola 专用 &lt;code&gt;@&#x2F;&lt;&#x2F;code&gt; 前缀，构建时解析为正确 permalink：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;详见 &lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-other z-link z-title&quot;&gt;网站重写 Devlog&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-markup z-underline z-link&quot;&gt;@&#x2F;blog&#x2F;2023-08-13-site-and-blog-devlog&#x2F;index.md&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;脚注式引用：&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-other z-link z-title&quot;&gt;为什么叫这个名字？&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-markup z-underline z-link&quot;&gt;@&#x2F;03Share_blog&#x2F;2025-10-04-Zola-build-deploy-circle&#x2F;index.md&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;5-3-biao-ti-yu-mu-lu&quot;&gt;5.3 标题与目录&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;##&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-section&quot;&gt; 二级标题        → 自动生成锚点&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;###&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-section&quot;&gt; 三级标题&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-other z-link z-title&quot;&gt;extra&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; toc = true  → 文章顶部自动生成目录&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;5-4-wen-ben-yang-shi&quot;&gt;5.4 文本样式&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;**&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt;粗体&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;**&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;  *&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt;斜体&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;*&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;  ~~&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt;删除线&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;~~&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;  `&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt;行内代码&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; 引用块&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; 可以多行&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;上标脚注引用&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-other z-link z-title&quot;&gt;^1&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt;，文末定义脚注内容。&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-other z-link z-title&quot;&gt;^1&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt;: &lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-other z-link z-title&quot;&gt;Dependency hell&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-markup z-underline z-link&quot;&gt;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Dependency_hell&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;5-5-shu-yu-kuai-daudix-feng-ge&quot;&gt;5.5 术语块（daudix 风格）&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt; &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;**&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt;SSG：&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;**&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; Static Site Generator，将 Markdown 转为静态 HTML 的构建工具。&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt; &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;5-6-biao-ge&quot;&gt;5.6 表格&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;|&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; 页面&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; |&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; 旧仓库&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; |&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; 新仓库&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;|&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; ----&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; |&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; ------&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; |&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; ------&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;|&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; Home&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; |&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; pages&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;  |&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; website&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;|&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; Blog&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; |&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; blog-source&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; |&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; website&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;5-7-dai-ma-kuai&quot;&gt;5.7 代码块&lt;&#x2F;h3&gt;
&lt;p&gt;支持语法高亮（本站 &lt;code&gt;zola.toml&lt;&#x2F;code&gt; 配置 monokai-pro 主题）：&lt;&#x2F;p&gt;
&lt;p&gt;TOML 配置示例：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;toml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-section&quot;&gt;markdown&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;smart_punctuation&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-language&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable z-other&quot;&gt;github_alerts&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; =&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-language&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;HTML 模板示例（Tera 语法，写作时用 &lt;code&gt;{%%&lt;&#x2F;code&gt; &#x2F; &lt;code&gt;%%}&lt;&#x2F;code&gt; 转义可在正文中展示字面量）：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;html&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% extends &amp;quot;base.html&amp;quot; %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% block content %%}&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#123;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#123;&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; page.content | safe &lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#125;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt;#125;&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt;{%% endblock %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Shell 命令：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;zola&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; build&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt;-force&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;zola&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; serve&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt;-drafts&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;5-8-github-alerts-github-alerts-true-shi&quot;&gt;5.8 GitHub Alerts（&lt;code&gt;github_alerts = true&lt;&#x2F;code&gt; 时）&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; [&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-other z-link z-title&quot;&gt;!NOTE&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; 这是提示框，无需手写 shortcode。&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; [&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-other z-link z-title&quot;&gt;!WARNING&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; 警告信息。&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; [&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-other z-link z-title&quot;&gt;!TIP&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-text&quot;&gt; 小技巧。&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;等价的 shortcode 写法（ametrine &lt;code&gt;alert.html&lt;&#x2F;code&gt;）：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% alert(title=&amp;quot;Note&amp;quot;, icon=&amp;quot;info&amp;quot;, color=&amp;quot;note&amp;quot;) %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;自定义图标与颜色的提示块。&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% end %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;5-9-tu-pian&quot;&gt;5.9 图片&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;普通 Markdown 图片&lt;&#x2F;strong&gt;（与 &lt;code&gt;index.md&lt;&#x2F;code&gt; 同目录放 &lt;code&gt;photo.png&lt;&#x2F;code&gt;）：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;![&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-other z-link z-description&quot;&gt;Obsidian 附件目录配置&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-markup z-underline z-link&quot;&gt;obsidian-attachments.png&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;daudix 技巧：URL 锚点控制样式&lt;&#x2F;strong&gt;（无需 Kramdown 的 &lt;code&gt;{: .class}&lt;&#x2F;code&gt;）：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;![&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-other z-link z-description&quot;&gt;透明背景 PNG&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-markup z-underline z-link&quot;&gt;context-menu.png#transparent&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;![&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-other z-link z-description&quot;&gt;像素风渲染&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-markup z-underline z-link&quot;&gt;sprite.png#pixels&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;![&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-other z-link z-description&quot;&gt;无 hover 效果&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;(&lt;&#x2F;span&gt;&lt;span class=&quot;z-markup z-underline z-link&quot;&gt;logo.png#transparent#no-hover&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;对应 SCSS 选择器示例：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;scss&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag&quot;&gt;img&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-other z-attribute-name&quot;&gt;src&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt;*=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source&quot;&gt;#transparent&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; {&lt;&#x2F;span&gt;&lt;span class=&quot;z-support z-type z-property-name&quot;&gt; background&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;:&lt;&#x2F;span&gt;&lt;span class=&quot;z-support z-constant&quot;&gt; transparent&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-terminator&quot;&gt;;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag&quot;&gt;img&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-other z-attribute-name&quot;&gt;src&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt;*=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source&quot;&gt;#pixels&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;]&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;       {&lt;&#x2F;span&gt;&lt;span class=&quot;z-support z-type z-property-name&quot;&gt; image-rendering&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;:&lt;&#x2F;span&gt;&lt;span class=&quot;z-support z-constant&quot;&gt; pixelated&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-terminator&quot;&gt;;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Shortcode 图片&lt;&#x2F;strong&gt;（更多参数）：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% image(url=&amp;quot;banner.webp&amp;quot;, alt=&amp;quot;横幅&amp;quot;, full=true, drop_shadow=true) %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;5-10-ascii-crt-yi-shu-zi&quot;&gt;5.10 ASCII &#x2F; CRT 艺术字&lt;&#x2F;h3&gt;
&lt;p&gt;Section 首页与 daudix blog 首页常用的 &lt;code&gt;crt&lt;&#x2F;code&gt; shortcode：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% crt(label=&amp;quot;ASCII 插画：左侧卡车，中间房屋，右侧火箭&amp;quot;) %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;         *                 *&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt;  *&lt;&#x2F;span&gt;&lt;span class=&quot;z-markup z-raw&quot;&gt;              _________##&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-markup z-raw&quot;&gt;                @\\\\\\\\\##&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation&quot;&gt; *&lt;&#x2F;span&gt;&lt;span class=&quot;z-markup z-raw&quot;&gt;             @@@\\\\\\\\##\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% end %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;渲染为 &lt;code&gt;.crt&lt;&#x2F;code&gt; 样式的 &lt;code&gt;&amp;lt;pre&amp;gt;&lt;&#x2F;code&gt;，带 CRT 扫描线效果。&lt;&#x2F;p&gt;
&lt;h3 id=&quot;5-11-qian-ru-mei-ti&quot;&gt;5.11 嵌入媒体&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;YouTube&lt;&#x2F;strong&gt;（隐私增强域名，需 CSP 允许 &lt;code&gt;youtube-nocookie.com&lt;&#x2F;code&gt;）：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% youtube(id=&amp;quot;dQw4w9WgXcQ&amp;quot;) %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% youtube(id=&amp;quot;abc123&amp;quot;, start=30, autoplay=false) %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Vimeo &#x2F; 本地视频 &#x2F; 音频&lt;&#x2F;strong&gt;：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% vimeo(id=&amp;quot;123456789&amp;quot;) %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% video(url=&amp;quot;clip.mp4&amp;quot;, controls=true, loop=true, muted=true) %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% audio(url=&amp;quot;podcast.mp3&amp;quot;, name=&amp;quot;播客片段&amp;quot;) %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;5-12-tu-biao&quot;&gt;5.12 图标&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% icon(name=&amp;quot;github&amp;quot;) %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% icon(name=&amp;quot;terminal&amp;quot;, inline=true) %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;图标来自 Phosphor SVG，主题 &lt;code&gt;icons&#x2F;phosphor&#x2F;&lt;&#x2F;code&gt; 目录。&lt;&#x2F;p&gt;
&lt;h3 id=&quot;5-13-emoji-shortcode&quot;&gt;5.13 Emoji shortcode&lt;&#x2F;h3&gt;
&lt;p&gt;当 &lt;code&gt;render_emoji = false&lt;&#x2F;code&gt; 时，可用 shortcode 插入：&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-text&quot;&gt;{%% emoji(name=&amp;quot;🦀&amp;quot;) %%}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;5-14-ben-zhan-zi-ding-yi-shortcode&quot;&gt;5.14 本站自定义 shortcode&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;code&gt;templates&#x2F;shortcodes&#x2F;&lt;&#x2F;code&gt; 下还有：&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Shortcode&lt;&#x2F;th&gt;&lt;th&gt;用途&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;badges&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;徽章展示&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;polaroid&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;宝丽来相框图片&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;window&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;窗口 UI 框&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;masonry&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;瀑布流图片墙&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;todo&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;TODO 列表&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;now_playing&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;正在播放&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;online&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;在线状态&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;用法均为 &lt;code&gt;{%% name(参数) %%}...{%% end %%}&lt;&#x2F;code&gt;，具体参数见对应 html 文件。&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;liu-mo-ban-kai-fa-zhu-yi-dian-qing-dan&quot;&gt;六、模板开发注意点清单&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;不要改 theme&lt;&#x2F;strong&gt;：在 &lt;code&gt;templates&#x2F;&lt;&#x2F;code&gt; 覆盖或 extends。&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;safe&lt;&#x2F;code&gt; 过滤器&lt;&#x2F;strong&gt;：&lt;code&gt;page.content&lt;&#x2F;code&gt;、&lt;code&gt;| markdown | safe&lt;&#x2F;code&gt; 输出已解析 HTML；纯文本勿加 safe。&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Section 路径&lt;&#x2F;strong&gt;：&lt;code&gt;get_section(path=&quot;03Share_blog&#x2F;_index.md&quot;)&lt;&#x2F;code&gt; 路径相对 &lt;code&gt;content&#x2F;&lt;&#x2F;code&gt;。&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;全局变量&lt;&#x2F;strong&gt;：&lt;code&gt;{%% set_global x = ... %%}&lt;&#x2F;code&gt; 在 loop 内累加时使用。&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;CSP&lt;&#x2F;strong&gt;：嵌入 iframe &#x2F; 外部脚本需在 &lt;code&gt;zola.toml&lt;&#x2F;code&gt; 的 &lt;code&gt;[extra.csp]&lt;&#x2F;code&gt; 声明域名。&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;静态资源&lt;&#x2F;strong&gt;：JS&#x2F;CSS 放 &lt;code&gt;static&#x2F;&lt;&#x2F;code&gt;，引用 &lt;code&gt;&#x2F;js&#x2F;xxx.js&lt;&#x2F;code&gt;；Sass 放 &lt;code&gt;sass&#x2F;&lt;&#x2F;code&gt; 由 Zola 编译。&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Co-located 资源&lt;&#x2F;strong&gt;：图片与 &lt;code&gt;index.md&lt;&#x2F;code&gt; 同目录，构建后 permalink 同路径，便于搬运整文件夹。&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;分页&lt;&#x2F;strong&gt;：&lt;code&gt;paginate_by = 10&lt;&#x2F;code&gt; + 模板中使用 &lt;code&gt;section.pages&lt;&#x2F;code&gt; 与 paginator partial。&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;多语言&lt;&#x2F;strong&gt;：&lt;code&gt;content&#x2F;&lt;&#x2F;code&gt; 下按语言分子目录，配合 &lt;code&gt;i18n&#x2F;*.toml&lt;&#x2F;code&gt;。&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;调试&lt;&#x2F;strong&gt;：&lt;code&gt;zola build --force&lt;&#x2F;code&gt; 强制重建；&lt;code&gt;zola serve --open&lt;&#x2F;code&gt; 热重载预览。&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;qi-ben-zhan-shi-jian-dui-zhao&quot;&gt;七、本站实践对照&lt;&#x2F;h2&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;功能&lt;&#x2F;th&gt;&lt;th&gt;实现位置&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;文章页扩展（热力图、滚动条）&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;templates&#x2F;article.html&lt;&#x2F;code&gt; extends + include partials&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;归档页 + 年份热力图&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;templates&#x2F;archive.html&lt;&#x2F;code&gt; + &lt;code&gt;heatmap_component.html&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;自定义列表模板&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;templates&#x2F;article_list.html&lt;&#x2F;code&gt; &#x2F; &lt;code&gt;nanolog_list.html&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;全局配置&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;zola.toml&lt;&#x2F;code&gt; → &lt;code&gt;config.extra.*&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;主题变量（颜色）&lt;&#x2F;td&gt;&lt;td&gt;ametrine &lt;code&gt;--bg-muted-1&lt;&#x2F;code&gt;、&lt;code&gt;--accent-color&lt;&#x2F;code&gt; 等 CSS 变量&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;can-kao&quot;&gt;参考&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class=&quot;external&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.getzola.org&#x2F;documentation&#x2F;&quot;&gt;Zola Documentation&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a class=&quot;external&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;keats.github.io&#x2F;tera&#x2F;&quot;&gt;Tera Template Engine&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a class=&quot;external&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;daudix&#x2F;daudix.one&#x2F;tree&#x2F;main&#x2F;content&quot;&gt;daudix.one content&lt;&#x2F;a&gt; — 本文 Markdown 示例主要来源&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a class=&quot;external&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;daudix.one&#x2F;blog&#x2F;2024-10-12-zola-vs-jekyll&#x2F;&quot;&gt;daudix: Zola vs Jekyll&lt;&#x2F;a&gt; — 目录结构与模板覆盖的详细说明&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a class=&quot;external&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;daudix.one&#x2F;blog&#x2F;2024-12-14-my-blog-workflow&#x2F;&quot;&gt;daudix: My Blog Workflow&lt;&#x2F;a&gt; — front matter 模板与图片工作流&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;&lt;em&gt;本文即按上述规范编写：&lt;code&gt;toc = true&lt;&#x2F;code&gt; 启用目录，&lt;code&gt;accent_color&lt;&#x2F;code&gt; 设置页面强调色，内部链接使用 &lt;code&gt;@&#x2F;&lt;&#x2F;code&gt; 语法。&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
