<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>KZero&#39;s Blog</title>
  
  <subtitle>Accumulation record</subtitle>
  <link href="https://zoiii.cn/atom.xml" rel="self"/>
  
  <link href="https://zoiii.cn/"/>
  <updated>2025-08-02T04:24:51.582Z</updated>
  <id>https://zoiii.cn/</id>
  
  <author>
    <name>CodeKZero</name>
    
  </author>
  
  <generator uri="https://hexo.io/">Hexo</generator>
  
  <entry>
    <title>Walkie Talkie</title>
    <link href="https://zoiii.cn/2025/07/14/walkie-talkie/"/>
    <id>https://zoiii.cn/2025/07/14/walkie-talkie/</id>
    <published>2025-07-14T11:22:10.000Z</published>
    <updated>2025-08-02T04:24:51.582Z</updated>
    
    <content type="html"><![CDATA[<h2 id="无线电原理"><a href="#无线电原理" class="headerlink" title="无线电原理"></a>无线电原理</h2><p><strong>电磁波</strong>：</p><p>通过电场与磁场振荡传播能量，无需介质（真空中光速传播：3×10⁸ m&#x2F;s）。</p><p><strong>频率（f）与波长（λ）</strong>：  </p><p>  c&#x3D;f×λ（c&#x3D;光速），频率越高，波长越短，穿透力越强，但绕射能力越弱。</p><p><strong>调制技术</strong>：</p><ul><li><p><strong>模拟调制</strong>：AM（调幅，易受干扰）、FM（调频，音质好）</p></li><li><p><strong>数字调制</strong>：FSK（频移键控）、QPSK（正交相移，高效抗噪）</p></li></ul><h2 id="对讲机原理"><a href="#对讲机原理" class="headerlink" title="对讲机原理"></a>对讲机原理</h2><p><strong>发射端</strong>：麦克风声音 → 电路转换为电信号 → 调制到无线电波（载波）→ 天线发射</p><p><strong>接收端</strong>：天线接收信号 → 解调还原声音 → 喇叭输出</p><p><strong>半双工通信</strong>：同一时间只能一方讲话（类似“按讲”模式）。</p><h2 id="关键参数"><a href="#关键参数" class="headerlink" title="关键参数"></a>关键参数</h2><h3 id="功率（W）"><a href="#功率（W）" class="headerlink" title="功率（W）"></a>功率（W）</h3><p>功率越大越耗电，功率翻倍 ≠ 距离翻倍！实际距离仅增加约40%（因信号衰减遵循平方反比定律）</p><table><thead><tr><th>功率范围</th><th>设备类型</th><th>覆盖距离</th><th>常见场景</th><th>法规要求</th></tr></thead><tbody><tr><td>0.1-0.5W</td><td>玩具对讲机</td><td>100-500米</td><td>儿童玩具、酒店客房机</td><td>中国409MHz&#x2F;欧盟PMR446强制≤0.5W</td></tr><tr><td>1-2W</td><td>民用手持机</td><td>市区1-3公里，开阔地3-5公里</td><td>小区物业、商场调度</td><td>美国FRS频段≤2W</td></tr><tr><td>3-5W</td><td>专业手持机</td><td>市区2-5公里，开阔地5-10公里</td><td>工地通信、安保巡逻</td><td>需执照</td></tr><tr><td>6-10W</td><td>车载台&#x2F;船载台</td><td>市区5-10公里，开阔地20-50公里</td><td>出租车队、船舶通信</td><td>需执照并备案设备</td></tr><tr><td>25-50W</td><td>基地台&#x2F;中继台</td><td>覆盖半径30-100公里</td><td>山区中继、应急通信</td><td>严格执照审批</td></tr></tbody></table><span id="more"></span><h3 id="灵敏度"><a href="#灵敏度" class="headerlink" title="灵敏度"></a>灵敏度</h3><p>接收弱信号的能力（值越小越好，如-122dBm）</p><table><thead><tr><th>灵敏度范围</th><th>设备类型</th><th>实际表现</th></tr></thead><tbody><tr><td>-118 ~ -120 dBm</td><td>低端玩具对讲机</td><td>市区易丢信号，郊区通话断续</td></tr><tr><td>-122 ~ -124 dBm</td><td>民用专业机（主流）</td><td>满足日常5公里内稳定通话</td></tr><tr><td>-126 ~ -130 dBm</td><td>高端专业&#x2F;业余机</td><td>弱信号接收强，适合山区&#x2F;应急通信</td></tr><tr><td>&lt; -130 dBm</td><td>军用&#x2F;特殊设备</td><td>极弱信号捕获（如搜救行动）</td></tr></tbody></table><h3 id="频段支持"><a href="#频段支持" class="headerlink" title="频段支持"></a>频段支持</h3><table><thead><tr><th>频段</th><th>频率范围</th><th>特点</th><th>典型场景</th><th>通信距离</th></tr></thead><tbody><tr><td>UHF</td><td>400-470 MHz</td><td>穿透性强，绕射性弱</td><td>商场&#x2F;酒店&#x2F;工地</td><td>市区：0.5-3公里<br>开阔地：3-8公里（5W功率）</td></tr><tr><td>VHF</td><td>136-174 MHz</td><td>绕射性好，穿透性弱</td><td>林业&#x2F;渔业&#x2F;探险</td><td>市区：1-2公里<br>海上&#x2F;山区：5-15公里（5W功率）</td></tr></tbody></table><h3 id="信道数量"><a href="#信道数量" class="headerlink" title="信道数量"></a>信道数量</h3><p>可存储的通信频率组（如16&#x2F;128信道）</p><table><thead><tr><th>信道数量</th><th>设备类型</th><th>适用场景</th></tr></thead><tbody><tr><td>8-16信道</td><td>入门民用&#x2F;玩具机</td><td>家庭出游、小团队活动</td></tr><tr><td>32-64信道</td><td>商用专业机</td><td>物业安保、酒店调度、中型车队</td></tr><tr><td>128-256信道</td><td>高端业余&#x2F;工程机</td><td>业余无线电、应急救援、大型活动保障</td></tr><tr><td>1000+信道</td><td>数字集群系统</td><td>公安&#x2F;消防指挥网</td></tr></tbody></table><h2 id="亚音（CTCSS-DCS）"><a href="#亚音（CTCSS-DCS）" class="headerlink" title="亚音（CTCSS&#x2F;DCS）"></a>亚音（CTCSS&#x2F;DCS）</h2><p>“哑音”是对讲机通信中的一种静噪控制技术，专业术语称为 亚音频（CTCSS） 或 数字亚音（DCS）。它的作用是让对讲机在同频下，只有相同亚音的设备才能互通。</p><h3 id="亚音类型"><a href="#亚音类型" class="headerlink" title="亚音类型"></a>亚音类型</h3><p>模拟哑音（CTCSS）： 附加一个 低频音频信号（如：67-254.1Hz），适用于业余无线电、车队调度</p><p>数字哑音（DCS）：附加一组 数字编码信号（D023N ~ D754I（共104组编码）），适用于专业通讯、抗干扰要求高的环境</p><h3 id="哑音原理"><a href="#哑音原理" class="headerlink" title="哑音原理"></a>哑音原理</h3><p>发送方：在发射语音信号时，附加一个低频的亚音信号。</p><p>例如：设定发射哑音为 67Hz。</p><p>接收方：只有检测到相同的亚音信号时，才会打开扬声器输出声音。</p><p>如果对方未设置哑音或哑音不匹配，即使频率相同，你的对讲机也会保持静默。</p><h2 id="合法使用"><a href="#合法使用" class="headerlink" title="合法使用"></a>合法使用</h2><p>免执照机：必须使用预置的409MHz频段（中国20个频道），不可改装。</p><p>电磁兼容：医院&#x2F;加油站禁用对讲机！</p><h3 id="应急通信频段"><a href="#应急通信频段" class="headerlink" title="应急通信频段"></a>应急通信频段</h3><p>由国际无线电联盟（ITU）分配给我国的应急通信直频频率：</p><p>CRSA（China）</p><p>V段：</p><p>144.100MHz +&#x2F;-10KHz</p><p>145.000MHz +&#x2F;-10KHz</p><p>U段：</p><p>433.000MHz +&#x2F;-10KHz</p><p>433.500MHz +&#x2F;-10KHz</p><p>在突发重大灾难应急救援时统一使用上述频率HAM可以守听</p><h2 id="UV5R"><a href="#UV5R" class="headerlink" title="UV5R"></a>UV5R</h2><p>双段、双显、双频、双守</p><p>双音多频DTMF编码 ；65-108mHZ FM收音机功能</p><p>快捷菜单操作模式；紧急报警呼叫功能</p><p>中转台接入1750音；模拟 &#x2F; 数字亚音自动扫描</p><p>128组储存信道；ANI身份码发送</p><p>模拟亚音非标编辑功能；中续台转发证实功能</p><h3 id="安全提示"><a href="#安全提示" class="headerlink" title="安全提示"></a>安全提示</h3><p>务必先安装天线再开机，否则按发射键（PTT）可能烧毁功放模块。</p><h3 id="功能键介绍"><a href="#功能键介绍" class="headerlink" title="功能键介绍"></a>功能键介绍</h3><h4 id="顶部"><a href="#顶部" class="headerlink" title="顶部"></a>顶部</h4><p>天线：SMA母头</p><p>手电筒：白光</p><p>旋转钮：音量、电源开关</p><h4 id="正面"><a href="#正面" class="headerlink" title="正面"></a>正面</h4><p>VFO&#x2F;MR（橙色）：频率&#x2F;信道模式切换（频率模式用于手动调频，信道模式调用预设频道）</p><p>A&#x2F;B（蓝色）：上下频切换键</p><p>BAND：U&#x2F;V频段切换（U段 400-470MHz &#x2F; V段 136-174MHz）</p><p>MUEN：菜单设置，输入数字会切换到对应数字的菜单设置下</p><p>EXIT：退出</p><p>SCAN（*）：接收和发射频率倒置；长按扫描频率&#x2F;信道&#x2F;电台</p><ul><li>接收和发射频率倒置（又称倒频）：上行频率为434MHz、下行频率为439MHz时，采用倒频后，接收方使用434MHz接收信号，同时用439MHz发送信号。</li></ul><p>存储信道：输入频率后，按 MENU 键 → 输入菜单号 27（信道存储） →  选择信道 → 按 MENU 确认。</p><p>钥匙键（#）：单按切换高低发射功率（显示L低功率）；长按键解锁</p><h4 id="左侧"><a href="#左侧" class="headerlink" title="左侧"></a>左侧</h4><p>CALL：收音机、报警键</p><p>PTT：发射键</p><p>MONI：手电筒开关、监听键</p><h4 id="右侧"><a href="#右侧" class="headerlink" title="右侧"></a>右侧</h4><p>SP：外部接口</p><p>MIC：麦克风接口</p><h3 id="设置说明"><a href="#设置说明" class="headerlink" title="设置说明"></a>设置说明</h3><p><img data-src="https://pub-dfc86f9cfc3645c58a55ca0ae65d8220.r2.dev/uv5r/uv5r-3.jpg"></p><p><img data-src="https://pub-dfc86f9cfc3645c58a55ca0ae65d8220.r2.dev/uv5r/uv5r-4.jpg"></p><p><img data-src="https://pub-dfc86f9cfc3645c58a55ca0ae65d8220.r2.dev/uv5r/uv5r-5.jpg"></p><p><img data-src="https://pub-dfc86f9cfc3645c58a55ca0ae65d8220.r2.dev/uv5r/uv5r-6.jpg"></p><p><img data-src="https://pub-dfc86f9cfc3645c58a55ca0ae65d8220.r2.dev/uv5r/uv5r-7.jpg"></p><p><img data-src="https://pub-dfc86f9cfc3645c58a55ca0ae65d8220.r2.dev/uv5r/uv5r-8.jpg"></p><p><img data-src="https://pub-dfc86f9cfc3645c58a55ca0ae65d8220.r2.dev/uv5r/uv5r-9.jpg"></p><p><img data-src="https://pub-dfc86f9cfc3645c58a55ca0ae65d8220.r2.dev/uv5r/uv5r-10.jpg"></p><p><img data-src="https://pub-dfc86f9cfc3645c58a55ca0ae65d8220.r2.dev/uv5r/uv5r-11.jpg"></p><p><img data-src="https://pub-dfc86f9cfc3645c58a55ca0ae65d8220.r2.dev/uv5r/uv5r-12.jpg"></p><p><img data-src="https://pub-dfc86f9cfc3645c58a55ca0ae65d8220.r2.dev/uv5r/uv5r-13.jpg"></p><p><img data-src="https://pub-dfc86f9cfc3645c58a55ca0ae65d8220.r2.dev/uv5r/uv5r-14.jpg"></p><h4 id="省电设置"><a href="#省电设置" class="headerlink" title="省电设置"></a>省电设置</h4><p>非联系时段关机模式</p><p>（菜单1）TXP：发身功率 LOW（1W）HIGH（5W）</p><ul><li>距离近可用LOW省电，距离远切换HIGH。</li></ul><p>（菜单3）SAVE：省电模式 （1～4档）</p><p>（菜单6）ABR：自动背光（OFF）</p><p>（菜单8）BEEP：提示音关闭（OFF）</p><p>（菜单10）R-DCS：接收数字哑音（OFF）</p><p>（菜单14）VOICE：提示语言（OFF）默认CHI</p><p>（菜单18）SC-REV：扫描恢复方式（CO）</p><ul><li><p>通话结束后自动恢复扫描，平衡了响应速度和省电需求</p></li><li><p>避免 TO 模式因固定 5 秒等待产生无效耗电，或 SE 模式需手动恢复的麻烦。</p></li></ul><h4 id="防误触设置"><a href="#防误触设置" class="headerlink" title="防误触设置"></a>防误触设置</h4><p>（菜单9）TOT：发身限时</p><ul><li>单次发射最长 60~120秒（防误触 PTT 持续耗电，默认 180 秒过长，改60秒）</li></ul><p>（菜单24）AUTOLK：自动键盘锁（ON）预防误触</p><h4 id="常用操作"><a href="#常用操作" class="headerlink" title="常用操作"></a>常用操作</h4><p>（#）钥匙键：单按开启低功率发射（显示L）；长按可以上锁，再长按解锁。</p><h4 id="通信优化设置"><a href="#通信优化设置" class="headerlink" title="通信优化设置"></a>通信优化设置</h4><p>静噪等级（SQL）调节建议：</p><ul><li><p>山区&#x2F;弱信号区：设为 <strong>1-2</strong>（降低阈值，接收微弱信号，但可能收噪音）。</p></li><li><p>平原&#x2F;强信号区：设为 <strong>3-5</strong>（屏蔽背景噪音）。</p></li><li><p>⚠️ 注意：SQL&#x3D;0 会持续接收噪音，严重耗电！</p></li></ul><p><strong>选择清晰频道</strong></p><p><strong>推荐频率</strong>（避开干扰）：</p><ul><li><p><strong>UHF</strong>：430-440MHz（如 433.500MHz）</p></li><li><p><strong>VHF</strong>：144-148MHz（如 145.500MHz）</p></li><li><p><strong>注意</strong>：提前与队友约定备用频道（如主频被干扰切到副频）。</p></li></ul><p><strong>设置亚音码（CTCSS&#x2F;DCS）</strong></p><ul><li><p><strong>设置路径</strong>：MENU → 13 (T-CTCS)&#x2F;12 (T-DCS) → 选择相同亚音码</p></li><li><p><strong>作用</strong>：过滤同频干扰信号，避免误唤醒对讲机耗电。</p></li><li><p><strong>建议</strong>：常用亚音码（如 CTCSS 67.0Hz）或 DCS 023。</p></li></ul><h4 id="安全与应急设置"><a href="#安全与应急设置" class="headerlink" title="安全与应急设置"></a>安全与应急设置</h4><p><strong>开启双守候（Dual Watch）</strong></p><ul><li><p><strong>设置路径</strong>：MENU → 7(TDR) → ON</p></li><li><p><strong>作用</strong>：同时监听主频道和应急频道（如预设的救援频段）。</p></li><li><p><strong>省电提示</strong>：仅在危险区域开启，平时关闭。</p></li></ul>]]></content>
    
    
    <summary type="html">&lt;h2 id=&quot;无线电原理&quot;&gt;&lt;a href=&quot;#无线电原理&quot; class=&quot;headerlink&quot; title=&quot;无线电原理&quot;&gt;&lt;/a&gt;无线电原理&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;电磁波&lt;/strong&gt;：&lt;/p&gt;
&lt;p&gt;通过电场与磁场振荡传播能量，无需介质（真空中光速传播：3×10⁸ m&amp;#x2F;s）。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;频率（f）与波长（λ）&lt;/strong&gt;：  &lt;/p&gt;
&lt;p&gt;  c&amp;#x3D;f×λ（c&amp;#x3D;光速），频率越高，波长越短，穿透力越强，但绕射能力越弱。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;调制技术&lt;/strong&gt;：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;模拟调制&lt;/strong&gt;：AM（调幅，易受干扰）、FM（调频，音质好）&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;数字调制&lt;/strong&gt;：FSK（频移键控）、QPSK（正交相移，高效抗噪）&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;对讲机原理&quot;&gt;&lt;a href=&quot;#对讲机原理&quot; class=&quot;headerlink&quot; title=&quot;对讲机原理&quot;&gt;&lt;/a&gt;对讲机原理&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;发射端&lt;/strong&gt;：麦克风声音 → 电路转换为电信号 → 调制到无线电波（载波）→ 天线发射&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;接收端&lt;/strong&gt;：天线接收信号 → 解调还原声音 → 喇叭输出&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;半双工通信&lt;/strong&gt;：同一时间只能一方讲话（类似“按讲”模式）。&lt;/p&gt;
&lt;h2 id=&quot;关键参数&quot;&gt;&lt;a href=&quot;#关键参数&quot; class=&quot;headerlink&quot; title=&quot;关键参数&quot;&gt;&lt;/a&gt;关键参数&lt;/h2&gt;&lt;h3 id=&quot;功率（W）&quot;&gt;&lt;a href=&quot;#功率（W）&quot; class=&quot;headerlink&quot; title=&quot;功率（W）&quot;&gt;&lt;/a&gt;功率（W）&lt;/h3&gt;&lt;p&gt;功率越大越耗电，功率翻倍 ≠ 距离翻倍！实际距离仅增加约40%（因信号衰减遵循平方反比定律）&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;功率范围&lt;/th&gt;
&lt;th&gt;设备类型&lt;/th&gt;
&lt;th&gt;覆盖距离&lt;/th&gt;
&lt;th&gt;常见场景&lt;/th&gt;
&lt;th&gt;法规要求&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;0.1-0.5W&lt;/td&gt;
&lt;td&gt;玩具对讲机&lt;/td&gt;
&lt;td&gt;100-500米&lt;/td&gt;
&lt;td&gt;儿童玩具、酒店客房机&lt;/td&gt;
&lt;td&gt;中国409MHz&amp;#x2F;欧盟PMR446强制≤0.5W&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1-2W&lt;/td&gt;
&lt;td&gt;民用手持机&lt;/td&gt;
&lt;td&gt;市区1-3公里，开阔地3-5公里&lt;/td&gt;
&lt;td&gt;小区物业、商场调度&lt;/td&gt;
&lt;td&gt;美国FRS频段≤2W&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3-5W&lt;/td&gt;
&lt;td&gt;专业手持机&lt;/td&gt;
&lt;td&gt;市区2-5公里，开阔地5-10公里&lt;/td&gt;
&lt;td&gt;工地通信、安保巡逻&lt;/td&gt;
&lt;td&gt;需执照&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6-10W&lt;/td&gt;
&lt;td&gt;车载台&amp;#x2F;船载台&lt;/td&gt;
&lt;td&gt;市区5-10公里，开阔地20-50公里&lt;/td&gt;
&lt;td&gt;出租车队、船舶通信&lt;/td&gt;
&lt;td&gt;需执照并备案设备&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;25-50W&lt;/td&gt;
&lt;td&gt;基地台&amp;#x2F;中继台&lt;/td&gt;
&lt;td&gt;覆盖半径30-100公里&lt;/td&gt;
&lt;td&gt;山区中继、应急通信&lt;/td&gt;
&lt;td&gt;严格执照审批&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;</summary>
    
    
    
    <category term="Walkie Talkie" scheme="https://zoiii.cn/categories/Walkie-Talkie/"/>
    
    
    <category term="Walkie Talkie" scheme="https://zoiii.cn/tags/Walkie-Talkie/"/>
    
  </entry>
  
  <entry>
    <title>Boom3D</title>
    <link href="https://zoiii.cn/2025/06/26/boom3d/"/>
    <id>https://zoiii.cn/2025/06/26/boom3d/</id>
    <published>2025-06-26T22:37:35.000Z</published>
    <updated>2025-08-02T04:24:51.582Z</updated>
    
    <content type="html"><![CDATA[<h2 id="Boom3D"><a href="#Boom3D" class="headerlink" title="Boom3D"></a>Boom3D</h2><p>Boom 3D 是一款<strong>音效增强软件</strong>。它能<strong>显著提升电脑（或手机）的音频播放质量</strong>，带来更具沉浸感、更强劲、更清晰、更个性化的听觉体验。</p><p>3D环绕立体声</p><p>自定义的调音：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">32Hz 6.0dB</span><br><span class="line"></span><br><span class="line">63Hz 5.0dB</span><br><span class="line"></span><br><span class="line">125Hz 2.3dB</span><br><span class="line"></span><br><span class="line">250Hz 3.0dB</span><br><span class="line"></span><br><span class="line">500Hz -1.8dB</span><br><span class="line"></span><br><span class="line">1kHz 2.4dB2kHz 1.4dB</span><br><span class="line"></span><br><span class="line">4kHz 3.1dB</span><br><span class="line"></span><br><span class="line">8kHz 3.9dB</span><br><span class="line"></span><br><span class="line">16kHz 5.7dB</span><br></pre></td></tr></table></figure><span id="more"></span><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/*makedown行间代码样式 */</span></span><br><span class="line"><span class="selector-class">.cnblogs-markdown</span> <span class="selector-tag">code</span> &#123;</span><br><span class="line">    <span class="attribute">color</span>: <span class="number">#c7254e</span>;</span><br><span class="line">    <span class="attribute">border</span>: none <span class="meta">!important</span>;</span><br><span class="line">    <span class="attribute">font-size</span>: <span class="number">1em</span> <span class="meta">!important</span>;</span><br><span class="line">    <span class="attribute">background-color</span>: <span class="number">#f9f2f4</span> <span class="meta">!important</span>;</span><br><span class="line">    <span class="attribute">font-family</span>: sans-serif <span class="meta">!important</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/*makedown行间代码样式 */</span></span><br><span class="line"><span class="selector-class">.cnblogs-markdown</span> <span class="selector-tag">code</span> &#123;</span><br><span class="line">    <span class="attribute">color</span>: <span class="number">#c7254e</span>;</span><br><span class="line">    <span class="attribute">border</span>: none <span class="meta">!important</span>;</span><br><span class="line">    <span class="attribute">font-size</span>: <span class="number">1em</span> <span class="meta">!important</span>;</span><br><span class="line">    <span class="attribute">background-color</span>: <span class="number">#f9f2f4</span> <span class="meta">!important</span>;</span><br><span class="line">    <span class="attribute">font-family</span>: sans-serif <span class="meta">!important</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np </span><br><span class="line"><span class="keyword">import</span> cv2</span><br><span class="line"><span class="keyword">import</span> dlib</span><br><span class="line"><span class="keyword">from</span> scipy.spatial <span class="keyword">import</span> distance</span><br><span class="line"><span class="keyword">import</span> os</span><br><span class="line"><span class="keyword">from</span> imutils <span class="keyword">import</span> face_utils</span><br><span class="line"><span class="keyword">import</span> matplotlib.pyplot <span class="keyword">as</span> plt</span><br><span class="line"><span class="keyword">import</span> winsound</span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">eye_aspect_ratio</span>(<span class="params">eye</span>):<span class="comment"># 计算EAR</span></span><br><span class="line">    A = distance.euclidean(eye[<span class="number">1</span>], eye[<span class="number">5</span>])</span><br><span class="line">    B = distance.euclidean(eye[<span class="number">2</span>], eye[<span class="number">4</span>])</span><br><span class="line">    C = distance.euclidean(eye[<span class="number">0</span>], eye[<span class="number">3</span>])</span><br><span class="line">    ear = (A + B) / (<span class="number">2.0</span> * C)</span><br><span class="line">    <span class="keyword">return</span> ear</span><br></pre></td></tr></table></figure><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">HelloWorld</span> &#123;</span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title function_">main</span><span class="params">(String[] args)</span> &#123;</span><br><span class="line">        System.out.println(<span class="string">&quot;Hello World&quot;</span>);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">cars=[<span class="string">&quot;BMW&quot;</span>,<span class="string">&quot;Volvo&quot;</span>,<span class="string">&quot;Saab&quot;</span>,<span class="string">&quot;Ford&quot;</span>];</span><br><span class="line"><span class="keyword">var</span> i=<span class="number">0</span>;</span><br><span class="line"><span class="keyword">for</span> (;cars[i];)</span><br><span class="line">&#123;</span><br><span class="line">    <span class="variable language_">document</span>.<span class="title function_">write</span>(cars[i] + <span class="string">&quot;&lt;br&gt;&quot;</span>);</span><br><span class="line">    i++;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>]]></content>
    
    
    <summary type="html">&lt;h2 id=&quot;Boom3D&quot;&gt;&lt;a href=&quot;#Boom3D&quot; class=&quot;headerlink&quot; title=&quot;Boom3D&quot;&gt;&lt;/a&gt;Boom3D&lt;/h2&gt;&lt;p&gt;Boom 3D 是一款&lt;strong&gt;音效增强软件&lt;/strong&gt;。它能&lt;strong&gt;显著提升电脑（或手机）的音频播放质量&lt;/strong&gt;，带来更具沉浸感、更强劲、更清晰、更个性化的听觉体验。&lt;/p&gt;
&lt;p&gt;3D环绕立体声&lt;/p&gt;
&lt;p&gt;自定义的调音：&lt;/p&gt;
&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;9&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;10&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;11&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;12&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;13&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;14&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;15&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;16&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;17&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;32Hz 6.0dB&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;63Hz 5.0dB&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;125Hz 2.3dB&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;250Hz 3.0dB&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;500Hz -1.8dB&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;1kHz 2.4dB2kHz 1.4dB&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4kHz 3.1dB&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8kHz 3.9dB&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;16kHz 5.7dB&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;</summary>
    
    
    
    <category term="Boom3D" scheme="https://zoiii.cn/categories/Boom3D/"/>
    
    
    <category term="Boom3D" scheme="https://zoiii.cn/tags/Boom3D/"/>
    
  </entry>
  
  <entry>
    <title>Terminal</title>
    <link href="https://zoiii.cn/2025/06/22/terminal/"/>
    <id>https://zoiii.cn/2025/06/22/terminal/</id>
    <published>2025-06-22T20:02:43.000Z</published>
    <updated>2025-08-02T04:24:51.582Z</updated>
    
    <content type="html"><![CDATA[<h2 id="终端命令介绍"><a href="#终端命令介绍" class="headerlink" title="终端命令介绍"></a>终端命令介绍</h2><p>终端命令可以完成可视化界面无法实现的功能。</p><p><a href="https://wangchujiang.com/linux-command/hot.html">Linux命令大全</a></p><h2 id="终端常用命令"><a href="#终端常用命令" class="headerlink" title="终端常用命令"></a>终端常用命令</h2><p>可以使用&amp;&amp; 多行命令一起执行<br>cd 路径 &amp;&amp; touch 文件</p><p>ls：查看当前所有文件<br>ls -a 查看当前所有文件（包含隐藏文件）<br>ls -l：查看所有文件详细信息<br>ls -la：查看所有文件详细信息（包含隐藏文件）</p><p>cd：切换路径<br>cd ..&#96;切换上级目录</p><p>pwd：查看当前路径位置</p><p>open 文件：文件 打开文件<br>open .：打开当前目录文件</p><p>clear：清屏</p><p>touch 文件：创建文件<br>mkdir 文件名：创建文件夹<br>rmdir 文件名：删除文件夹</p><p>rm 文件：删除文件<br>cp 文件 路径：把xx复制到xx<br>mv 文件 路径：把xx移动到xx</p><p>cat 文件：显示文件内容<br>less 文件：分页查看文件内容<br>vim 文件：文本编辑器</p><p>chmod：修改权限<br>sudo 命令：使用管理员权限<br>sudo su：进入管理员模式，输入电脑密码</p><span id="more"></span><p>top 或 htop：显示系统进程（实时监控）<br>ps：查看当前进程<br>ps u：<br>kill：终止进程<br>kill -9 PID&#96;（端口）</p><p>df：查看磁盘空间<br>df -h：显示磁盘空间使用情况<br>du -sh 文件：显示目录大小</p><p>man 命令：查看命令的手册页</p><p>history：显示命令历史记录</p><p>ping 网址：测试网络<br>curl url：获取HTML数据<br>ssh：远程登录</p><h3 id="npm"><a href="#npm" class="headerlink" title="npm"></a>npm</h3><p>npm（Node Package Manager） 是 JavaScript 的官方包管理工具，也是世界上最大的软件仓库。它主要用于：</p><ul><li>安装、管理和卸载 <strong>Node.js 模块&#x2F;库</strong></li><li>管理项目的依赖关系</li><li>执行脚本任务（如启动、构建、测试）</li></ul><h4 id="npm三大核心功能"><a href="#npm三大核心功能" class="headerlink" title="npm三大核心功能"></a>npm三大核心功能</h4><h5 id="在线仓库（Registry）"><a href="#在线仓库（Registry）" class="headerlink" title="在线仓库（Registry）"></a>在线仓库（Registry）</h5><p>npm 提供了一个全球性的开源代码仓库：<a href="https://www.npmjs.com/">https://www.npmjs.com</a></p><p>可以在上面搜索和下载成千上万的开源 JavaScript 包（如 <code>express</code>, <code>react</code>, <code>lodash</code> 等等）。</p><h5 id="命令行工具（CLI）"><a href="#命令行工具（CLI）" class="headerlink" title="命令行工具（CLI）"></a>命令行工具（CLI）</h5><p>安装 Node.js 后，会自动安装 npm 命令行工具，可以在终端中使用如下命令：</p><p>安装包</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install &lt;package-name&gt;</span><br></pre></td></tr></table></figure><p>初始化项目（生成 package.json）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm init</span><br></pre></td></tr></table></figure><p>快速生成一个 <code>package.json</code> 文件</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm init -y</span><br></pre></td></tr></table></figure><p>运行定义好的启动脚本</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm start</span><br></pre></td></tr></table></figure><p>运行自定义脚本</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm run &lt;script-name&gt;</span><br></pre></td></tr></table></figure><h5 id="配置文件：package-json"><a href="#配置文件：package-json" class="headerlink" title="配置文件：package.json"></a>配置文件：package.json</h5><p>这是 npm 项目的核心文件，用于记录：</p><ul><li><p>项目名称、版本号</p></li><li><p>入口文件</p></li><li><p>脚本命令（scripts）</p></li><li><p>项目依赖（dependencies 和 devDependencies）<br>可以通过以下命令快速生成一个 package.json 文件：</p></li></ul><h4 id="npm常见用命令"><a href="#npm常见用命令" class="headerlink" title="npm常见用命令"></a>npm常见用命令</h4><p>快速初始化，创建 package.json，默认配置</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm init -y</span><br></pre></td></tr></table></figure><p>安装所有依赖</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install </span><br></pre></td></tr></table></figure><p>或</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm i</span><br></pre></td></tr></table></figure><p>安装指定包（package-name，pkg）</p><pre><code>npm install &lt;package-name&gt;</code></pre><p>全局安装包</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install -g &lt;package-name&gt;</span><br></pre></td></tr></table></figure><p>安装为开发依赖（devDependencies）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install --save-dev &lt;pkg&gt;</span><br></pre></td></tr></table></figure><p>卸载包</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm uninstall &lt;pkg&gt;</span><br></pre></td></tr></table></figure><p>更新包</p><pre><code>npm update &lt;pkg&gt;</code></pre><p>查看已安装的包</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm list</span><br></pre></td></tr></table></figure><p>执行在 package.json 中定义的脚本</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm run &lt;script-name&gt;</span><br></pre></td></tr></table></figure><p><strong>清理缓存</strong></p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm cache clean --force</span><br></pre></td></tr></table></figure><h3 id="brew（Homebrew）"><a href="#brew（Homebrew）" class="headerlink" title="brew（Homebrew）"></a>brew（Homebrew）</h3><p><strong>Homebrew</strong> 是 macOS（以及 Linux）上非常流行的 <strong>包管理器</strong>，它简化了软件的安装、更新和卸载过程。</p><p>通过 Homebrew，你可以轻松地从命令行安装各种开源软件。</p><p>Homebrew官网：<a href="https://brew.sh/">https://brew.sh</a></p><h4 id="brew主要特点"><a href="#brew主要特点" class="headerlink" title="brew主要特点"></a>brew主要特点</h4><ol><li><p><strong>简单易用</strong></p><ul><li>使用简单的命令来管理软件包。</li></ul></li><li><p><strong>开源</strong></p><ul><li>Homebrew 本身是开源的，社区驱动，拥有丰富的软件库。</li></ul></li><li><p><strong>广泛的软件支持</strong></p><ul><li>包含数千种常见的开发工具、数据库、编程语言等。</li></ul></li><li><p><strong>自动解决依赖</strong></p><ul><li>安装软件时会自动处理其依赖关系。</li></ul></li><li><p><strong>跨平台支持</strong></p><ul><li>虽然最初为 macOS 设计，但现在也支持 Linux 系统。</li></ul></li></ol><h4 id="brew常用命令"><a href="#brew常用命令" class="headerlink" title="brew常用命令"></a>brew常用命令</h4><p>安装软件包（称为 formula）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">brew install &lt;formula&gt;</span><br></pre></td></tr></table></figure><p>卸载软件包</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">brew uninstall &lt;formula&gt;</span><br></pre></td></tr></table></figure><p>更新 Homebrew 自身及软件包列表</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">brew update</span><br></pre></td></tr></table></figure><p>升级所有已安装的软件包</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">brew upgrade</span><br></pre></td></tr></table></figure><p>搜索软件包</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">brew search &lt;text&gt;</span><br></pre></td></tr></table></figure><p>检查系统并提供修复建议</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">brew doctor</span><br></pre></td></tr></table></figure><p>列出所有已安装的软件包</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">brew list</span><br></pre></td></tr></table></figure><h3 id="nvm"><a href="#nvm" class="headerlink" title="nvm"></a>nvm</h3><p><strong>NVM（Node Version Manager）</strong> 是一个用于管理多个 Node.js 版本的工具，允许你在同一台机器上轻松切换不同的 Node.js 版本。这对于需要在不同项目中使用特定版本 Node.js 的开发者来说非常有用。</p><h4 id="nvm主要特点"><a href="#nvm主要特点" class="headerlink" title="nvm主要特点"></a>nvm主要特点</h4><ol><li><p><strong>多版本支持</strong></p><ul><li>可以在同一台电脑上安装和管理多个 Node.js 版本。</li></ul></li><li><p><strong>简单切换</strong></p><ul><li>轻松切换全局或局部项目的 Node.js 版本。</li></ul></li><li><p><strong>自动切换</strong></p><ul><li>根据每个项目的 <code>.nvmrc</code> 文件自动切换 Node.js 版本。</li></ul></li><li><p><strong>跨平台</strong></p><ul><li>主要为 macOS 和 Linux 设计，但也有适用于 Windows 的替代品如 <strong>nvm-windows</strong> 或 <strong>nvs</strong>。</li></ul></li></ol><h4 id="nvm常用命令"><a href="#nvm常用命令" class="headerlink" title="nvm常用命令"></a>nvm常用命令</h4><p>安装指定版本的 Node.js</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">nvm install &lt;version&gt;</span><br></pre></td></tr></table></figure><p>切换当前终端会话使用的 Node.js 版本</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">nvm use &lt;version&gt;</span><br></pre></td></tr></table></figure><p>列出已安装的所有 Node.js 版本</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">nvm ls</span><br></pre></td></tr></table></figure><p>查看当前使用的 Node.js 版本</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">nvm current</span><br></pre></td></tr></table></figure><p>卸载指定版本的 Node.js</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">nvm uninstall &lt;version&gt;</span><br></pre></td></tr></table></figure><p>设置默认使用的 Node.js 版本</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">nvm alias default &lt;version&gt;</span><br></pre></td></tr></table></figure><p>查看远程可用的 Node.js 版本</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">nvm ls-remote</span><br></pre></td></tr></table></figure><!-- more --><h2 id="终端快捷键"><a href="#终端快捷键" class="headerlink" title="终端快捷键"></a>终端快捷键</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line">Ctrl + A：光标移动到行首</span><br><span class="line">Ctrl + E：光标移动到行尾</span><br><span class="line">Ctrl + L：清屏</span><br><span class="line">Ctrl + U：清除当前行</span><br><span class="line"></span><br><span class="line">Ctrl + C：终止当前运行的程序</span><br><span class="line">Ctrl + Z：暂停当前运行的程序</span><br><span class="line"></span><br><span class="line">Tab：自动补全命令、文件名或目录名</span><br><span class="line"></span><br><span class="line">Ctrl + W：删除光标前的一个单词</span><br><span class="line">Alt + D：删除光标后的下一个单词</span><br><span class="line">Ctrl + U：删除光标前的所有字符</span><br><span class="line">Ctrl + K：删除光标后的所有字符</span><br><span class="line">Ctrl + Y：粘贴之前删除的内容</span><br><span class="line"></span><br><span class="line">Command + T： 横向新建标签</span><br><span class="line">Command + W：关闭当前标签</span><br><span class="line">Command + D： 水平分屏</span><br><span class="line">Command + Shift + D： 垂直分屏</span><br><span class="line">Command + K： 清屏</span><br><span class="line">Command + , ： 打开偏好设置</span><br><span class="line">Command + U：背景透明／不透明</span><br></pre></td></tr></table></figure>]]></content>
    
    
    <summary type="html">&lt;h2 id=&quot;终端命令介绍&quot;&gt;&lt;a href=&quot;#终端命令介绍&quot; class=&quot;headerlink&quot; title=&quot;终端命令介绍&quot;&gt;&lt;/a&gt;终端命令介绍&lt;/h2&gt;&lt;p&gt;终端命令可以完成可视化界面无法实现的功能。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://wangchujiang.com/linux-command/hot.html&quot;&gt;Linux命令大全&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&quot;终端常用命令&quot;&gt;&lt;a href=&quot;#终端常用命令&quot; class=&quot;headerlink&quot; title=&quot;终端常用命令&quot;&gt;&lt;/a&gt;终端常用命令&lt;/h2&gt;&lt;p&gt;可以使用&amp;amp;&amp;amp; 多行命令一起执行&lt;br&gt;cd 路径 &amp;amp;&amp;amp; touch 文件&lt;/p&gt;
&lt;p&gt;ls：查看当前所有文件&lt;br&gt;ls -a 查看当前所有文件（包含隐藏文件）&lt;br&gt;ls -l：查看所有文件详细信息&lt;br&gt;ls -la：查看所有文件详细信息（包含隐藏文件）&lt;/p&gt;
&lt;p&gt;cd：切换路径&lt;br&gt;cd ..&amp;#96;切换上级目录&lt;/p&gt;
&lt;p&gt;pwd：查看当前路径位置&lt;/p&gt;
&lt;p&gt;open 文件：文件 打开文件&lt;br&gt;open .：打开当前目录文件&lt;/p&gt;
&lt;p&gt;clear：清屏&lt;/p&gt;
&lt;p&gt;touch 文件：创建文件&lt;br&gt;mkdir 文件名：创建文件夹&lt;br&gt;rmdir 文件名：删除文件夹&lt;/p&gt;
&lt;p&gt;rm 文件：删除文件&lt;br&gt;cp 文件 路径：把xx复制到xx&lt;br&gt;mv 文件 路径：把xx移动到xx&lt;/p&gt;
&lt;p&gt;cat 文件：显示文件内容&lt;br&gt;less 文件：分页查看文件内容&lt;br&gt;vim 文件：文本编辑器&lt;/p&gt;
&lt;p&gt;chmod：修改权限&lt;br&gt;sudo 命令：使用管理员权限&lt;br&gt;sudo su：进入管理员模式，输入电脑密码&lt;/p&gt;</summary>
    
    
    
    <category term="Terminal" scheme="https://zoiii.cn/categories/Terminal/"/>
    
    
    <category term="Terminal" scheme="https://zoiii.cn/tags/Terminal/"/>
    
  </entry>
  
  <entry>
    <title>Git</title>
    <link href="https://zoiii.cn/2025/06/22/git/"/>
    <id>https://zoiii.cn/2025/06/22/git/</id>
    <published>2025-06-22T18:15:32.000Z</published>
    <updated>2025-08-02T04:24:51.582Z</updated>
    
    <content type="html"><![CDATA[<h2 id="Git介绍"><a href="#Git介绍" class="headerlink" title="Git介绍"></a>Git介绍</h2><p>Git官网：<a href="https://git-scm.com/">https://git-scm.com/</a></p><p>Git（工具）：本地版本控制系统 。</p><ul><li>项目代码变更历史（基于文件快照）</li><li>本地独立运作（无网仍可提交&#x2F;分支）</li><li>协作兼容（通过远程仓库同步变更）</li><li>分支独立开发线（默认主分支 main&#x2F;master）</li></ul><p>GitHub（平台）：云端Git仓库托管服务。</p><ul><li>智能协作（代码审查&#x2F;PR 流程）</li><li>安全云存储（代码+版本历史）</li><li>自动化工具（CI&#x2F;CD&#x2F;项目管理）</li><li>规模化代码共享与团队高效开发中枢</li></ul><h2 id="Git工作流程"><a href="#Git工作流程" class="headerlink" title="Git工作流程"></a>Git工作流程</h2><p><strong>Git三大区：工作区、暂存区、本地仓库</strong></p><p><strong>远程仓库：如 Githu 和 GitLab</strong></p><?xml version="1.0" encoding="UTF-8"?><p><svg xmlns:xlink="http://www.w3.org/1999/xlink" aria-roledescription="flowchart-v2" role="graphics-document document" viewBox="0 0 830.359375 117" style="max-width: 830.359375px;" class="flowchart" xmlns="http://www.w3.org/2000/svg" width="100%" id="mermaid-svg-6"><style>#mermaid-svg-6{font-family:”trebuchet ms”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-6 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-6 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-6 .error-icon{fill:#552222;}#mermaid-svg-6 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-6 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-6 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-6 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-6 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-6 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-6 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-6 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-6 .marker.cross{stroke:#333333;}#mermaid-svg-6 svg{font-family:”trebuchet ms”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-6 p{margin:0;}#mermaid-svg-6 .label{font-family:”trebuchet ms”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-6 .cluster-label text{fill:#333;}#mermaid-svg-6 .cluster-label span{color:#333;}#mermaid-svg-6 .cluster-label span p{background-color:transparent;}#mermaid-svg-6 .label text,#mermaid-svg-6 span{fill:#333;color:#333;}#mermaid-svg-6 .node rect,#mermaid-svg-6 .node circle,#mermaid-svg-6 .node ellipse,#mermaid-svg-6 .node polygon,#mermaid-svg-6 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-6 .rough-node .label text,#mermaid-svg-6 .node .label text,#mermaid-svg-6 .image-shape .label,#mermaid-svg-6 .icon-shape .label{text-anchor:middle;}#mermaid-svg-6 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-6 .rough-node .label,#mermaid-svg-6 .node .label,#mermaid-svg-6 .image-shape .label,#mermaid-svg-6 .icon-shape .label{text-align:center;}#mermaid-svg-6 .node.clickable{cursor:pointer;}#mermaid-svg-6 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-6 .arrowheadPath{fill:#333333;}#mermaid-svg-6 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-6 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-6 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-6 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-6 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-6 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-6 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-6 .cluster text{fill:#333;}#mermaid-svg-6 .cluster span{color:#333;}#mermaid-svg-6 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:”trebuchet ms”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-6 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-6 rect.text{fill:none;stroke-width:0;}#mermaid-svg-6 .icon-shape,#mermaid-svg-6 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-6 .icon-shape p,#mermaid-svg-6 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-6 .icon-shape rect,#mermaid-svg-6 .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-6 :root{–mermaid-font-family:”trebuchet ms”,verdana,arial,sans-serif;}</style><g><marker orient="auto" markerHeight="8" markerWidth="8" markerUnits="userSpaceOnUse" refY="5" refX="5" viewBox="0 0 10 10" class="marker flowchart-v2" id="mermaid-svg-6_flowchart-v2-pointEnd"><path style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 0 0 L 10 5 L 0 10 z"></path></marker><marker orient="auto" markerHeight="8" markerWidth="8" markerUnits="userSpaceOnUse" refY="5" refX="4.5" viewBox="0 0 10 10" class="marker flowchart-v2" id="mermaid-svg-6_flowchart-v2-pointStart"><path style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 0 5 L 10 10 L 10 0 z"></path></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5" refX="11" viewBox="0 0 10 10" class="marker flowchart-v2" id="mermaid-svg-6_flowchart-v2-circleEnd"><circle style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" r="5" cy="5" cx="5"></circle></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5" refX="-1" viewBox="0 0 10 10" class="marker flowchart-v2" id="mermaid-svg-6_flowchart-v2-circleStart"><circle style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" r="5" cy="5" cx="5"></circle></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5.2" refX="12" viewBox="0 0 11 11" class="marker cross flowchart-v2" id="mermaid-svg-6_flowchart-v2-crossEnd"><path style="stroke-width: 2; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 1,1 l 9,9 M 10,1 l -9,9"></path></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5.2" refX="-1" viewBox="0 0 11 11" class="marker cross flowchart-v2" id="mermaid-svg-6_flowchart-v2-crossStart"><path style="stroke-width: 2; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 1,1 l 9,9 M 10,1 l -9,9"></path></marker><g class="root"><g class="clusters"></g><g class="edgePaths"><path marker-end="url(#mermaid-svg-6_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_A_B_0" d="M132,48.839L140.333,46.532C148.665,44.226,165.331,39.613,181.329,37.306C197.328,35,212.66,35,220.326,35L227.992,35"></path><path marker-end="url(#mermaid-svg-6_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_B_C_0" d="M339.992,35L350.637,35C361.281,35,382.57,35,403.193,35C423.815,35,443.771,35,453.749,35L463.727,35"></path><path marker-end="url(#mermaid-svg-6_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_C_D_0" d="M591.727,35L600.613,35C609.499,35,627.271,35,644.399,37.216C661.527,39.431,678.012,43.863,686.254,46.079L694.497,48.294"></path><path marker-end="url(#mermaid-svg-6_flowchart-v2-pointEnd)" style="" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" id="L_D_A_0" d="M698.359,82.667L689.473,85.056C680.587,87.445,662.815,92.222,634.71,94.611C606.604,97,568.165,97,527.968,97C487.771,97,445.815,97,405.193,97C364.57,97,325.281,97,288.304,97C251.327,97,216.661,97,191.639,94.871C166.616,92.743,151.235,88.486,143.545,86.357L135.855,84.228"></path></g><g class="edgeLabels"><g transform="translate(181.99609375, 35)" class="edgeLabel"><g transform="translate(-24.99609375, -12)" class="label"><foreignObject height="24" width="49.9921875"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>git add</p></span></div></foreignObject></g></g><g transform="translate(403.859375, 35)" class="edgeLabel"><g transform="translate(-38.8671875, -12)" class="label"><foreignObject height="24" width="77.734375"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>git commit</p></span></div></foreignObject></g></g><g transform="translate(645.04296875, 35)" class="edgeLabel"><g transform="translate(-28.31640625, -12)" class="label"><foreignObject height="24" width="56.6328125"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>git push</p></span></div></foreignObject></g></g><g transform="translate(403.859375, 97)" class="edgeLabel"><g transform="translate(-25.42578125, -12)" class="label"><foreignObject height="24" width="50.8515625"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" class="labelBkg" xmlns="http://www.w3.org/1999/xhtml"><span class="edgeLabel"><p>git pull</p></span></div></foreignObject></g></g></g><g class="nodes"><g transform="translate(70, 66)" id="flowchart-A-0" class="node default"><rect height="54" width="124" y="-27" x="-62" style="" class="basic label-container"></rect><g transform="translate(-32, -12)" style="" class="label"><rect></rect><foreignObject height="24" width="64"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" xmlns="http://www.w3.org/1999/xhtml"><span class="nodeLabel"><p>工作区</p></span></div></foreignObject></g></g><g transform="translate(285.9921875, 35)" id="flowchart-B-1" class="node default"><rect height="54" width="108" y="-27" x="-54" style="" class="basic label-container"></rect><g transform="translate(-24, -12)" style="" class="label"><rect></rect><foreignObject height="24" width="48"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" xmlns="http://www.w3.org/1999/xhtml"><span class="nodeLabel"><p>暂存区</p></span></div></foreignObject></g></g><g transform="translate(529.7265625, 35)" id="flowchart-C-3" class="node default"><rect height="54" width="124" y="-27" x="-62" style="" class="basic label-container"></rect><g transform="translate(-32, -12)" style="" class="label"><rect></rect><foreignObject height="24" width="64"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" xmlns="http://www.w3.org/1999/xhtml"><span class="nodeLabel"><p>本地仓库</p></span></div></foreignObject></g></g><g transform="translate(760.359375, 66)" id="flowchart-D-5" class="node default"><rect height="54" width="124" y="-27" x="-62" style="" class="basic label-container"></rect><g transform="translate(-32, -12)" style="" class="label"><rect></rect><foreignObject height="24" width="64"><div style="display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;" xmlns="http://www.w3.org/1999/xhtml"><span class="nodeLabel"><p>远程仓库</p></span></div></foreignObject></g></g></g></g></g></svg></p><p><strong>工作区</strong>：对代码进行修改</p><p><strong>暂存区</strong>：临时存放一个或多个待提交的内容<br>添加目录下所有文件</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git add .</span><br></pre></td></tr></table></figure><p>或 添加单个文件</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git add 文件</span><br></pre></td></tr></table></figure><p><strong>本地仓库</strong>：暂存区内容 添加” 提交说明” 提交到本地仓库</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git commit -m &quot;提交说明&quot;</span><br></pre></td></tr></table></figure><p><strong>推送远程</strong>： 将本地仓库内容提交同步到远程仓库。</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git push</span><br></pre></td></tr></table></figure><p><strong>拉取更新</strong>：获取远程仓库最新代码并合并。</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git pull</span><br></pre></td></tr></table></figure><span id="more"></span><h2 id="Git的安装"><a href="#Git的安装" class="headerlink" title="Git的安装"></a>Git的安装</h2><p>Git 官方下载：<a href="https://git-scm.com/downloads">https://git-scm.com/downloads</a><br>Homebrew 官方下载：<a href="https://brew.sh/zh-cn/">https://brew.sh/zh-cn/</a></p><ol><li><p>安装 Homebrew</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/bin/bash -c &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&quot;</span><br></pre></td></tr></table></figure></li><li><p>用 Homebrew 安装 Git</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">brew install git</span><br></pre></td></tr></table></figure></li></ol><h2 id="Git-命令"><a href="#Git-命令" class="headerlink" title="Git 命令"></a>Git 命令</h2><p>查看命令详细文档</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git help &lt;command&gt;</span><br></pre></td></tr></table></figure><h3 id="常用命令"><a href="#常用命令" class="headerlink" title="常用命令"></a>常用命令</h3><p>查看工作区&#x2F;暂存区状态</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git status</span><br></pre></td></tr></table></figure><p>添加文件到暂存区<br>添加目录下所有文件</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git add .</span><br></pre></td></tr></table></figure><p>或 添加单个文件</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git add 文件</span><br></pre></td></tr></table></figure><p>提交暂存区内容到本地仓库 </p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git commit -m &quot;提交说明&quot;</span><br></pre></td></tr></table></figure><p>推送远程仓库</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git push    </span><br></pre></td></tr></table></figure><p>拉取远程更新</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git pull</span><br></pre></td></tr></table></figure><p>克隆远程仓库</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git clone url</span><br></pre></td></tr></table></figure><h3 id="仓库操作"><a href="#仓库操作" class="headerlink" title="仓库操作"></a>仓库操作</h3><h4 id="初始化-新仓库"><a href="#初始化-新仓库" class="headerlink" title="初始化 新仓库"></a>初始化 新仓库</h4><p>创建 .git 目录</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git init 仓库名</span><br></pre></td></tr></table></figure><h4 id="隆远程仓库-到本地"><a href="#隆远程仓库-到本地" class="headerlink" title="隆远程仓库 到本地"></a>隆远程仓库 到本地</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git clone 链接</span><br></pre></td></tr></table></figure><h4 id="看已配置的-远程仓库"><a href="#看已配置的-远程仓库" class="headerlink" title="看已配置的 远程仓库"></a>看已配置的 远程仓库</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git remote -v</span><br></pre></td></tr></table></figure><h3 id="提交与修改"><a href="#提交与修改" class="headerlink" title="提交与修改"></a>提交与修改</h3><h4 id="添加文件到-暂存区"><a href="#添加文件到-暂存区" class="headerlink" title="添加文件到 暂存区"></a>添加文件到 暂存区</h4><p>添加目录下所有文件</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git add .</span><br></pre></td></tr></table></figure><p>或 添加单个文件</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git add 文件</span><br></pre></td></tr></table></figure><h4 id="提交暂存区内容-到本地仓库"><a href="#提交暂存区内容-到本地仓库" class="headerlink" title="提交暂存区内容 到本地仓库"></a>提交暂存区内容 到本地仓库</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git commit -m &quot;提交说明&quot;</span><br></pre></td></tr></table></figure><h4 id="查看-工作区-暂存区-状态"><a href="#查看-工作区-暂存区-状态" class="headerlink" title="查看 工作区&#x2F;暂存区 状态"></a>查看 工作区&#x2F;暂存区 状态</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git status</span><br></pre></td></tr></table></figure><h4 id="查看-工作区与暂存区-差异"><a href="#查看-工作区与暂存区-差异" class="headerlink" title="查看 工作区与暂存区 差异"></a>查看 工作区与暂存区 差异</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git diff</span><br></pre></td></tr></table></figure><h4 id="查看-暂存区与最新提交-差异"><a href="#查看-暂存区与最新提交-差异" class="headerlink" title="查看 暂存区与最新提交 差异"></a>查看 暂存区与最新提交 差异</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git diff --staged</span><br></pre></td></tr></table></figure><h4 id="丢弃工作区修改"><a href="#丢弃工作区修改" class="headerlink" title="丢弃工作区修改"></a>丢弃工作区修改</h4><p>（Git 2.23+）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git restore &lt;file&gt;</span><br></pre></td></tr></table></figure><h4 id="移出暂存区"><a href="#移出暂存区" class="headerlink" title="移出暂存区"></a>移出暂存区</h4><p>（保留工作区修改）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git restore --staged &lt;file&gt;</span><br></pre></td></tr></table></figure><h3 id="分支管理"><a href="#分支管理" class="headerlink" title="分支管理"></a>分支管理</h3><h4 id="查看本地分支"><a href="#查看本地分支" class="headerlink" title="查看本地分支"></a>查看本地分支</h4><p>（-a 查看所有分支）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git branch</span><br></pre></td></tr></table></figure><h4 id="创建新分支"><a href="#创建新分支" class="headerlink" title="创建新分支"></a>创建新分支</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git branch &lt;name&gt;</span><br></pre></td></tr></table></figure><h4 id="切换分支"><a href="#切换分支" class="headerlink" title="切换分支"></a>切换分支</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git checkout</span><br></pre></td></tr></table></figure><h4 id="创建并切换分支"><a href="#创建并切换分支" class="headerlink" title="创建并切换分支"></a>创建并切换分支</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git checkout -b &lt;branch&gt;</span><br></pre></td></tr></table></figure><h4 id="合并分支到当前分支"><a href="#合并分支到当前分支" class="headerlink" title="合并分支到当前分支"></a>合并分支到当前分支</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git merge &lt;branch&gt;</span><br></pre></td></tr></table></figure><h4 id="变基分支"><a href="#变基分支" class="headerlink" title="变基分支"></a>变基分支</h4><p>（重写提交历史）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git rebase &lt;branch&gt;</span><br></pre></td></tr></table></figure><h4 id="删除分支"><a href="#删除分支" class="headerlink" title="删除分支"></a>删除分支</h4><p>（-D 强制删除）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git branch -d &lt;branch&gt;</span><br></pre></td></tr></table></figure><h3 id="历史与回退"><a href="#历史与回退" class="headerlink" title="历史与回退"></a>历史与回退</h3><h4 id="查看-提交历史"><a href="#查看-提交历史" class="headerlink" title="查看 提交历史"></a>查看 提交历史</h4><p>（–oneline 简化显示）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git log</span><br></pre></td></tr></table></figure><h4 id="查看-历史详细修改内容"><a href="#查看-历史详细修改内容" class="headerlink" title="查看 历史详细修改内容"></a>查看 历史详细修改内容</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git log -p</span><br></pre></td></tr></table></figure><h4 id="查看-文件每行修改者"><a href="#查看-文件每行修改者" class="headerlink" title="查看 文件每行修改者"></a>查看 文件每行修改者</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git blame &lt;file&gt;</span><br></pre></td></tr></table></figure><h4 id="回退到指定提交"><a href="#回退到指定提交" class="headerlink" title="回退到指定提交"></a>回退到指定提交</h4><p>（–soft 保留修改，–hard 彻底丢弃慎用！）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git reset &lt;commit&gt;</span><br></pre></td></tr></table></figure><h4 id="撤销指定提交"><a href="#撤销指定提交" class="headerlink" title="撤销指定提交"></a>撤销指定提交</h4><p>（生成新提交，安全回退）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git revert &lt;commit&gt;</span><br></pre></td></tr></table></figure><h3 id="远程协作"><a href="#远程协作" class="headerlink" title="远程协作"></a>远程协作</h3><h4 id="下载远程更新"><a href="#下载远程更新" class="headerlink" title="下载远程更新"></a>下载远程更新</h4><p>（不自动合并）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git fetch</span><br></pre></td></tr></table></figure><h4 id="推送本地提交到远程分支"><a href="#推送本地提交到远程分支" class="headerlink" title="推送本地提交到远程分支"></a>推送本地提交到远程分支</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git push</span><br></pre></td></tr></table></figure><h4 id="拉取远程更新并合并"><a href="#拉取远程更新并合并" class="headerlink" title="拉取远程更新并合并"></a>拉取远程更新并合并</h4><p>（&#x3D; fetch + merge）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git pull</span><br></pre></td></tr></table></figure><h4 id="首次推送并设置上游分支"><a href="#首次推送并设置上游分支" class="headerlink" title="首次推送并设置上游分支"></a>首次推送并设置上游分支</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git push -u origin &lt;branch&gt;</span><br></pre></td></tr></table></figure><h4 id="强制推送"><a href="#强制推送" class="headerlink" title="强制推送"></a>强制推送</h4><p>（覆盖远程历史慎用！）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git push --force</span><br></pre></td></tr></table></figure><h3 id="高级工具"><a href="#高级工具" class="headerlink" title="高级工具"></a>高级工具</h3><h4 id="临时保存工作区修改"><a href="#临时保存工作区修改" class="headerlink" title="临时保存工作区修改"></a>临时保存工作区修改</h4><p>（切换分支救星）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git stash</span><br></pre></td></tr></table></figure><h4 id="恢复最近保存的工作区"><a href="#恢复最近保存的工作区" class="headerlink" title="恢复最近保存的工作区"></a>恢复最近保存的工作区</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git stash pop</span><br></pre></td></tr></table></figure><h4 id="创建标签"><a href="#创建标签" class="headerlink" title="创建标签"></a>创建标签</h4><p>（标记版本）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git tag &lt;name&gt;</span><br></pre></td></tr></table></figure><h4 id="二分查找定位问题提交"><a href="#二分查找定位问题提交" class="headerlink" title="二分查找定位问题提交"></a>二分查找定位问题提交</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git bisect</span><br></pre></td></tr></table></figure><h4 id="复制指定提交到当前分支"><a href="#复制指定提交到当前分支" class="headerlink" title="复制指定提交到当前分支"></a>复制指定提交到当前分支</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git cherry-pick &lt;commit&gt;</span><br></pre></td></tr></table></figure><h3 id="全局配置"><a href="#全局配置" class="headerlink" title="全局配置"></a>全局配置</h3><h4 id="设置全局用户名"><a href="#设置全局用户名" class="headerlink" title="设置全局用户名"></a>设置全局用户名</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git config --global user.name &quot;xxx&quot;</span><br></pre></td></tr></table></figure><h4 id="设置全局邮箱"><a href="#设置全局邮箱" class="headerlink" title="设置全局邮箱"></a>设置全局邮箱</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git config --global user.email &quot;xxx&quot;</span><br></pre></td></tr></table></figure><h2 id="Git-图形化工具"><a href="#Git-图形化工具" class="headerlink" title="Git 图形化工具"></a>Git 图形化工具</h2><p>Git 图形化工具：</p><p><a href="https://chat.deepseek.com/a/chat/s/504273d4-b5e7-4387-be9e-c3878a7a2c52">GitKraken（跨平台）</a></p><p><a href="https://www.sourcetreeapp.com/">Sourcetree（Win&#x2F;Mac）</a></p>]]></content>
    
    
    <summary type="html">&lt;h2 id=&quot;Git介绍&quot;&gt;&lt;a href=&quot;#Git介绍&quot; class=&quot;headerlink&quot; title=&quot;Git介绍&quot;&gt;&lt;/a&gt;Git介绍&lt;/h2&gt;&lt;p&gt;Git官网：&lt;a href=&quot;https://git-scm.com/&quot;&gt;https://git-scm.com/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Git（工具）：本地版本控制系统 。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;项目代码变更历史（基于文件快照）&lt;/li&gt;
&lt;li&gt;本地独立运作（无网仍可提交&amp;#x2F;分支）&lt;/li&gt;
&lt;li&gt;协作兼容（通过远程仓库同步变更）&lt;/li&gt;
&lt;li&gt;分支独立开发线（默认主分支 main&amp;#x2F;master）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;GitHub（平台）：云端Git仓库托管服务。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;智能协作（代码审查&amp;#x2F;PR 流程）&lt;/li&gt;
&lt;li&gt;安全云存储（代码+版本历史）&lt;/li&gt;
&lt;li&gt;自动化工具（CI&amp;#x2F;CD&amp;#x2F;项目管理）&lt;/li&gt;
&lt;li&gt;规模化代码共享与团队高效开发中枢&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;Git工作流程&quot;&gt;&lt;a href=&quot;#Git工作流程&quot; class=&quot;headerlink&quot; title=&quot;Git工作流程&quot;&gt;&lt;/a&gt;Git工作流程&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Git三大区：工作区、暂存区、本地仓库&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;远程仓库：如 Githu 和 GitLab&lt;/strong&gt;&lt;/p&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;

&lt;p&gt;&lt;svg xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; aria-roledescription=&quot;flowchart-v2&quot; role=&quot;graphics-document document&quot; viewBox=&quot;0 0 830.359375 117&quot; style=&quot;max-width: 830.359375px;&quot; class=&quot;flowchart&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;100%&quot; id=&quot;mermaid-svg-6&quot;&gt;&lt;style&gt;#mermaid-svg-6{font-family:”trebuchet ms”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-6 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-6 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-6 .error-icon{fill:#552222;}#mermaid-svg-6 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-6 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-6 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-6 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-6 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-6 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-6 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-6 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-6 .marker.cross{stroke:#333333;}#mermaid-svg-6 svg{font-family:”trebuchet ms”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-6 p{margin:0;}#mermaid-svg-6 .label{font-family:”trebuchet ms”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-6 .cluster-label text{fill:#333;}#mermaid-svg-6 .cluster-label span{color:#333;}#mermaid-svg-6 .cluster-label span p{background-color:transparent;}#mermaid-svg-6 .label text,#mermaid-svg-6 span{fill:#333;color:#333;}#mermaid-svg-6 .node rect,#mermaid-svg-6 .node circle,#mermaid-svg-6 .node ellipse,#mermaid-svg-6 .node polygon,#mermaid-svg-6 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-6 .rough-node .label text,#mermaid-svg-6 .node .label text,#mermaid-svg-6 .image-shape .label,#mermaid-svg-6 .icon-shape .label{text-anchor:middle;}#mermaid-svg-6 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-6 .rough-node .label,#mermaid-svg-6 .node .label,#mermaid-svg-6 .image-shape .label,#mermaid-svg-6 .icon-shape .label{text-align:center;}#mermaid-svg-6 .node.clickable{cursor:pointer;}#mermaid-svg-6 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-6 .arrowheadPath{fill:#333333;}#mermaid-svg-6 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-6 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-6 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-6 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-6 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-6 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-6 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-6 .cluster text{fill:#333;}#mermaid-svg-6 .cluster span{color:#333;}#mermaid-svg-6 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:”trebuchet ms”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-6 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-6 rect.text{fill:none;stroke-width:0;}#mermaid-svg-6 .icon-shape,#mermaid-svg-6 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-6 .icon-shape p,#mermaid-svg-6 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-6 .icon-shape rect,#mermaid-svg-6 .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-6 :root{–mermaid-font-family:”trebuchet ms”,verdana,arial,sans-serif;}&lt;/style&gt;&lt;g&gt;&lt;marker orient=&quot;auto&quot; markerHeight=&quot;8&quot; markerWidth=&quot;8&quot; markerUnits=&quot;userSpaceOnUse&quot; refY=&quot;5&quot; refX=&quot;5&quot; viewBox=&quot;0 0 10 10&quot; class=&quot;marker flowchart-v2&quot; id=&quot;mermaid-svg-6_flowchart-v2-pointEnd&quot;&gt;&lt;path style=&quot;stroke-width: 1; stroke-dasharray: 1, 0;&quot; class=&quot;arrowMarkerPath&quot; d=&quot;M 0 0 L 10 5 L 0 10 z&quot;&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker orient=&quot;auto&quot; markerHeight=&quot;8&quot; markerWidth=&quot;8&quot; markerUnits=&quot;userSpaceOnUse&quot; refY=&quot;5&quot; refX=&quot;4.5&quot; viewBox=&quot;0 0 10 10&quot; class=&quot;marker flowchart-v2&quot; id=&quot;mermaid-svg-6_flowchart-v2-pointStart&quot;&gt;&lt;path style=&quot;stroke-width: 1; stroke-dasharray: 1, 0;&quot; class=&quot;arrowMarkerPath&quot; d=&quot;M 0 5 L 10 10 L 10 0 z&quot;&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker orient=&quot;auto&quot; markerHeight=&quot;11&quot; markerWidth=&quot;11&quot; markerUnits=&quot;userSpaceOnUse&quot; refY=&quot;5&quot; refX=&quot;11&quot; viewBox=&quot;0 0 10 10&quot; class=&quot;marker flowchart-v2&quot; id=&quot;mermaid-svg-6_flowchart-v2-circleEnd&quot;&gt;&lt;circle style=&quot;stroke-width: 1; stroke-dasharray: 1, 0;&quot; class=&quot;arrowMarkerPath&quot; r=&quot;5&quot; cy=&quot;5&quot; cx=&quot;5&quot;&gt;&lt;/circle&gt;&lt;/marker&gt;&lt;marker orient=&quot;auto&quot; markerHeight=&quot;11&quot; markerWidth=&quot;11&quot; markerUnits=&quot;userSpaceOnUse&quot; refY=&quot;5&quot; refX=&quot;-1&quot; viewBox=&quot;0 0 10 10&quot; class=&quot;marker flowchart-v2&quot; id=&quot;mermaid-svg-6_flowchart-v2-circleStart&quot;&gt;&lt;circle style=&quot;stroke-width: 1; stroke-dasharray: 1, 0;&quot; class=&quot;arrowMarkerPath&quot; r=&quot;5&quot; cy=&quot;5&quot; cx=&quot;5&quot;&gt;&lt;/circle&gt;&lt;/marker&gt;&lt;marker orient=&quot;auto&quot; markerHeight=&quot;11&quot; markerWidth=&quot;11&quot; markerUnits=&quot;userSpaceOnUse&quot; refY=&quot;5.2&quot; refX=&quot;12&quot; viewBox=&quot;0 0 11 11&quot; class=&quot;marker cross flowchart-v2&quot; id=&quot;mermaid-svg-6_flowchart-v2-crossEnd&quot;&gt;&lt;path style=&quot;stroke-width: 2; stroke-dasharray: 1, 0;&quot; class=&quot;arrowMarkerPath&quot; d=&quot;M 1,1 l 9,9 M 10,1 l -9,9&quot;&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker orient=&quot;auto&quot; markerHeight=&quot;11&quot; markerWidth=&quot;11&quot; markerUnits=&quot;userSpaceOnUse&quot; refY=&quot;5.2&quot; refX=&quot;-1&quot; viewBox=&quot;0 0 11 11&quot; class=&quot;marker cross flowchart-v2&quot; id=&quot;mermaid-svg-6_flowchart-v2-crossStart&quot;&gt;&lt;path style=&quot;stroke-width: 2; stroke-dasharray: 1, 0;&quot; class=&quot;arrowMarkerPath&quot; d=&quot;M 1,1 l 9,9 M 10,1 l -9,9&quot;&gt;&lt;/path&gt;&lt;/marker&gt;&lt;g class=&quot;root&quot;&gt;&lt;g class=&quot;clusters&quot;&gt;&lt;/g&gt;&lt;g class=&quot;edgePaths&quot;&gt;&lt;path marker-end=&quot;url(#mermaid-svg-6_flowchart-v2-pointEnd)&quot; style=&quot;&quot; class=&quot;edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link&quot; id=&quot;L_A_B_0&quot; d=&quot;M132,48.839L140.333,46.532C148.665,44.226,165.331,39.613,181.329,37.306C197.328,35,212.66,35,220.326,35L227.992,35&quot;&gt;&lt;/path&gt;&lt;path marker-end=&quot;url(#mermaid-svg-6_flowchart-v2-pointEnd)&quot; style=&quot;&quot; class=&quot;edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link&quot; id=&quot;L_B_C_0&quot; d=&quot;M339.992,35L350.637,35C361.281,35,382.57,35,403.193,35C423.815,35,443.771,35,453.749,35L463.727,35&quot;&gt;&lt;/path&gt;&lt;path marker-end=&quot;url(#mermaid-svg-6_flowchart-v2-pointEnd)&quot; style=&quot;&quot; class=&quot;edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link&quot; id=&quot;L_C_D_0&quot; d=&quot;M591.727,35L600.613,35C609.499,35,627.271,35,644.399,37.216C661.527,39.431,678.012,43.863,686.254,46.079L694.497,48.294&quot;&gt;&lt;/path&gt;&lt;path marker-end=&quot;url(#mermaid-svg-6_flowchart-v2-pointEnd)&quot; style=&quot;&quot; class=&quot;edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link&quot; id=&quot;L_D_A_0&quot; d=&quot;M698.359,82.667L689.473,85.056C680.587,87.445,662.815,92.222,634.71,94.611C606.604,97,568.165,97,527.968,97C487.771,97,445.815,97,405.193,97C364.57,97,325.281,97,288.304,97C251.327,97,216.661,97,191.639,94.871C166.616,92.743,151.235,88.486,143.545,86.357L135.855,84.228&quot;&gt;&lt;/path&gt;&lt;/g&gt;&lt;g class=&quot;edgeLabels&quot;&gt;&lt;g transform=&quot;translate(181.99609375, 35)&quot; class=&quot;edgeLabel&quot;&gt;&lt;g transform=&quot;translate(-24.99609375, -12)&quot; class=&quot;label&quot;&gt;&lt;foreignObject height=&quot;24&quot; width=&quot;49.9921875&quot;&gt;&lt;div style=&quot;display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;&quot; class=&quot;labelBkg&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;span class=&quot;edgeLabel&quot;&gt;&lt;p&gt;git add&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g transform=&quot;translate(403.859375, 35)&quot; class=&quot;edgeLabel&quot;&gt;&lt;g transform=&quot;translate(-38.8671875, -12)&quot; class=&quot;label&quot;&gt;&lt;foreignObject height=&quot;24&quot; width=&quot;77.734375&quot;&gt;&lt;div style=&quot;display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;&quot; class=&quot;labelBkg&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;span class=&quot;edgeLabel&quot;&gt;&lt;p&gt;git commit&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g transform=&quot;translate(645.04296875, 35)&quot; class=&quot;edgeLabel&quot;&gt;&lt;g transform=&quot;translate(-28.31640625, -12)&quot; class=&quot;label&quot;&gt;&lt;foreignObject height=&quot;24&quot; width=&quot;56.6328125&quot;&gt;&lt;div style=&quot;display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;&quot; class=&quot;labelBkg&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;span class=&quot;edgeLabel&quot;&gt;&lt;p&gt;git push&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g transform=&quot;translate(403.859375, 97)&quot; class=&quot;edgeLabel&quot;&gt;&lt;g transform=&quot;translate(-25.42578125, -12)&quot; class=&quot;label&quot;&gt;&lt;foreignObject height=&quot;24&quot; width=&quot;50.8515625&quot;&gt;&lt;div style=&quot;display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;&quot; class=&quot;labelBkg&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;span class=&quot;edgeLabel&quot;&gt;&lt;p&gt;git pull&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class=&quot;nodes&quot;&gt;&lt;g transform=&quot;translate(70, 66)&quot; id=&quot;flowchart-A-0&quot; class=&quot;node default&quot;&gt;&lt;rect height=&quot;54&quot; width=&quot;124&quot; y=&quot;-27&quot; x=&quot;-62&quot; style=&quot;&quot; class=&quot;basic label-container&quot;&gt;&lt;/rect&gt;&lt;g transform=&quot;translate(-32, -12)&quot; style=&quot;&quot; class=&quot;label&quot;&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject height=&quot;24&quot; width=&quot;64&quot;&gt;&lt;div style=&quot;display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;span class=&quot;nodeLabel&quot;&gt;&lt;p&gt;工作区&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g transform=&quot;translate(285.9921875, 35)&quot; id=&quot;flowchart-B-1&quot; class=&quot;node default&quot;&gt;&lt;rect height=&quot;54&quot; width=&quot;108&quot; y=&quot;-27&quot; x=&quot;-54&quot; style=&quot;&quot; class=&quot;basic label-container&quot;&gt;&lt;/rect&gt;&lt;g transform=&quot;translate(-24, -12)&quot; style=&quot;&quot; class=&quot;label&quot;&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject height=&quot;24&quot; width=&quot;48&quot;&gt;&lt;div style=&quot;display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;span class=&quot;nodeLabel&quot;&gt;&lt;p&gt;暂存区&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g transform=&quot;translate(529.7265625, 35)&quot; id=&quot;flowchart-C-3&quot; class=&quot;node default&quot;&gt;&lt;rect height=&quot;54&quot; width=&quot;124&quot; y=&quot;-27&quot; x=&quot;-62&quot; style=&quot;&quot; class=&quot;basic label-container&quot;&gt;&lt;/rect&gt;&lt;g transform=&quot;translate(-32, -12)&quot; style=&quot;&quot; class=&quot;label&quot;&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject height=&quot;24&quot; width=&quot;64&quot;&gt;&lt;div style=&quot;display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;span class=&quot;nodeLabel&quot;&gt;&lt;p&gt;本地仓库&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g transform=&quot;translate(760.359375, 66)&quot; id=&quot;flowchart-D-5&quot; class=&quot;node default&quot;&gt;&lt;rect height=&quot;54&quot; width=&quot;124&quot; y=&quot;-27&quot; x=&quot;-62&quot; style=&quot;&quot; class=&quot;basic label-container&quot;&gt;&lt;/rect&gt;&lt;g transform=&quot;translate(-32, -12)&quot; style=&quot;&quot; class=&quot;label&quot;&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject height=&quot;24&quot; width=&quot;64&quot;&gt;&lt;div style=&quot;display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;span class=&quot;nodeLabel&quot;&gt;&lt;p&gt;远程仓库&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;工作区&lt;/strong&gt;：对代码进行修改&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;暂存区&lt;/strong&gt;：临时存放一个或多个待提交的内容&lt;br&gt;添加目录下所有文件&lt;/p&gt;
&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;git add .&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;

&lt;p&gt;或 添加单个文件&lt;/p&gt;
&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;git add 文件&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;本地仓库&lt;/strong&gt;：暂存区内容 添加” 提交说明” 提交到本地仓库&lt;/p&gt;
&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;git commit -m &amp;quot;提交说明&amp;quot;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;推送远程&lt;/strong&gt;： 将本地仓库内容提交同步到远程仓库。&lt;/p&gt;
&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;git push&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;拉取更新&lt;/strong&gt;：获取远程仓库最新代码并合并。&lt;/p&gt;
&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;git pull&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;</summary>
    
    
    
    <category term="Git" scheme="https://zoiii.cn/categories/Git/"/>
    
    
    <category term="Git" scheme="https://zoiii.cn/tags/Git/"/>
    
  </entry>
  
  <entry>
    <title>Hexo Blog</title>
    <link href="https://zoiii.cn/2025/06/16/hexo-blog/"/>
    <id>https://zoiii.cn/2025/06/16/hexo-blog/</id>
    <published>2025-06-16T16:21:27.000Z</published>
    <updated>2025-08-02T04:24:51.582Z</updated>
    
    <content type="html"><![CDATA[<h2 id="Hexo介绍"><a href="#Hexo介绍" class="headerlink" title="Hexo介绍"></a>Hexo介绍</h2><p>Hexo 是一个基于 Node.js 的快速、简洁且高效的博客框架，用 Markdown 写作，插件和主题多，可快速搭建个人博客。</p><h2 id="安装-Node-js"><a href="#安装-Node-js" class="headerlink" title="安装 Node.js"></a>安装 Node.js</h2><p>Hexo 的运行环境</p><p><a href="https://nodejs.org/zh-cn/download">https://nodejs.org/zh-cn/download</a></p><p>选择LTS稳定正式版</p><p>检查是否安装成功</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">node -v &amp;&amp; npm -v</span><br></pre></td></tr></table></figure><h2 id="安装-Git"><a href="#安装-Git" class="headerlink" title="安装 Git"></a>安装 Git</h2><p><a href="https://git-scm.com/downloads">https://git-scm.com/downloads</a></p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">brew install git</span><br></pre></td></tr></table></figure><p>检查是否安装成功</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git -v</span><br></pre></td></tr></table></figure><h2 id="安装-Hexo"><a href="#安装-Hexo" class="headerlink" title="安装 Hexo"></a>安装 Hexo</h2><p><a href="https://hexo.io/zh-cn/">https://hexo.io/zh-cn/</a></p><p>npm 全局安装 Hexo</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install -g hexo-cli</span><br></pre></td></tr></table></figure><p>检查是否安装成功</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo -v</span><br></pre></td></tr></table></figure><h2 id="搭建-Hexo-博客"><a href="#搭建-Hexo-博客" class="headerlink" title="搭建 Hexo 博客"></a>搭建 Hexo 博客</h2><h3 id="初始化博客"><a href="#初始化博客" class="headerlink" title="初始化博客"></a>初始化博客</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo init 自定义文件名</span><br></pre></td></tr></table></figure><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cd 自定义文件名</span><br></pre></td></tr></table></figure><p>安装依赖</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install</span><br></pre></td></tr></table></figure><p> 启动本地服务器</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">hexo s</span><br></pre></td></tr></table></figure><p>访问 <a href="http://localhost:4000/">http://localhost:4000</a> 查看</p><p>初始化后文件结构</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">自定义文件名</span><br><span class="line">├── _config.yml Hexo配置文件</span><br><span class="line">├── package.json #项目信息</span><br><span class="line">├── scaffolds</span><br><span class="line">├── source #存放页面和文章，_posts里存放文章</span><br><span class="line">|   ├── _drafts</span><br><span class="line">|   └── _posts</span><br><span class="line">└── themes #存放主题</span><br></pre></td></tr></table></figure><span id="more"></span><h3 id="核心操作命令"><a href="#核心操作命令" class="headerlink" title="核心操作命令"></a>核心操作命令</h3><p>创建新文章</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo new &quot;文章名&quot;</span><br></pre></td></tr></table></figure><p>创建新页面</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo new page &quot;页面名&quot;</span><br></pre></td></tr></table></figure><p>hexo clean 清除缓存和生成文件</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo cl</span><br></pre></td></tr></table></figure><p> hexo generate 生成静态文件</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo g</span><br></pre></td></tr></table></figure><p>hexo server 启动本地服务器</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo s</span><br></pre></td></tr></table></figure><p>hexo deploy 部署到服务器</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo d</span><br></pre></td></tr></table></figure><p>修改后内容后，可以使用以下命令清理缓存重新生成静态文件并启动服务器</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo cl &amp;&amp; hexo g &amp;&amp; hexo s</span><br></pre></td></tr></table></figure><h3 id="修改配置"><a href="#修改配置" class="headerlink" title="修改配置"></a>修改配置</h3><p>网站配置</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"># Site</span><br><span class="line">title: KZero&#x27;s Blog #网站标题</span><br><span class="line">subtitle: &#x27;Accumulation record&#x27; # 网站副标题</span><br><span class="line">description: &#x27;好记性不如烂键盘&#x27; # 网站描述</span><br><span class="line">keywords: KZero Blog # 网站关键字，支持多个关键词</span><br><span class="line">author: CodeKZero # 您的名字</span><br><span class="line">language: en #zh-CN # 网站使用的语言</span><br><span class="line">timezone: &#x27;&#x27;</span><br></pre></td></tr></table></figure><p>URL配置</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">url: http://zoiii.cn</span><br></pre></td></tr></table></figure><p>highlight配置（新版本可能缺少 enable: true 而无法使用）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">highlight:</span><br><span class="line">  line_number: true</span><br><span class="line">  auto_detect: false</span><br><span class="line">  tab_replace: &#x27;&#x27;</span><br><span class="line">  wrap: true</span><br><span class="line">  hljs: false</span><br></pre></td></tr></table></figure><p>修改</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">highlight:</span><br><span class="line">  enable: true</span><br><span class="line">  line_number: true</span><br><span class="line">  auto_detect: false</span><br><span class="line">  tab_replace: &#x27;&#x27;</span><br><span class="line">  wrap: true</span><br><span class="line">  hljs: false</span><br></pre></td></tr></table></figure><p>Live2D配置</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br></pre></td><td class="code"><pre><span class="line"># Live2D</span><br><span class="line"># https://github.com/EYHN/hexo-helper-live2d</span><br><span class="line">live2d:</span><br><span class="line">  enable: true</span><br><span class="line">  scriptFrom: local # 默认</span><br><span class="line">  pluginRootPath: live2dw/ # 插件在站点上的根目录(相对路径)</span><br><span class="line">  pluginJsPath: lib/ # 脚本文件相对与插件根目录路径</span><br><span class="line">  pluginModelPath: assets/ # 模型文件相对与插件根目录路径</span><br><span class="line">  # scriptFrom: jsdelivr # jsdelivr CDN</span><br><span class="line">  # scriptFrom: unpkg # unpkg CDN</span><br><span class="line">  # scriptFrom: https://cdn.jsdelivr.net/npm/live2d-widget@3.x/lib/L2Dwidget.min.js # 你的自定义 url</span><br><span class="line">  tagMode: false # 标签模式, 是否仅替换 live2d tag标签而非插入到所有页面中</span><br><span class="line">  debug: false # 调试, 是否在控制台输出日志</span><br><span class="line">  model:</span><br><span class="line">    # use: live2d-widget-model-hijiki # npm-module package name</span><br><span class="line">    use: PLT  #wanko # 博客根目录/live2d_models/ 下的目录名</span><br><span class="line">    # use: ./wives/wanko # 相对于博客根目录的路径</span><br><span class="line">    # use: https://cdn.jsdelivr.net/npm/live2d-widget-model-wanko@1.0.5/assets/wanko.model.json # 你的自定义 url</span><br><span class="line">  display:</span><br><span class="line">    position: right</span><br><span class="line">    width: 280</span><br><span class="line">    height: 426</span><br><span class="line">    superSample: 2 #超级样本</span><br><span class="line">    hOffset: -82 #偏移量</span><br><span class="line">    vOffset: -82 #垂直偏移</span><br><span class="line">    # 互动增强配置</span><br><span class="line">    # click: true       # 开启点击互动</span><br><span class="line">    # mouseover: true   # 开启鼠标悬停互动</span><br><span class="line">    # auto: true        # 自动播放待机动作</span><br><span class="line">    # hover: true       # 显示互动提示文字</span><br><span class="line">    # hoverTips:        # 自定义提示文字</span><br><span class="line">    #   default: &quot;想和我玩吗？&quot;</span><br><span class="line">    #   touch: &quot;哎呀！别碰我！&quot;</span><br><span class="line">    #   click: &quot;点击我有惊喜哦~&quot;</span><br><span class="line">  mobile:</span><br><span class="line">    show: false # 手机中是否展示</span><br><span class="line">    scale: 0.6 # 移动设备上的缩放   </span><br><span class="line">    hHeadPos: 0.2 # 在移动设备上水平方向头部位置调整 (百分比，影响模型在屏幕上的水平定位)</span><br><span class="line">    vHeadPos: 0.1 # 在移动设备上垂直方向头部位置调整 (百分比，影响模型在屏幕上的垂直定位)</span><br><span class="line">  # react:</span><br><span class="line">    # opacityDefault: 0.7 # 看板娘默认的不透明度 (0 完全透明 - 1 完全不透明)</span><br><span class="line">    # opacityOnHover: 0.8 # 当鼠标悬停在看板娘上时的不透明度</span><br></pre></td></tr></table></figure><p>搜索配置</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"># 搜索功能</span><br><span class="line">search:</span><br><span class="line">  path: search.xml</span><br><span class="line">  field: post</span><br><span class="line">  format: html</span><br><span class="line">  limit: 10000</span><br></pre></td></tr></table></figure><p>Hexo NexT 配置</p><h2 id="安装-NexT-主题"><a href="#安装-NexT-主题" class="headerlink" title="安装 NexT 主题"></a>安装 NexT 主题</h2><p>根目录</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git clone https://github.com/next-theme/hexo-theme-next.git themes/next</span><br></pre></td></tr></table></figure><p>_config.yml 修改</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">theme: next</span><br></pre></td></tr></table></figure><p>theme&#x2F;next&#x2F;_config.yml 修改</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"># Schemes</span><br><span class="line">scheme: Muse</span><br><span class="line">#scheme: Mist</span><br><span class="line">#scheme: Pisces</span><br><span class="line">#scheme: Gemini</span><br></pre></td></tr></table></figure><p>修改</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"># Schemes</span><br><span class="line"># scheme: Muse</span><br><span class="line">#scheme: Mist</span><br><span class="line">#scheme: Pisces</span><br><span class="line">scheme: Gemini</span><br></pre></td></tr></table></figure><h3 id="修改配置-1"><a href="#修改配置-1" class="headerlink" title="修改配置"></a>修改配置</h3><h3 id="添加自定义页面"><a href="#添加自定义页面" class="headerlink" title="添加自定义页面"></a>添加自定义页面</h3><p>添加archives&#x2F;categories&#x2F;tags&#x2F;about&#x2F;links页面<br>添加归档、分类、标签、关于我、友情链接页面</p><h4 id="修改配置-2"><a href="#修改配置-2" class="headerlink" title="修改配置"></a>修改配置</h4><p>theme&#x2F;next&#x2F;_config.yml 修改</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">menu:</span><br><span class="line">  home: / || fa fa-home # 首页</span><br><span class="line">  categories: /categories/ || fa fa-th # 分类系统</span><br><span class="line">  archives: /archives/ || fa fa-archive #chart-diagram #archive  # 文章归档</span><br><span class="line">  tags: /tags/ || fa fa-tags # 标签云</span><br><span class="line">  about: /about/ || fa fa-robot #user  # 关于页面</span><br><span class="line">  Friend: /links/ || fa fa-user-group #users # 友情链接</span><br><span class="line">  # schedule: /schedule/ || fa fa-calendar  # 日程表</span><br><span class="line">  # sitemap: /sitemap.xml || fa fa-sitemap  # 站点地图</span><br><span class="line">  # commonweal: /404/ || fa fa-heartbeat    # 公益404页</span><br></pre></td></tr></table></figure><h4 id="添加-archives-页面"><a href="#添加-archives-页面" class="headerlink" title="添加 archives 页面"></a>添加 archives 页面</h4><p>开启后，默认自带不用操作</p><h4 id="添加-categories-页面"><a href="#添加-categories-页面" class="headerlink" title="添加 categories 页面"></a>添加 categories 页面</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo new page &quot;categories&quot; </span><br></pre></td></tr></table></figure><p>source&#x2F;categories&#x2F;index.md 修改</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: Categories</span><br><span class="line">date: 2025-06-16 16:07:13</span><br><span class="line">type: categories</span><br><span class="line">comments: false</span><br><span class="line">---</span><br></pre></td></tr></table></figure><h4 id="添加-tage-页面"><a href="#添加-tage-页面" class="headerlink" title="添加 tage 页面"></a>添加 tage 页面</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo new page &quot;tags&quot;</span><br></pre></td></tr></table></figure><p>source&#x2F;tags&#x2F;index.md 修改</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: Tags</span><br><span class="line">date: 2025-06-16 16:07:40</span><br><span class="line">type: tags</span><br><span class="line">comments: false</span><br><span class="line">---</span><br></pre></td></tr></table></figure><h4 id="添加-about-页面"><a href="#添加-about-页面" class="headerlink" title="添加 about 页面"></a>添加 about 页面</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo new page &quot;about&quot;</span><br></pre></td></tr></table></figure><p>source&#x2F;about&#x2F;index.md 修改</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: About Me</span><br><span class="line">date: 2025-06-16 16:07:45</span><br><span class="line">type: about</span><br><span class="line">---</span><br><span class="line"></span><br><span class="line">Hello～ I&#x27;m KZero</span><br><span class="line"></span><br><span class="line">来自福建，是个爱折腾爱探索的动漫日剧爱好者，热衷于各种科技产品和好用效率的软件，喜欢简洁舒适科技的御宅生活。</span><br><span class="line">喜欢编程，虽然整天研究一些无用的东西，但每天过充实而快乐。</span><br><span class="line">喜欢游戏，Apex、守望先锋、星际争霸、冒险岛...</span><br><span class="line">喜欢运动，户外、骑行、篮球、乒乓球...</span><br></pre></td></tr></table></figure><h4 id="添加-links-页面"><a href="#添加-links-页面" class="headerlink" title="添加 links 页面"></a>添加 links 页面</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo new page &quot;links&quot;</span><br></pre></td></tr></table></figure><p>source&#x2F;links&#x2F;index.md 修改</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: Friend Links</span><br><span class="line">date: 2025-06-16 16:07:54</span><br><span class="line">type: links</span><br><span class="line">---</span><br><span class="line"></span><br><span class="line">欢迎在下面留言申请友情链接～格式如下</span><br><span class="line"></span><br><span class="line">&gt; 名称：KZero</span><br><span class="line">描述：Coding / Hiking / Photog / Music</span><br><span class="line">博客地址：http://zoiii.cn</span><br><span class="line">头像地址：http://zoiii.cn/img/avatar.gif</span><br></pre></td></tr></table></figure><p>theme&#x2F;next&#x2F;layout&#x2F; 新建 links.njk（可修改友链样式）</p><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br></pre></td><td class="code"><pre><span class="line">&#123;% block <span class="attribute">content</span> %&#125;</span><br><span class="line">  &#123;######################&#125;</span><br><span class="line">  &#123;### LINKS BLOCK ###&#125;</span><br><span class="line">  &#123;######################&#125;</span><br><span class="line"></span><br><span class="line">    &lt;<span class="selector-tag">div</span> id=&quot;links&quot;&gt;</span><br><span class="line">        &lt;style&gt;</span><br><span class="line"></span><br><span class="line">        <span class="selector-id">#links</span>&#123;</span><br><span class="line">            <span class="attribute">margin-top</span>: <span class="number">5rem</span>;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="selector-class">.links-content</span> &#123;</span><br><span class="line">            <span class="attribute">width</span>: <span class="number">100%</span>;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="selector-class">.link-navigation</span>&#123;</span><br><span class="line">            <span class="attribute">overflow</span>: hidden;</span><br><span class="line">            <span class="attribute">display</span>: inline-block;</span><br><span class="line">            <span class="attribute">padding</span>: <span class="number">0</span> <span class="number">0</span> <span class="number">7px</span>;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="selector-class">.card</span> &#123;</span><br><span class="line">            <span class="attribute">height</span>: <span class="number">70px</span>;</span><br><span class="line">            <span class="attribute">width</span>: <span class="number">300px</span>;</span><br><span class="line">            <span class="attribute">display</span>: block;</span><br><span class="line">            <span class="attribute">color</span>: <span class="number">#666</span>;</span><br><span class="line">            <span class="selector-tag">line</span>-style-type: none;</span><br><span class="line">            <span class="attribute">text-decoration</span>: none;</span><br><span class="line">            <span class="attribute">box-shadow</span>: <span class="number">0</span> <span class="number">3px</span> <span class="number">1px</span> -<span class="number">2px</span> <span class="built_in">rgba</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, .<span class="number">2</span>), <span class="number">0</span> <span class="number">2px</span> <span class="number">2px</span> <span class="number">0</span> <span class="built_in">rgba</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, .<span class="number">14</span>), <span class="number">0</span> <span class="number">1px</span> <span class="number">5px</span> <span class="number">0</span> <span class="built_in">rgba</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, .<span class="number">12</span>);</span><br><span class="line">            <span class="attribute">transition</span>: box-shadow .<span class="number">25s</span> <span class="built_in">cubic-bezier</span>(.<span class="number">4</span>, <span class="number">0</span>, .<span class="number">2</span>, <span class="number">1</span>);</span><br><span class="line">            <span class="attribute">margin</span>: <span class="number">10px</span>;</span><br><span class="line">            <span class="attribute">float</span>: left;</span><br><span class="line">            <span class="attribute">border</span>: <span class="number">0</span>;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="selector-class">.card</span><span class="selector-pseudo">:hover</span> &#123;</span><br><span class="line">            <span class="attribute">text-decoration</span>: none;</span><br><span class="line">            <span class="attribute">box-shadow</span>: <span class="number">0</span> <span class="number">5px</span> <span class="number">5px</span> -<span class="number">3px</span> <span class="built_in">rgba</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, .<span class="number">2</span>), <span class="number">0</span> <span class="number">8px</span> <span class="number">10px</span> <span class="number">1px</span> <span class="built_in">rgba</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, .<span class="number">14</span>), <span class="number">0</span> <span class="number">3px</span> <span class="number">14px</span> <span class="number">2px</span> <span class="built_in">rgba</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, .<span class="number">12</span>);</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="selector-class">.card</span> <span class="selector-class">.ava</span> &#123;</span><br><span class="line">            <span class="attribute">float</span>: left;</span><br><span class="line">            <span class="attribute">height</span>: <span class="number">70px</span>;</span><br><span class="line">            <span class="attribute">width</span>: <span class="number">70px</span>;</span><br><span class="line">            <span class="attribute">margin</span>: <span class="number">0</span>;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="selector-class">.card-header</span> &#123;</span><br><span class="line">            <span class="attribute">overflow</span>: hidden;</span><br><span class="line">            <span class="attribute">height</span>: <span class="number">70px</span>;</span><br><span class="line">            <span class="attribute">width</span>: <span class="number">230px</span>;</span><br><span class="line">            <span class="attribute">margin-left</span>: <span class="number">70px</span>;</span><br><span class="line">            <span class="attribute">font-size</span>: <span class="number">15px</span>;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="selector-class">.nickname</span> &#123;</span><br><span class="line">            <span class="attribute">text-align</span>: center;</span><br><span class="line">            <span class="attribute">height</span>: <span class="number">25px</span>;</span><br><span class="line">            <span class="attribute">width</span>: <span class="number">100%</span>;</span><br><span class="line">            <span class="attribute">line-height</span>: <span class="number">12px</span>;</span><br><span class="line">            <span class="attribute">margin</span>: <span class="number">14px</span> <span class="number">0</span> <span class="number">0</span>;</span><br><span class="line">        &#125;</span><br><span class="line">    </span><br><span class="line">        <span class="selector-class">.info</span> &#123;</span><br><span class="line">            <span class="attribute">text-align</span>: center;</span><br><span class="line">            <span class="attribute">height</span>: <span class="number">20px</span>;</span><br><span class="line">            <span class="attribute">width</span>: <span class="number">100%</span>;</span><br><span class="line">            <span class="attribute">margin</span>: <span class="number">0</span>;</span><br><span class="line">            <span class="attribute">line-height</span>: <span class="number">12px</span>;</span><br><span class="line">            <span class="attribute">color</span>: <span class="number">#777</span>;</span><br><span class="line">            <span class="attribute">font-size</span>: <span class="number">12px</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        &lt;/style&gt;</span><br><span class="line">        &lt;<span class="selector-tag">div</span> class=&quot;links-<span class="attribute">content</span>&quot;&gt;</span><br><span class="line">            &lt;<span class="selector-tag">div</span> class=&quot;link-navigation&quot;&gt;</span><br><span class="line"></span><br><span class="line">                &#123;% for link in theme<span class="selector-class">.mylinks</span> %&#125;</span><br><span class="line"></span><br><span class="line">                    &lt;<span class="selector-tag">a</span> href=&quot;&#123;&#123; link<span class="selector-class">.site</span> &#125;&#125;&quot; target=&quot;_blank&quot; class=&quot;card&quot;&gt;</span><br><span class="line">                        &lt;<span class="selector-tag">img</span> class=&quot;ava&quot; <span class="attribute">src</span>=&quot;&#123;&#123; link<span class="selector-class">.avatar</span> &#125;&#125;&quot;/&gt;</span><br><span class="line">                        &lt;<span class="selector-tag">div</span> class=&quot;card-<span class="selector-tag">header</span>&quot;&gt;</span><br><span class="line">                            &lt;<span class="selector-tag">div</span> class=&quot;nickname&quot;&gt;&#123;&#123; link<span class="selector-class">.nickname</span> &#125;&#125;&lt;/<span class="selector-tag">div</span>&gt;</span><br><span class="line">                            &lt;<span class="selector-tag">div</span> class=&quot;info&quot;&gt;&#123;&#123; link<span class="selector-class">.info</span> &#125;&#125;&lt;/<span class="selector-tag">div</span>&gt;</span><br><span class="line">                        &lt;/<span class="selector-tag">div</span>&gt;</span><br><span class="line">                    &lt;/<span class="selector-tag">a</span>&gt;</span><br><span class="line"></span><br><span class="line">                &#123;% endfor %&#125;</span><br><span class="line"></span><br><span class="line">            &lt;/<span class="selector-tag">div</span>&gt;</span><br><span class="line">            &#123;&#123; <span class="attribute">page</span><span class="selector-class">.content</span> &#125;&#125;</span><br><span class="line">            &lt;/<span class="selector-tag">div</span>&gt;</span><br><span class="line">        &lt;/<span class="selector-tag">div</span>&gt;</span><br><span class="line"></span><br><span class="line">  &#123;##########################&#125;</span><br><span class="line">  &#123;### END LINKS BLOCK ###&#125;</span><br><span class="line">  &#123;##########################&#125;</span><br><span class="line">&#123;% endblock %&#125;</span><br></pre></td></tr></table></figure><p>theme&#x2F;next&#x2F;layout&#x2F;page.njk 引入</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">    &lt;!-- 友情链接--&gt;</span><br><span class="line">&#123;%- elif page.type === &#x27;links&#x27; and not page.title %&#125;</span><br><span class="line">  &#123;&#123;- __(&#x27;title.links&#x27;) + page_title_suffix &#125;&#125;</span><br></pre></td></tr></table></figure><p>引入</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">&#123;% block title %&#125;</span><br><span class="line">  &#123;%- set page_title_suffix = &#x27; | &#x27; + title %&#125;</span><br><span class="line"></span><br><span class="line">  &#123;%- if page.type === &#x27;categories&#x27; and not page.title %&#125;</span><br><span class="line">    &#123;&#123;- __(&#x27;title.category&#x27;) + page_title_suffix &#125;&#125;</span><br><span class="line">  &#123;%- elif page.type === &#x27;tags&#x27; and not page.title %&#125;</span><br><span class="line">    &#123;&#123;- __(&#x27;title.tag&#x27;) + page_title_suffix &#125;&#125;</span><br><span class="line">  &#123;%- elif page.type === &#x27;schedule&#x27; and not page.title %&#125;</span><br><span class="line">    &#123;&#123;- __(&#x27;title.schedule&#x27;) + page_title_suffix &#125;&#125;</span><br><span class="line">    </span><br><span class="line">      &lt;!-- 友情链接--&gt;</span><br><span class="line">  &#123;%- elif page.type === &#x27;links&#x27; and not page.title %&#125;</span><br><span class="line">    &#123;&#123;- __(&#x27;title.links&#x27;) + page_title_suffix &#125;&#125;</span><br><span class="line"></span><br><span class="line">  &#123;%- else %&#125;</span><br><span class="line">    &#123;&#123;- page.title + page_title_suffix &#125;&#125;</span><br><span class="line">  &#123;%- endif %&#125;</span><br><span class="line">&#123;% endblock %&#125;</span><br></pre></td></tr></table></figure><p>和</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">  &lt;!-- 友情链接--&gt;</span><br><span class="line">&#123;% elif page.type === &#x27;links&#x27; %&#125;</span><br><span class="line">  &#123;%- include &#x27;links.njk&#x27; -%&#125;</span><br></pre></td></tr></table></figure><p>引入</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">&lt;div class=&quot;post-body&#123;% if page.direction and page.direction.toLowerCase() === &#x27;rtl&#x27; %&#125; rtl&#123;% endif %&#125;&quot;&gt;</span><br><span class="line">  &#123;%- if page.type === &#x27;tags&#x27; %&#125;</span><br><span class="line">    &#123;%- include &#x27;_partials/page/tags.njk&#x27; -%&#125;</span><br><span class="line">  &#123;% elif page.type === &#x27;categories&#x27; %&#125;</span><br><span class="line">    &#123;%- include &#x27;_partials/page/categories.njk&#x27; -%&#125;</span><br><span class="line"></span><br><span class="line">    &lt;!-- 友情链接--&gt;</span><br><span class="line">  &#123;% elif page.type === &#x27;links&#x27; %&#125;</span><br><span class="line">    &#123;%- include &#x27;links.njk&#x27; -%&#125;</span><br><span class="line"></span><br><span class="line">  &#123;% elif page.type === &#x27;schedule&#x27; %&#125;</span><br><span class="line">    &#123;%- include &#x27;_partials/page/schedule.njk&#x27; -%&#125;</span><br><span class="line">  &#123;% else %&#125;</span><br><span class="line">    &#123;&#123; page.content &#125;&#125;</span><br><span class="line">  &#123;%- endif %&#125;</span><br><span class="line">&lt;/div&gt;</span><br></pre></td></tr></table></figure><p>theme&#x2F;next&#x2F;_config.yml 添加</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"># 友链</span><br><span class="line">mylinks:</span><br><span class="line"></span><br><span class="line">- nickname: # 名字</span><br><span class="line">  info: # 描述</span><br><span class="line">  site: # 网站地址</span><br><span class="line">  avatar: # 头像</span><br></pre></td></tr></table></figure><h3 id="添加搜索功能"><a href="#添加搜索功能" class="headerlink" title="添加搜索功能"></a>添加搜索功能</h3><p>theme&#x2F;next&#x2F;_config.yml 修改</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">local_search:</span><br><span class="line">  enable: true</span><br></pre></td></tr></table></figure><p>安装搜索插件</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-generator-searchdb --save</span><br></pre></td></tr></table></figure><h3 id="添加-Live2D"><a href="#添加-Live2D" class="headerlink" title="添加 Live2D"></a>添加 Live2D</h3><p>根目录</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-helper-live2d --save</span><br></pre></td></tr></table></figure><p>_config.yml 添加</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br></pre></td><td class="code"><pre><span class="line"># Live2D</span><br><span class="line">## https://github.com/EYHN/hexo-helper-live2d</span><br><span class="line">live2d:</span><br><span class="line">  enable: true #是否启用</span><br><span class="line">  scriptFrom: local # 脚本来源，可以是local或jsdelivr等CDN</span><br><span class="line">  pluginRootPath: live2dw/ # 插件在站点上的根目录(相对路径)</span><br><span class="line">  pluginJsPath: lib/ # 插件JS目录</span><br><span class="line">  pluginModelPath: assets/ # 插件模型目录</span><br><span class="line">  # scriptFrom: jsdelivr # jsdelivr CDN</span><br><span class="line">  # scriptFrom: unpkg # unpkg CDN</span><br><span class="line">  # scriptFrom: https://cdn.jsdelivr.net/npm/live2d-widget@3.x/lib/L2Dwidget.min.js # 你的自定义 url</span><br><span class="line">  tagMode: false # 标签模式, 是否仅替换 live2d tag标签而非插入到所有页面中</span><br><span class="line">  debug: false # 调试模式, 是否在控制台输出日志</span><br><span class="line">  model:</span><br><span class="line">    # use: live2d-widget-model-hijiki # npm-module package name</span><br><span class="line">    use: PLT  #wanko # 博客根目录/live2d_models/ 下的目录名</span><br><span class="line">    # use: ./wives/wanko # 相对于博客根目录的路径</span><br><span class="line">    # use: https://cdn.jsdelivr.net/npm/live2d-widget-model-wanko@1.0.5/assets/wanko.model.json # 你的自定义 url</span><br><span class="line">  display:</span><br><span class="line">    position: right</span><br><span class="line">    width: 280</span><br><span class="line">    height: 426</span><br><span class="line">    superSample: 2 #超级样本</span><br><span class="line">    hOffset: -82 #偏移量</span><br><span class="line">    vOffset: -82 #垂直偏移</span><br><span class="line">  mobile:</span><br><span class="line">    show: true # 手机中是否展示</span><br><span class="line">    scale: 0.6 # 移动设备上的缩放   </span><br><span class="line">    hHeadPos: 0.2</span><br><span class="line">    vHeadPos: 0.618</span><br><span class="line">  react:</span><br><span class="line">    opacityDefault: 0.7</span><br><span class="line">    opacityOnHover: 0.8</span><br></pre></td></tr></table></figure><p>根目录下新建 live2dw 文件夹用来存放Live2D模型，通过配置文件选取模型</p><h3 id="添加-APlayer"><a href="#添加-APlayer" class="headerlink" title="添加 APlayer"></a>添加 APlayer</h3><h4 id="添加-APlayer-1"><a href="#添加-APlayer-1" class="headerlink" title="添加 APlayer"></a>添加 APlayer</h4><p>找个地方下载APlayer只需要里面dist文件</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git clone https://github.com/DIYgod/APlayer</span><br></pre></td></tr></table></figure><p>aplayer&#x2F;dist 里新建 music.js 添加</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">const ap = new APlayer(&#123;</span><br><span class="line">    container: document.getElementById(&#x27;aplayer&#x27;),</span><br><span class="line">    fixed: true,</span><br><span class="line">    autoplay: false,</span><br><span class="line">    loop: &#x27;all&#x27;,</span><br><span class="line">    volume: 0.7, //默Ï认音量Ï</span><br><span class="line">    listFolded: true,</span><br><span class="line">    listMaxHeight: 60,</span><br><span class="line">    audio: [</span><br><span class="line">      &#123;</span><br><span class="line">        name: &quot;Welcome to Chew Chew&quot;,</span><br><span class="line">        artist: &#x27;Asteria&#x27;,</span><br><span class="line">        url: &#x27;https://music.163.com/song/media/outer/url?id=435403078.mp3&#x27;,</span><br><span class="line">        cover: &#x27;https://p1.music.126.net/Epju_XiNiSWoafctIg68JQ==/17940731230636690.jpg&#x27;,</span><br><span class="line">      &#125;</span><br><span class="line">    ] </span><br><span class="line">&#125;);   </span><br></pre></td></tr></table></figure><p>music.js 内容可根据：<a href="https://aplayer.js.org/#/zh-Hans/?id=%E5%8F%82%E6%95%B0">APlayer官方文档</a> 进行配置</p><p>把 dist 放入 theme&#x2F;next&#x2F;source</p><p>在 hexo-blog\themes\next\layout_layout.njk 在body标签后 –&gt;</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&lt;!-- 添加aplayer --&gt;</span><br><span class="line">&lt;link rel=&quot;stylesheet&quot; href=&quot;/dist/APlayer.min.css&quot;&gt;</span><br><span class="line">&lt;div id=&quot;aplayer&quot;&gt;&lt;/div&gt;</span><br><span class="line">&lt;script type=&quot;text/javascript&quot; src=&quot;/dist/APlayer.min.js&quot;&gt;&lt;/script&gt;</span><br><span class="line">&lt;script type=&quot;text/javascript&quot; src=&quot;/dist/music.js&quot;&gt;&lt;/script&gt;</span><br></pre></td></tr></table></figure><h4 id="网易云音乐链接"><a href="#网易云音乐链接" class="headerlink" title="网易云音乐链接"></a>网易云音乐链接</h4><p>网易云音乐复制歌曲链接</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://music.163.com/song?id=取这里的id值&amp;userid=423945766</span><br></pre></td></tr></table></figure><p>链接模版：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://music.163.com/song/media/outer/url?id=把id值添加到这里.mp3</span><br></pre></td></tr></table></figure><p>获取头像F12选取链接</p><h4 id="CloudflareR2-获取音乐链接"><a href="#CloudflareR2-获取音乐链接" class="headerlink" title="CloudflareR2 获取音乐链接"></a>CloudflareR2 获取音乐链接</h4><p>下载好 .mp3 音乐<br>网易云音乐下载音乐有些可能是 ncm 格式<br>音频 ncm 格式转 mp3<br><a href="https://www.zhuanhuanyun.cn/?to=.zh-warp">https://www.zhuanhuanyun.cn/?to=.zh-warp</a></p><p>Cloudflare R2：<a href="https://dash.cloudflare.com/">https://dash.cloudflare.com/</a></p><p>R2 Object Storage –&gt; Create bucket</p><p>Bucket name: music<br>Location: Automatic –&gt; Provide a location hint (optional) –Asia-Pacific (APAC)<br>Default Storage Class –&gt; Standard</p><p>Settings –&gt; Public Development URL –&gt; Enable -&gt; 输入allow –&gt; Allow</p><p>Objects –&gt; select from computer –&gt; Files上传下载好的 .mp3 音乐 –&gt; 点进上传好的音乐 –&gt; 复制URLs</p><h3 id="添加-Gitalk-评论"><a href="#添加-Gitalk-评论" class="headerlink" title="添加 Gitalk 评论"></a>添加 Gitalk 评论</h3><h4 id="新建Github仓库"><a href="#新建Github仓库" class="headerlink" title="新建Github仓库"></a>新建Github仓库</h4><p><a href="https://github.com/new">https://github.com/new</a></p><p>新建一个仓库用来存储评论，评论将会存储仓库 Issue 中</p><h4 id="注册GitHub-OAuth应用"><a href="#注册GitHub-OAuth应用" class="headerlink" title="注册GitHub OAuth应用"></a>注册GitHub OAuth应用</h4><p><a href="https://github.com/settings/applications/new">https://github.com/settings/applications/new</a></p><p>Application name: Gitalk<br>Homepage URL: <a href="http://blog.zoiii.cn/">http://blog.zoiii.cn</a><br>Authorization callback URL: <a href="http://blog.zoiii.cn/">http://blog.zoiii.cn</a><br>Enable Device Flow<br>Register application</p><p>获取Client ID 和 Client Secret</p><h4 id="修改配置-3"><a href="#修改配置-3" class="headerlink" title="修改配置"></a>修改配置</h4><p>themes&#x2F;next&#x2F;_config.yml 修改</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">gitalk:</span><br><span class="line">  enable: true</span><br><span class="line">  github_id: zoiiiiii # GitHub 仓库所有者</span><br><span class="line">  repo: gitalk # 用于存储 issues 的仓库名称</span><br><span class="line">  client_id: # 获取的Client ID</span><br><span class="line">  client_secret: # 获取的Client Secret</span><br><span class="line">  admin_user: zoiiiiii # GitHub 仓库所有者和协作者，只有这些人可以初始化 GitHub issues</span><br><span class="line">  distraction_free_mode: true # 类似 Facebook 的无干扰模式</span><br><span class="line">  # 当官方代理不可用时，可以更改为自己的代理地址</span><br><span class="line">  proxy: https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token # 这是官方代理地址</span><br><span class="line">  # Gitalk 的显示语言取决于用户的浏览器或系统环境</span><br><span class="line">  # 如果希望访问您网站的所有人都看到统一的语言，可以设置强制语言值</span><br><span class="line">  # 可选值: en | es-ES | fr | ru | zh-CN | zh-TW</span><br><span class="line">  language: en</span><br></pre></td></tr></table></figure><h3 id="添加黑白模式切换"><a href="#添加黑白模式切换" class="headerlink" title="添加黑白模式切换"></a>添加黑白模式切换</h3><p>根目录</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-next-darkmode --save</span><br></pre></td></tr></table></figure><p>themes&#x2F;next&#x2F;_config.yml 添加</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"># Darkmode JS</span><br><span class="line"># For more information: https://github.com/rqh656418510/hexo-next-darkmode, https://github.com/sandoche/Darkmode.js</span><br><span class="line">darkmode_js:</span><br><span class="line">  enable: true</span><br><span class="line">  bottom: &#x27;16px&#x27; # default: &#x27;32px&#x27;</span><br><span class="line">  right: &#x27;96px&#x27; # default: &#x27;32px&#x27;</span><br><span class="line">  left: &#x27;unset&#x27; # default: &#x27;unset&#x27;</span><br><span class="line">  time: &#x27;0.5s&#x27; # default: &#x27;0.3s&#x27;</span><br><span class="line">  mixColor: &#x27;transparent&#x27; # default: &#x27;#fff&#x27;</span><br><span class="line">  backgroundColor: &#x27;transparent&#x27; # default: &#x27;#fff&#x27;</span><br><span class="line">  buttonColorDark: &#x27;#121212&#x27; # default: &#x27;#100f2c&#x27;</span><br><span class="line">  buttonColorLight: &#x27;#121212&#x27; # default: &#x27;#fff&#x27;</span><br><span class="line">  isActivated: false # default false</span><br><span class="line">  saveInCookies: false # default: true</span><br><span class="line">  label: ◑ # default: &#x27;&#x27;</span><br><span class="line">  autoMatchOsTheme: false # default: true</span><br><span class="line">  libUrl: # Set custom library cdn url for Darkmode.js</span><br></pre></td></tr></table></figure><h3 id="SEO-优化"><a href="#SEO-优化" class="headerlink" title="SEO 优化"></a>SEO 优化</h3><p>生成 sitemap.xml</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-generator-sitemap --save</span><br></pre></td></tr></table></figure><p>生成 RSS</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-generator-feed --save</span><br></pre></td></tr></table></figure><p>自动推送至搜索引擎</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-seo-autopush --save</span><br></pre></td></tr></table></figure><h3 id="自定义"><a href="#自定义" class="headerlink" title="自定义"></a>自定义</h3><p>themes&#x2F;next&#x2F;source&#x2F;css&#x2F;_schemes&#x2F;Gemini&#x2F;index.styl 最下面添加</p><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br></pre></td><td class="code"><pre><span class="line">// 自定义样式</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.site-title</span> &#123;</span><br><span class="line">  <span class="attribute">font-size</span>: <span class="number">15px</span> <span class="meta">!important</span>;  </span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">// <span class="selector-class">.main-menu</span> &#123;</span><br><span class="line">//   <span class="attribute">font-size</span>: <span class="number">14px</span>;</span><br><span class="line">// &#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.main-inner</span> &#123;</span><br><span class="line">  <span class="attribute">font-size</span>: <span class="number">14px</span>;  </span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.fa-tags</span> &#123;</span><br><span class="line">  <span class="attribute">font-size</span>: <span class="number">15px</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.live2d-widget-container</span> &#123;</span><br><span class="line">  <span class="attribute">z-index</span>: <span class="number">999</span> <span class="meta">!important</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 暗黑模式切换按钮样式 */</span></span><br><span class="line"><span class="selector-tag">body</span> <span class="selector-class">.darkmode-toggle</span> &#123;</span><br><span class="line">  <span class="attribute">width</span>: <span class="number">26px</span> <span class="meta">!important</span>;</span><br><span class="line">  <span class="attribute">height</span>: <span class="number">26px</span> <span class="meta">!important</span>;</span><br><span class="line">  <span class="attribute">border-radius</span>: <span class="number">0</span> <span class="meta">!important</span>;</span><br><span class="line">  <span class="attribute">opacity</span>: <span class="number">0.8</span>;</span><br><span class="line">  <span class="attribute">color</span>: <span class="number">#fff</span>;</span><br><span class="line">  <span class="attribute">font-size</span>: <span class="number">16px</span>;</span><br><span class="line">  <span class="attribute">z-index</span>: <span class="number">999</span> <span class="meta">!important</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 手机端响应式样式 */</span></span><br><span class="line"><span class="keyword">@media</span> (<span class="attribute">max-width</span>: <span class="number">576px</span>) &#123;</span><br><span class="line">  <span class="comment">/* 移动端隐藏音乐播放器 */</span></span><br><span class="line">  <span class="selector-class">.aplayer</span> &#123;</span><br><span class="line">    <span class="attribute">display</span>: none <span class="meta">!important</span>;</span><br><span class="line">  &#125;</span><br><span class="line">  </span><br><span class="line">  <span class="comment">/* 手机端调整暗黑模式按钮位置 */</span></span><br><span class="line">  <span class="selector-class">.darkmode-toggle</span> &#123;</span><br><span class="line">    <span class="attribute">bottom</span>: <span class="number">24px</span> <span class="meta">!important</span>;</span><br><span class="line">    <span class="attribute">right</span>: <span class="number">16px</span> <span class="meta">!important</span>;</span><br><span class="line">  &#125;</span><br><span class="line"></span><br><span class="line">  <span class="selector-class">.sidebar-toggle</span> &#123;</span><br><span class="line">    <span class="attribute">right</span>: <span class="number">16px</span>;</span><br><span class="line">    <span class="attribute">left</span>: auto;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 平板响应式样式 */</span></span><br><span class="line"><span class="keyword">@media</span> (<span class="attribute">min-width</span>: <span class="number">577px</span>) <span class="keyword">and</span> (<span class="attribute">max-width</span>: <span class="number">991px</span>) &#123;</span><br><span class="line">  <span class="comment">/* 平板设备显示音乐播放器 */</span></span><br><span class="line">  <span class="selector-class">.aplayer</span> &#123;</span><br><span class="line">    <span class="attribute">display</span>: block <span class="meta">!important</span>;</span><br><span class="line">  &#125;</span><br><span class="line">  <span class="selector-class">.sidebar-toggle</span> &#123;</span><br><span class="line">    <span class="attribute">right</span>: <span class="number">96px</span>;</span><br><span class="line">    <span class="attribute">left</span>: auto;</span><br><span class="line">  &#125;</span><br><span class="line">  <span class="selector-class">.darkmode-toggle</span> &#123;</span><br><span class="line">    <span class="attribute">bottom</span>: <span class="number">24px</span> <span class="meta">!important</span>;</span><br><span class="line">    <span class="attribute">right</span>: <span class="number">96px</span> <span class="meta">!important</span>;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">// 平板以下样式</span><br><span class="line"><span class="keyword">@media</span> (<span class="attribute">max-width</span>: <span class="number">768px</span>) &#123;</span><br><span class="line"><span class="selector-class">.darkmode-toggle</span> &#123;</span><br><span class="line">    <span class="attribute">width</span>: <span class="number">26px</span> <span class="meta">!important</span>;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">@media</span> (<span class="attribute">min-width</span>: <span class="number">1200px</span>) &#123;</span><br><span class="line">  <span class="selector-class">.main</span> &#123;</span><br><span class="line">      <span class="attribute">width</span>: <span class="number">1120px</span>;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">@media</span> (<span class="attribute">max-width</span>: <span class="number">1201px</span>) &#123;</span><br><span class="line">  <span class="selector-class">.main</span> &#123;</span><br><span class="line">      <span class="attribute">width</span>: <span class="number">1180px</span>;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><p>themes&#x2F;next&#x2F;layout&#x2F;_macro&#x2F;sidebar.njk</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br></pre></td><td class="code"><pre><span class="line">&#123;% macro render(display_toc) %&#125;</span><br><span class="line">  &lt;aside class=&quot;sidebar&quot;&gt;</span><br><span class="line">    &#123;%- if display_toc %&#125;</span><br><span class="line">      &#123;%- set toc = toc(page.content, &#123;class: &#x27;nav&#x27;, list_number: page.toc.number, max_depth: page.toc.max_depth&#125;) %&#125;</span><br><span class="line">      &#123;%- set display_toc = toc.length &gt; 1 and display_toc %&#125;</span><br><span class="line">    &#123;%- endif %&#125;</span><br><span class="line"></span><br><span class="line">    &lt;div class=&quot;sidebar-inner &#123;% if display_toc %&#125;sidebar-nav-active sidebar-toc-active&#123;% else %&#125;sidebar-overview-active&#123;% endif %&#125;&quot;&gt;</span><br><span class="line">      &lt;ul class=&quot;sidebar-nav&quot;&gt;</span><br><span class="line">        &lt;li class=&quot;sidebar-nav-toc&quot;&gt;</span><br><span class="line">          &#123;&#123; __(&#x27;sidebar.toc&#x27;) &#125;&#125;</span><br><span class="line">        &lt;/li&gt;</span><br><span class="line">        &lt;li class=&quot;sidebar-nav-overview&quot;&gt;</span><br><span class="line">          &#123;&#123; __(&#x27;sidebar.overview&#x27;) &#125;&#125;</span><br><span class="line">        &lt;/li&gt;</span><br><span class="line">      &lt;/ul&gt;</span><br><span class="line"></span><br><span class="line">      &lt;div class=&quot;sidebar-panel-container&quot;&gt;</span><br><span class="line">        &lt;!--noindex--&gt;</span><br><span class="line">        &lt;div class=&quot;post-toc-wrap sidebar-panel&quot;&gt;</span><br><span class="line">          &#123;%- if display_toc %&#125;</span><br><span class="line">            &lt;div class=&quot;post-toc animated&quot;&gt;&#123;&#123; toc &#125;&#125;&lt;/div&gt;</span><br><span class="line">          &#123;%- endif %&#125;</span><br><span class="line">        &lt;/div&gt;</span><br><span class="line">        &lt;!--/noindex--&gt;</span><br><span class="line"></span><br><span class="line">        &lt;div class=&quot;site-overview-wrap sidebar-panel&quot;&gt;</span><br><span class="line">          &#123;&#123; partial(&#x27;_partials/sidebar/site-overview.njk&#x27;, &#123;&#125;, &#123;cache: theme.cache.enable&#125;) &#125;&#125;</span><br><span class="line"></span><br><span class="line">          &#123;&#123;- next_inject(&#x27;sidebar&#x27;) &#125;&#125;</span><br><span class="line"></span><br><span class="line">          &#123;# 移动到这里 #&#125;</span><br><span class="line">          &#123;%- if theme.links %&#125;</span><br><span class="line">          &lt;div class=&quot;links-of-blogroll animated&quot;&gt;</span><br><span class="line">            &lt;div class=&quot;links-of-blogroll-title&quot;&gt;</span><br><span class="line">              &#123;%- if theme.links_settings.icon %&#125;&lt;i class=&quot;&#123;&#123; theme.links_settings.icon &#125;&#125; fa-fw&quot;&gt;&lt;/i&gt;&#123;% endif %&#125;</span><br><span class="line">              &#123;&#123; __(&#x27;sidebar.links&#x27;) &#125;&#125;</span><br><span class="line">            &lt;/div&gt;</span><br><span class="line">            &lt;ul class=&quot;links-of-blogroll-list&quot;&gt;</span><br><span class="line">              &#123;%- for blogrollText, blogrollURL in theme.links %&#125;</span><br><span class="line">              &lt;li class=&quot;links-of-blogroll-item&quot;&gt;</span><br><span class="line">                &#123;&#123; next_url(blogrollURL, blogrollText, &#123;title: blogrollURL&#125;) &#125;&#125;</span><br><span class="line">              &lt;/li&gt;</span><br><span class="line">              &#123;%- endfor %&#125;</span><br><span class="line">            &lt;/ul&gt;</span><br><span class="line">          &lt;/div&gt;</span><br><span class="line">          </span><br><span class="line">          &#123;%- endif %&#125;</span><br><span class="line">        &lt;/div&gt;</span><br><span class="line">      &lt;/div&gt;</span><br><span class="line"></span><br><span class="line">      &#123;%- if theme.back2top.enable and theme.back2top.sidebar %&#125;</span><br><span class="line">        &lt;div class=&quot;back-to-top animated&quot; role=&quot;button&quot; aria-label=&quot;&#123;&#123; __(&#x27;accessibility.back_to_top&#x27;) &#125;&#125;&quot;&gt;</span><br><span class="line">          &lt;i class=&quot;fa fa-arrow-up&quot;&gt;&lt;/i&gt;</span><br><span class="line">          &lt;span&gt;0%&lt;/span&gt;</span><br><span class="line">        &lt;/div&gt;</span><br><span class="line">      &#123;%- endif %&#125;</span><br><span class="line">    &lt;/div&gt;</span><br><span class="line"></span><br><span class="line">    &#123;# 移动到上面 #&#125;</span><br><span class="line">    &#123;#</span><br><span class="line">    &#123;%- if theme.links %&#125;</span><br><span class="line">    &lt;div class=&quot;sidebar-inner sidebar-blogroll&quot;&gt;</span><br><span class="line">      &lt;div class=&quot;links-of-blogroll animated&quot;&gt;</span><br><span class="line">        &lt;div class=&quot;links-of-blogroll-title&quot;&gt;</span><br><span class="line">          &#123;%- if theme.links_settings.icon %&#125;&lt;i class=&quot;&#123;&#123; theme.links_settings.icon &#125;&#125; fa-fw&quot;&gt;&lt;/i&gt;&#123;% endif %&#125;</span><br><span class="line">          &#123;&#123; __(&#x27;sidebar.links&#x27;) &#125;&#125;</span><br><span class="line">        &lt;/div&gt;</span><br><span class="line">        &lt;ul class=&quot;links-of-blogroll-list&quot;&gt;</span><br><span class="line">          &#123;%- for blogrollText, blogrollURL in theme.links %&#125;</span><br><span class="line">            &lt;li class=&quot;links-of-blogroll-item&quot;&gt;</span><br><span class="line">              &#123;&#123; next_url(blogrollURL, blogrollText, &#123;title: blogrollURL&#125;) &#125;&#125;</span><br><span class="line">            &lt;/li&gt;</span><br><span class="line">          &#123;%- endfor %&#125;</span><br><span class="line">        &lt;/ul&gt;</span><br><span class="line">      &lt;/div&gt;</span><br><span class="line">    &lt;/div&gt;</span><br><span class="line">    &#123;%- endif %&#125;</span><br><span class="line">    #&#125;</span><br><span class="line"></span><br><span class="line">    &#123;%- if theme.related_posts.enable %&#125;</span><br><span class="line">      &#123;%- if theme.pjax %&#125;</span><br><span class="line">        &lt;div class=&quot;pjax&quot;&gt;</span><br><span class="line">      &#123;%- endif %&#125;</span><br><span class="line">      &#123;%- if page.related_posts and page.related_posts.length &gt; 0 %&#125;</span><br><span class="line">        &lt;div class=&quot;sidebar-inner sidebar-post-related&quot;&gt;</span><br><span class="line">          &lt;div class=&quot;animated&quot;&gt;</span><br><span class="line">            &#123;&#123; partial(&#x27;_partials/post/post-related.njk&#x27;) &#125;&#125;</span><br><span class="line">          &lt;/div&gt;</span><br><span class="line">        &lt;/div&gt;</span><br><span class="line">      &#123;%- endif %&#125;</span><br><span class="line">      &#123;%- if theme.pjax %&#125;</span><br><span class="line">        &lt;/div&gt;</span><br><span class="line">      &#123;%- endif %&#125;</span><br><span class="line">    &#123;%- endif %&#125;</span><br><span class="line">  &lt;/aside&gt;</span><br><span class="line">&#123;% endmacro %&#125;</span><br></pre></td></tr></table></figure>]]></content>
    
    
    <summary type="html">&lt;h2 id=&quot;Hexo介绍&quot;&gt;&lt;a href=&quot;#Hexo介绍&quot; class=&quot;headerlink&quot; title=&quot;Hexo介绍&quot;&gt;&lt;/a&gt;Hexo介绍&lt;/h2&gt;&lt;p&gt;Hexo 是一个基于 Node.js 的快速、简洁且高效的博客框架，用 Markdown 写作，插件和主题多，可快速搭建个人博客。&lt;/p&gt;
&lt;h2 id=&quot;安装-Node-js&quot;&gt;&lt;a href=&quot;#安装-Node-js&quot; class=&quot;headerlink&quot; title=&quot;安装 Node.js&quot;&gt;&lt;/a&gt;安装 Node.js&lt;/h2&gt;&lt;p&gt;Hexo 的运行环境&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://nodejs.org/zh-cn/download&quot;&gt;https://nodejs.org/zh-cn/download&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;选择LTS稳定正式版&lt;/p&gt;
&lt;p&gt;检查是否安装成功&lt;/p&gt;
&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;node -v &amp;amp;&amp;amp; npm -v&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;

&lt;h2 id=&quot;安装-Git&quot;&gt;&lt;a href=&quot;#安装-Git&quot; class=&quot;headerlink&quot; title=&quot;安装 Git&quot;&gt;&lt;/a&gt;安装 Git&lt;/h2&gt;&lt;p&gt;&lt;a href=&quot;https://git-scm.com/downloads&quot;&gt;https://git-scm.com/downloads&lt;/a&gt;&lt;/p&gt;
&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;brew install git&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;

&lt;p&gt;检查是否安装成功&lt;/p&gt;
&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;git -v&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;

&lt;h2 id=&quot;安装-Hexo&quot;&gt;&lt;a href=&quot;#安装-Hexo&quot; class=&quot;headerlink&quot; title=&quot;安装 Hexo&quot;&gt;&lt;/a&gt;安装 Hexo&lt;/h2&gt;&lt;p&gt;&lt;a href=&quot;https://hexo.io/zh-cn/&quot;&gt;https://hexo.io/zh-cn/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;npm 全局安装 Hexo&lt;/p&gt;
&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;npm install -g hexo-cli&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;

&lt;p&gt;检查是否安装成功&lt;/p&gt;
&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;hexo -v&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;

&lt;h2 id=&quot;搭建-Hexo-博客&quot;&gt;&lt;a href=&quot;#搭建-Hexo-博客&quot; class=&quot;headerlink&quot; title=&quot;搭建 Hexo 博客&quot;&gt;&lt;/a&gt;搭建 Hexo 博客&lt;/h2&gt;&lt;h3 id=&quot;初始化博客&quot;&gt;&lt;a href=&quot;#初始化博客&quot; class=&quot;headerlink&quot; title=&quot;初始化博客&quot;&gt;&lt;/a&gt;初始化博客&lt;/h3&gt;&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;hexo init 自定义文件名&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;

&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;cd 自定义文件名&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;

&lt;p&gt;安装依赖&lt;/p&gt;
&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;npm install&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;

&lt;p&gt; 启动本地服务器&lt;/p&gt;
&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;hexo s&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;p&gt;访问 &lt;a href=&quot;http://localhost:4000/&quot;&gt;http://localhost:4000&lt;/a&gt; 查看&lt;/p&gt;
&lt;p&gt;初始化后文件结构&lt;/p&gt;
&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;自定义文件名&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;├── _config.yml Hexo配置文件&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;├── package.json #项目信息&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;├── scaffolds&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;├── source #存放页面和文章，_posts里存放文章&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;|   ├── _drafts&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;|   └── _posts&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;└── themes #存放主题&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;</summary>
    
    
    
    <category term="Hexo" scheme="https://zoiii.cn/categories/Hexo/"/>
    
    
    <category term="Hexo" scheme="https://zoiii.cn/tags/Hexo/"/>
    
  </entry>
  
  <entry>
    <title>Markdown</title>
    <link href="https://zoiii.cn/2025/06/16/markdown/"/>
    <id>https://zoiii.cn/2025/06/16/markdown/</id>
    <published>2025-06-16T16:16:27.000Z</published>
    <updated>2025-08-02T04:24:51.582Z</updated>
    
    <content type="html"><![CDATA[<h2 id="Markdown-介绍"><a href="#Markdown-介绍" class="headerlink" title="Markdown 介绍"></a>Markdown 介绍</h2><p>Markdown是一种轻量级的<strong>标记语言</strong>，让你无需关注排版，专注写作。<br>语法简单直观，几分钟就能掌握，且跨平台通用。</p><p>官方基础语法：<a href="https://www.markdownguide.org/">Markdown Guide</a><br>交互练习：<a href="https://www.markdowntutorial.com/zh-cn/">Markdown Tutorial</a></p><p><strong>README.md文件</strong><br>README.md是使用Markdown语法写的。<br>它是一个项目的入门手册，里面介绍了整个项目的使用、功能等信息。<br>所以README.md文件写得好不好，关系到这个项目能不能更容易的被其他人了解和使用。</p><h2 id="Markdown-语法"><a href="#Markdown-语法" class="headerlink" title="Markdown 语法"></a>Markdown 语法</h2><h3 id="标题"><a href="#标题" class="headerlink" title="标题"></a>标题</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"># 一级标题</span><br><span class="line">## 二级标题</span><br><span class="line">### 三级标题</span><br><span class="line">#### 四级标题</span><br></pre></td></tr></table></figure><h3 id="字体"><a href="#字体" class="headerlink" title="字体"></a>字体</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">**文字加粗**</span><br><span class="line">*文字倾斜*</span><br><span class="line">***文字斜体加粗***</span><br><span class="line">~~文字加删除线~~</span><br></pre></td></tr></table></figure><p><strong>文字加粗</strong><br><em>文字倾斜</em><br><em><strong>文字斜体加粗</strong></em><br><del>文字加删除线</del></p><span id="more"></span><h3 id="代码"><a href="#代码" class="headerlink" title="代码"></a>代码</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">单行代码：`单行代码`</span><br><span class="line">多行代码：```多行代码```</span><br><span class="line">语言代码：```python 代码```</span><br></pre></td></tr></table></figure><p><code>单行代码</code></p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">多行代码</span><br></pre></td></tr></table></figure><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python 代码</span><br></pre></td></tr></table></figure><h3 id="链接"><a href="#链接" class="headerlink" title="链接"></a>链接</h3><h4 id="超链接"><a href="#超链接" class="headerlink" title="超链接"></a>超链接</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[链接描述](url)</span><br></pre></td></tr></table></figure><h4 id="图片链接"><a href="#图片链接" class="headerlink" title="图片链接"></a>图片链接</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">![图片描述](url)</span><br></pre></td></tr></table></figure><h3 id="列表"><a href="#列表" class="headerlink" title="列表"></a>列表</h3><h4 id="无序列表"><a href="#无序列表" class="headerlink" title="无序列表"></a>无序列表</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">- 无序列表</span><br><span class="line">- 无序列表</span><br><span class="line">  - 子无序列表（缩进2空格）</span><br></pre></td></tr></table></figure><ul><li>无序列表</li><li>无序列表<ul><li>子无序列表</li></ul></li></ul><h4 id="有序列表"><a href="#有序列表" class="headerlink" title="有序列表"></a>有序列表</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">1. 有序列表</span><br><span class="line">2. 有序列表</span><br><span class="line">   1. 子有序列表（缩进3空格）</span><br></pre></td></tr></table></figure><ol><li>有序列表</li><li>有序列表<ol><li>子有序列表</li></ol></li></ol><h4 id="任务列表"><a href="#任务列表" class="headerlink" title="任务列表"></a>任务列表</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">- [ ] 任务列表</span><br><span class="line">- [ ] 任务列表</span><br></pre></td></tr></table></figure><ul><li><input disabled="" type="checkbox"> 任务列表</li><li><input disabled="" type="checkbox"> 任务列表</li></ul><h3 id="分割线"><a href="#分割线" class="headerlink" title="分割线"></a>分割线</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">--- 或 ***</span><br></pre></td></tr></table></figure><hr><hr><h3 id="表格"><a href="#表格" class="headerlink" title="表格"></a>表格</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">| 左对齐 | 居中对齐 | 右对齐 |</span><br><span class="line">| :----- | :------: | -----: |</span><br><span class="line">| 内容   |   内容   |   内容 |</span><br><span class="line">| 内容   |   内容   |   内容 |</span><br></pre></td></tr></table></figure><table><thead><tr><th align="left">左对齐</th><th align="center">居中对齐</th><th align="right">右对齐</th></tr></thead><tbody><tr><td align="left">内容</td><td align="center">内容</td><td align="right">内容</td></tr><tr><td align="left">内容</td><td align="center">内容</td><td align="right">内容</td></tr></tbody></table><h3 id="引用"><a href="#引用" class="headerlink" title="引用"></a>引用</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&gt; 引用</span><br></pre></td></tr></table></figure><blockquote><p>引用</p></blockquote><h3 id="数学公式"><a href="#数学公式" class="headerlink" title="数学公式"></a>数学公式</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">$ E=mc^2 $</span><br><span class="line"></span><br><span class="line">$$</span><br><span class="line">\chi^2 = \sum \frac&#123;(O - E)^2&#125;&#123;E&#125;</span><br><span class="line">$$</span><br></pre></td></tr></table></figure><p>$ E&#x3D;mc^2 $</p><p>$$<br>\chi^2 &#x3D; \sum \frac{(O - E)^2}{E}<br>$$</p><h3 id="转义字符"><a href="#转义字符" class="headerlink" title="转义字符"></a>转义字符</h3><p>用 \ 避免符号被解析：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">\# 标题</span><br></pre></td></tr></table></figure><p># 标题</p><h2 id="Markdown通用快捷键"><a href="#Markdown通用快捷键" class="headerlink" title="Markdown通用快捷键"></a>Markdown通用快捷键</h2><table><thead><tr><th>功能</th><th>快捷键</th><th>效果说明</th></tr></thead><tbody><tr><td><strong>粗体</strong></td><td><code>Ctrl/Cmd + B</code></td><td>将选中文本转为 <code>**粗体**</code> 格式</td></tr></tbody></table><p>待补充..</p><h2 id="Markdown编辑器"><a href="#Markdown编辑器" class="headerlink" title="Markdown编辑器"></a>Markdown编辑器</h2><h3 id="VS-Code"><a href="#VS-Code" class="headerlink" title="VS Code"></a>VS Code</h3><p>VS Code中安装 Markdown All in One 扩展，支持自动补全、目录生成等高级功能.</p><h3 id="MarkText"><a href="#MarkText" class="headerlink" title="MarkText"></a>MarkText</h3><p>MarkText是一个开源的Markdown编辑器，支持自动保存、目录生成、自动换行等功能。<br>MarkText官方：<a href="https://github.com/marktext/marktext">https://github.com/marktext/marktext</a></p>]]></content>
    
    
    <summary type="html">&lt;h2 id=&quot;Markdown-介绍&quot;&gt;&lt;a href=&quot;#Markdown-介绍&quot; class=&quot;headerlink&quot; title=&quot;Markdown 介绍&quot;&gt;&lt;/a&gt;Markdown 介绍&lt;/h2&gt;&lt;p&gt;Markdown是一种轻量级的&lt;strong&gt;标记语言&lt;/strong&gt;，让你无需关注排版，专注写作。&lt;br&gt;语法简单直观，几分钟就能掌握，且跨平台通用。&lt;/p&gt;
&lt;p&gt;官方基础语法：&lt;a href=&quot;https://www.markdownguide.org/&quot;&gt;Markdown Guide&lt;/a&gt;&lt;br&gt;交互练习：&lt;a href=&quot;https://www.markdowntutorial.com/zh-cn/&quot;&gt;Markdown Tutorial&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;README.md文件&lt;/strong&gt;&lt;br&gt;README.md是使用Markdown语法写的。&lt;br&gt;它是一个项目的入门手册，里面介绍了整个项目的使用、功能等信息。&lt;br&gt;所以README.md文件写得好不好，关系到这个项目能不能更容易的被其他人了解和使用。&lt;/p&gt;
&lt;h2 id=&quot;Markdown-语法&quot;&gt;&lt;a href=&quot;#Markdown-语法&quot; class=&quot;headerlink&quot; title=&quot;Markdown 语法&quot;&gt;&lt;/a&gt;Markdown 语法&lt;/h2&gt;&lt;h3 id=&quot;标题&quot;&gt;&lt;a href=&quot;#标题&quot; class=&quot;headerlink&quot; title=&quot;标题&quot;&gt;&lt;/a&gt;标题&lt;/h3&gt;&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;# 一级标题&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;## 二级标题&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;### 三级标题&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;#### 四级标题&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;

&lt;h3 id=&quot;字体&quot;&gt;&lt;a href=&quot;#字体&quot; class=&quot;headerlink&quot; title=&quot;字体&quot;&gt;&lt;/a&gt;字体&lt;/h3&gt;&lt;figure class=&quot;highlight plaintext&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;**文字加粗**&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;*文字倾斜*&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;***文字斜体加粗***&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;~~文字加删除线~~&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;文字加粗&lt;/strong&gt;&lt;br&gt;&lt;em&gt;文字倾斜&lt;/em&gt;&lt;br&gt;&lt;em&gt;&lt;strong&gt;文字斜体加粗&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;&lt;del&gt;文字加删除线&lt;/del&gt;&lt;/p&gt;</summary>
    
    
    
    <category term="Markdown" scheme="https://zoiii.cn/categories/Markdown/"/>
    
    
    <category term="Markdown" scheme="https://zoiii.cn/tags/Markdown/"/>
    
  </entry>
  
  <entry>
    <title>Hello World</title>
    <link href="https://zoiii.cn/2025/06/06/hello-world/"/>
    <id>https://zoiii.cn/2025/06/06/hello-world/</id>
    <published>2025-06-06T11:08:22.000Z</published>
    <updated>2025-08-02T04:24:51.582Z</updated>
    
    <content type="html"><![CDATA[<p>Welcome to <a href="https://hexo.io/">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues">GitHub</a>.</p><h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">&quot;My New Post&quot;</span></span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/writing.html">Writing</a></p><h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/server.html">Server</a></p><h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/generating.html">Generating</a></p><h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/one-command-deployment.html">Deployment</a></p>]]></content>
    
    
      
      
    <summary type="html">&lt;p&gt;Welcome to &lt;a href=&quot;https://hexo.io/&quot;&gt;Hexo&lt;/a&gt;! This is your very first post. Check &lt;a href=&quot;https://hexo.io/docs/&quot;&gt;documentation&lt;/a&gt; for</summary>
      
    
    
    
    <category term="Hexo" scheme="https://zoiii.cn/categories/Hexo/"/>
    
    
    <category term="Hexo" scheme="https://zoiii.cn/tags/Hexo/"/>
    
  </entry>
  
</feed>
