<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <author>
    <name>mumutingyun</name>
  </author>
  <generator uri="https://hexo.io/">Hexo</generator>
  <id>https://mumutingyun.site/</id>
  <link href="https://mumutingyun.site/" rel="alternate"/>
  <link href="https://mumutingyun.site/atom.xml" rel="self"/>
  <rights>All rights reserved 2026, mumutingyun</rights>
  <subtitle>秘密测试中</subtitle>
  <title>陈牧图的个人站点</title>
  <updated>2026-07-25T04:01:08.689Z</updated>
  <entry>
    <author>
      <name>mumutingyun</name>
    </author>
    <content>
      <![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>
    <id>https://mumutingyun.site/2026/07/25/hello-world/</id>
    <link href="https://mumutingyun.site/2026/07/25/hello-world/"/>
    <published>2026-07-25T04:01:08.689Z</published>
    <summary>
      <![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]]>
    </summary>
    <title>Hello World</title>
    <updated>2026-07-25T04:01:08.689Z</updated>
  </entry>
  <entry>
    <author>
      <name>mumutingyun</name>
    </author>
    <category term="示波器" scheme="https://mumutingyun.site/tags/%E7%A4%BA%E6%B3%A2%E5%99%A8/"/>
    <category term="FPGA" scheme="https://mumutingyun.site/tags/FPGA/"/>
    <content>
      <![CDATA[<h2 id="一、处理板定位"><a href="#一、处理板定位" class="headerlink" title="一、处理板定位"></a>一、处理板定位</h2><p>处理板同样是一块 FPGA 板，使用与采集板相同的芯片，<strong>不是</strong> PC 上位机。系统实际为三层：</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">PC 上位机 (PCIe ×4)</span><br><span class="line">    ↕</span><br><span class="line">处理板 FPGA (GT ×16, 接最多 8 块采集板)</span><br><span class="line">    ↕</span><br><span class="line">采集板 ×8 (每板 1 片 ADC)</span><br></pre></td></tr></table></figure><p>处理板的核心职责：汇聚多块采集板的数据、做最终的触发决策、将波形渲染为屏幕像素、通过 PCIe 发送给 PC。</p><hr><h2 id="二、整体数据流"><a href="#二、整体数据流" class="headerlink" title="二、整体数据流"></a>二、整体数据流</h2><pre class="mermaid">%%{init: {'theme': 'base', 'themeVariables': { 'lineColor': '#aaa' }}}%%flowchart TB    ACQ1["ACQ1 GT 数据"]    ACQ2["ACQ2 GT 数据"]    ACQ8["ACQ8 GT 数据"]    GT_RX["GT 接收<br/>16对 lane"]    GT_DEMUX["GT 解复用<br/>波形 vs 触发信息"]    SYNC["同步 FIFO<br/>多板对齐"]    DSP["DSP 处理链"]    TRIG1["第一级触发<br/>触发决策"]    TRIG2["第二级触发<br/>高级触发"]    UPO["UPO 波形绘制<br/>数字余辉"]    PCIE["PCIe GT ×4"]    PC["PC 上位机"]    ACQ1 & ACQ2 & ACQ8 --> GT_RX --> GT_DEMUX    GT_DEMUX -- 波形数据 --> SYNC --> DSP --> TRIG2 --> UPO --> PCIE --> PC    GT_DEMUX -- 触发信息 --> TRIG1</pre><hr><h2 id="三、核心模块"><a href="#三、核心模块" class="headerlink" title="三、核心模块"></a>三、核心模块</h2><h3 id="1-同步-FIFO——多板数据对齐"><a href="#1-同步-FIFO——多板数据对齐" class="headerlink" title="1. 同步 FIFO——多板数据对齐"></a>1. 同步 FIFO——多板数据对齐</h3><p>这是多板系统中最重要的模块。每块采集板独立写入各自的 FIFO，当所有板都有足够数据时才同时读出。各板的写入完成时间和控制信号传播延迟各不相同，同步 FIFO 确保数据在进入后续处理时严格对齐。</p><h3 id="2-SPI-路由——PC-如何控制所有板卡"><a href="#2-SPI-路由——PC-如何控制所有板卡" class="headerlink" title="2. SPI 路由——PC 如何控制所有板卡"></a>2. SPI 路由——PC 如何控制所有板卡</h3><p>SPI 是一种四线制全双工同步串行总线（CS 片选、SCK 时钟、MOSI 主机发从机收、MISO 从机发主机收），主从架构。PC 上位机不直接与采集板通信——所有寄存器读写命令都发给处理板，处理板根据地址范围判断目标：低地址段对应自身的寄存器，高地址段转发给对应采集板，最后汇总返回数据一并回传。</p><h3 id="3-触发决策——两级触发的分工"><a href="#3-触发决策——两级触发的分工" class="headerlink" title="3. 触发决策——两级触发的分工"></a>3. 触发决策——两级触发的分工</h3><p>这是笔记1中触发话题的延续，也是最体现系统设计思路的部分。</p><p>采集板的触发比较器只做硬件边沿检测，产生”候选触发”信息。处理板汇总所有采集板（多板、多通道）的边沿数据，结合触发源选择和触发模式配置，做出最终的触发决策。</p><p><strong>关键理解</strong>：触发决策权在处理板侧。采集板只负责检测边沿，处理板决定用哪个通道、什么条件来触发。边沿触发、脉宽触发、协议触发、逻辑触发等完整触发逻辑实际执行在处理板上——采集板只是数据源和比较器前端。</p><h3 id="4-第二级触发——高级触发条件"><a href="#4-第二级触发——高级触发条件" class="headerlink" title="4. 第二级触发——高级触发条件"></a>4. 第二级触发——高级触发条件</h3><p>在 IFIR 插值后的数据上执行高级触发条件检测。插值后采样点更多，触发精度更高。支持的触发类型包括：边沿、脉宽、斜率、矮脉冲（Runt）、窗口、间隔、超时、失落（Dropout）、码型、逻辑条件（与&#x2F;或&#x2F;非）、建立&#x2F;保持时间等。</p><h3 id="5-UPO-波形绘制——数字余辉"><a href="#5-UPO-波形绘制——数字余辉" class="headerlink" title="5. UPO 波形绘制——数字余辉"></a>5. UPO 波形绘制——数字余辉</h3><p>UPO（Ultra Power Oscilloscope）是示波器的显示引擎。将高速采样数据（GSa&#x2F;s 级）映射到有限的屏幕像素（~1000 列）：</p><ul><li><strong>矢量显示</strong>：每列保留最大&#x2F;最小值，不会丢失窄脉冲</li><li><strong>数字余辉</strong>：波形点在每列的出现频率累积为亮度值，模拟模拟示波器的荧光屏效果</li></ul><p>从 FPGA 角度看，UPO 模块类似于一个<strong>时域压缩器</strong>——输入是 GSa&#x2F;s 的采样流，输出是适配屏幕分辨率（~MHz 级）的像素数据。</p><hr><h2 id="四、双板触发同步流程"><a href="#四、双板触发同步流程" class="headerlink" title="四、双板触发同步流程"></a>四、双板触发同步流程</h2><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></pre></td><td class="code"><pre><span class="line">时间线 →</span><br><span class="line"></span><br><span class="line">处理板: [空闲] → [等待触发] → [收到触发信息] → [预触发] → [后触发]</span><br><span class="line">采集板:   [持续写入 DDR]  →  [触发比较器检测到触发]</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">采集板:   [DDR 写停止]</span><br><span class="line">            → 写完成告知处理板</span><br><span class="line"></span><br><span class="line">处理板:   [检测所有采集板写完]  →  发起读使能</span><br><span class="line">采集板:   [收到读命令]  →  通过 GT 发送数据</span><br><span class="line"></span><br><span class="line">处理板:   [接收数据 + DSP 处理]  →  PCIe 发送至 PC</span><br></pre></td></tr></table></figure><p>两板之间通过两套物理通道协调工作：<strong>同步通道</strong>传输触发地址和复位等实时性要求高的信号（通过高速串行化和可编程延迟校准保证多板严格同步），<strong>异步通道</strong>传输写完成、读使能等状态标志。</p><hr>]]>
    </content>
    <id>https://mumutingyun.site/2026/07/24/%E7%A4%BA%E6%B3%A2%E5%99%A8%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B02/</id>
    <link href="https://mumutingyun.site/2026/07/24/%E7%A4%BA%E6%B3%A2%E5%99%A8%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B02/"/>
    <published>2026-07-24T10:00:00.000Z</published>
    <summary>
      <![CDATA[<h2 id="一、处理板定位"><a href="#一、处理板定位" class="headerlink" title="一、处理板定位"></a>一、处理板定位</h2><p>处理板同样是一块 FPGA 板，使用与采集板相同的芯片，<strong>不是</strong> PC]]>
    </summary>
    <title>示波器学习笔记2 —— 处理板多板汇聚与传输链路</title>
    <updated>2026-07-25T04:01:08.689Z</updated>
  </entry>
  <entry>
    <author>
      <name>mumutingyun</name>
    </author>
    <category term="示波器" scheme="https://mumutingyun.site/tags/%E7%A4%BA%E6%B3%A2%E5%99%A8/"/>
    <category term="FPGA" scheme="https://mumutingyun.site/tags/FPGA/"/>
    <content>
      <![CDATA[<h2 id="一、系统层次"><a href="#一、系统层次" class="headerlink" title="一、系统层次"></a>一、系统层次</h2><p>系统为三层架构：</p><ul><li><strong>采集板（ACQ）</strong>：接收 ADC 数据，触发检测，数据存储与预处理，GT 发送</li><li><strong>处理板（PRO）</strong>：也是 FPGA 板。汇聚多块采集板数据，DSP 处理，触发决策，波形绘制，PCIe 发送</li><li><strong>PC 上位机</strong>：软件显示与交互</li></ul><p>本文介绍采集板的数据通路与核心模块。</p><hr><h2 id="二、整体数据流"><a href="#二、整体数据流" class="headerlink" title="二、整体数据流"></a>二、整体数据流</h2><pre class="mermaid">%%{init: {'theme': 'base', 'themeVariables': { 'lineColor': '#aaa' }}}%%flowchart TB    ADC["ADC 采集<br/>JESD204B 接口"]    GAIN["数字增益"]    FILTER["带宽限制滤波"]    TRIG_DEC["触发路径<br/>通道间隔抽取"]    TRIG_CMP["触发比较器"]    PRE_DEC["前置抽取<br/>峰值/高分辨率"]    STORE["存储<br/>Scan/RAM/DDR4"]    FUSE["通道融合<br/>256→8路 FIFO"]    DSP_FIR["DSP FIR 校准滤波"]    POST["后级处理<br/>抽取→插值→DBI→GT"]    PRO["处理板"]    ADC --> GAIN --> FILTER    FILTER --> TRIG_DEC --> TRIG_CMP --> POST    FILTER --> PRE_DEC --> STORE --> FUSE --> DSP_FIR --> POST    POST --> PRO</pre><p>数据从 ADC 进来后分叉为两条路径：</p><table><thead><tr><th></th><th>触发路径</th><th>主数据路径</th></tr></thead><tbody><tr><td><strong>目的</strong></td><td>实时检测触发事件</td><td>存储、处理、传输完整波形</td></tr><tr><td><strong>延迟要求</strong></td><td>极低</td><td>允许较高延迟</td></tr><tr><td><strong>数据量</strong></td><td>仅需判断触发条件</td><td>需要完整波形数据</td></tr></tbody></table><hr><h2 id="三、核心模块"><a href="#三、核心模块" class="headerlink" title="三、核心模块"></a>三、核心模块</h2><h3 id="1-ADC-与-JESD204B-接口"><a href="#1-ADC-与-JESD204B-接口" class="headerlink" title="1. ADC 与 JESD204B 接口"></a>1. ADC 与 JESD204B 接口</h3><p>高速 ADC 与 FPGA 之间采用 <strong>JESD204B 协议</strong>进行数据传输，这是一种高速串行接口标准，每对差分线速率可达 10Gbps 以上。数据被编码成帧后通过 SerDes Lane 传输，FPGA 端使用 GTY 高速收发器硬核接收，配合 JESD204B IP 核完成帧解码，恢复为并行数据。</p><p>JESD204B 取代了传统并行 LVDS 接口，优势在于引脚数少、速率高、无需处理多路数据线间的时序偏移。</p><h3 id="2-数字增益与带宽滤波"><a href="#2-数字增益与带宽滤波" class="headerlink" title="2. 数字增益与带宽滤波"></a>2. 数字增益与带宽滤波</h3><p>数字增益对 ADC 输出进行幅度缩放，配合模拟前端实现垂直灵敏度档位切换。带宽限制滤波为 FIR 低通滤波器，滤除高频噪声，防止后续抽取时的频谱混叠。</p><h3 id="3-触发比较器——示波器的核心"><a href="#3-触发比较器——示波器的核心" class="headerlink" title="3. 触发比较器——示波器的核心"></a>3. 触发比较器——示波器的核心</h3><p>触发路径先做通道间隔抽取（256 路取 1&#x2F;4 为 64 路，降低数据量），送入触发比较器。比较器将数据与触发电平比较，检测上升沿&#x2F;下降沿，产生触发标志。</p><p><strong>触发是示波器最核心的机制</strong>。信号以 GSa&#x2F;s 速率涌入，屏幕只刷几十 Hz。触发通过锁定信号的特定相位，保证每帧波形起始位置一致，使显示稳定不滚动。</p><p>频率计也挂接在此处，利用边沿计数配合闸门时间计算信号频率。</p><h3 id="4-前置抽取与存储"><a href="#4-前置抽取与存储" class="headerlink" title="4. 前置抽取与存储"></a>4. 前置抽取与存储</h3><p>根据时基档位对数据流进行抽取，使数据率匹配存储带宽。两种关键模式：</p><ul><li><strong>峰值检测（Peak Detection）</strong>：取区间内最大&#x2F;最小值——即使大量抽取也不丢失窄脉冲。这是示波器区别于普通 ADC 采集卡的核心特征。</li><li><strong>高分辨率（Hi-Res）</strong>：取平均值，提高有效位数。</li></ul><p>抽取后三条子路径：Scan（滚动显示，不存储）、RAM（FPGA 内部环形缓冲，短时基触发捕获）、DDR4（外部深存储，GB 级，长时基和分段存储）。</p><h3 id="5-通道融合（256→8-路-FIFO）与跨时钟域"><a href="#5-通道融合（256→8-路-FIFO）与跨时钟域" class="headerlink" title="5. 通道融合（256→8 路 FIFO）与跨时钟域"></a>5. 通道融合（256→8 路 FIFO）与跨时钟域</h3><p>异步 FIFO 将 256 路宽并行数据压缩为 8 路，同时从 ADC 时钟域切换到系统时钟域。这是关键的<strong>跨时钟域（CDC）处理</strong>——多 bit 数据跨时钟域的标准方案就是异步 FIFO。</p><h3 id="6-DSP-FIR-校准滤波——TIADC-校准"><a href="#6-DSP-FIR-校准滤波——TIADC-校准" class="headerlink" title="6. DSP FIR 校准滤波——TIADC 校准"></a>6. DSP FIR 校准滤波——TIADC 校准</h3><p>复系数 FIR 滤波器，用于 <strong>TIADC（时间交织 ADC）通道失配校准</strong>。TIADC 用多颗 ADC 交替采样来提高等效采样率，但各通道间存在增益&#x2F;偏移&#x2F;时钟偏斜误差。FIR 滤波器在线更新校准系数，消除拼合波形的杂散谱。</p><h3 id="7-IFIR-精细插值"><a href="#7-IFIR-精细插值" class="headerlink" title="7. IFIR 精细插值"></a>7. IFIR 精细插值</h3><p>非整数倍插值滤波器，在原始采样点间插入估算点（等效 sin(x)&#x2F;x 插值）。小时基档位下采样点不足时，IFIR 使波形显示平滑。</p><h3 id="8-DBI-与-GT-高速发送"><a href="#8-DBI-与-GT-高速发送" class="headerlink" title="8. DBI 与 GT 高速发送"></a>8. DBI 与 GT 高速发送</h3><p><strong>DBI</strong> 负责 2x&#x2F;4x 插值、DUC（数字上变频）和数据打包成帧。注意这里的 DBI 指 Digital Bandwidth Interpolation，<strong>不是</strong> Digital Bandwidth Interleaving（多颗低速 ADC 频域拼接技术）。</p><p><strong>GT 收发器</strong>内部含 PCS（8b&#x2F;10b 编码）和 PMA（串行化&#x2F;解串），将并行数据转为串行 bit 流发往处理板。这才是真正完成并转串的模块。</p><hr>]]>
    </content>
    <id>https://mumutingyun.site/2026/07/24/%E7%A4%BA%E6%B3%A2%E5%99%A8%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B01/</id>
    <link href="https://mumutingyun.site/2026/07/24/%E7%A4%BA%E6%B3%A2%E5%99%A8%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B01/"/>
    <published>2026-07-24T09:37:18.000Z</published>
    <summary>
      <![CDATA[<h2 id="一、系统层次"><a href="#一、系统层次" class="headerlink" title="一、系统层次"></a>一、系统层次</h2><p>系统为三层架构：</p>
<ul>
<li><strong>采集板（ACQ）</strong>：接收 ADC]]>
    </summary>
    <title>示波器学习笔记1 —— 采集板数据通路与核心模块</title>
    <updated>2026-07-25T04:01:08.689Z</updated>
  </entry>
  <entry>
    <author>
      <name>mumutingyun</name>
    </author>
    <category term="Hexo" scheme="https://mumutingyun.site/tags/Hexo/"/>
    <category term="博客" scheme="https://mumutingyun.site/tags/%E5%8D%9A%E5%AE%A2/"/>
    <category term="使用指南" scheme="https://mumutingyun.site/tags/%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97/"/>
    <content>
      <![CDATA[<h2 id="一、前提：进入-WSL-环境"><a href="#一、前提：进入-WSL-环境" class="headerlink" title="一、前提：进入 WSL 环境"></a>一、前提：进入 WSL 环境</h2><p>所有操作都在 WSL Ubuntu 终端中进行。</p><h3 id="在-VS-Code-终端中进入-WSL（三种方式）"><a href="#在-VS-Code-终端中进入-WSL（三种方式）" class="headerlink" title="在 VS Code 终端中进入 WSL（三种方式）"></a>在 VS Code 终端中进入 WSL（三种方式）</h3><p><strong>方式 1：直接输入命令（最简单）</strong></p><p>在 VS Code 中按 &#96;Ctrl + &#96;&#96; 打开终端，输入：</p><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">wsl</span><br></pre></td></tr></table></figure><p>回车后进入 Ubuntu，你会看到提示符变成 <code>wsluser@...</code>。</p><p><strong>方式 2：新建 WSL 专用终端</strong></p><p>点击终端右上角 <code>+</code> 旁边的 <code>˅</code> 下拉箭头 → 选择 <strong>“Ubuntu (WSL)”</strong></p><p><strong>方式 3：把 WSL 设为默认终端</strong></p><p>按 <code>Ctrl + Shift + P</code> → 搜索 <code>Terminal: Select Default Profile</code> → 选择 <strong>Ubuntu (WSL)</strong>，之后每次打开终端默认就是 Ubuntu。</p><h3 id="进入博客目录"><a href="#进入博客目录" class="headerlink" title="进入博客目录"></a>进入博客目录</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"><span class="built_in">cd</span> ~/blog</span><br></pre></td></tr></table></figure><h3 id="用-VS-Code-打开文件"><a href="#用-VS-Code-打开文件" class="headerlink" title="用 VS Code 打开文件"></a>用 VS Code 打开文件</h3><p>在 WSL 终端中可以用 <code>code</code> 命令直接在 VS Code 中打开任何文件：</p><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">code ~/blog/source/_posts/文件名.md</span><br></pre></td></tr></table></figure><blockquote><p>前提：VS Code 需安装 <strong>Remote - WSL</strong> 扩展（通常已预装）。</p></blockquote><hr><h2 id="二、电脑端写作与发布"><a href="#二、电脑端写作与发布" class="headerlink" title="二、电脑端写作与发布"></a>二、电脑端写作与发布</h2><h3 id="创建新文章"><a href="#创建新文章" class="headerlink" title="创建新文章"></a>创建新文章</h3><figure class="highlight bash"><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 class="built_in">cd</span> ~/blog 或者直接<span class="built_in">cd</span> ~/blog/source/_posts</span><br><span class="line">hexo new <span class="string">&quot;我的第一篇文章&quot;</span></span><br></pre></td></tr></table></figure><blockquote><p>⚠️ 标题不要带 <code>.md</code> 后缀，Hexo 会自动加上。</p></blockquote><p>这会在 <code>source/_posts/</code> 下生成 <code>我的第一篇文章.md</code>，然后可以用 VS Code 打开编辑：</p><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">code <span class="built_in">source</span>/_posts/我的第一篇文章.md</span><br></pre></td></tr></table></figure><h3 id="Markdown-文章头部格式（Front-Matter）"><a href="#Markdown-文章头部格式（Front-Matter）" class="headerlink" title="Markdown 文章头部格式（Front Matter）"></a>Markdown 文章头部格式（Front Matter）</h3><figure class="highlight markdown"><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">---</span><br><span class="line">title: 我的第一篇文章</span><br><span class="line">date: 2026-07-20 20:00:00</span><br><span class="line">categories:</span><br><span class="line"><span class="bullet">  -</span> 技术</span><br><span class="line">tags:</span><br><span class="line"><span class="bullet">  -</span> Hexo</span><br><span class="line"><span class="section">  - 博客</span></span><br><span class="line"><span class="section">---</span></span><br><span class="line">正文内容从这里开始...</span><br></pre></td></tr></table></figure><h3 id="本地预览"><a href="#本地预览" class="headerlink" title="本地预览"></a>本地预览</h3><figure class="highlight bash"><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 class="built_in">cd</span> ~/blog</span><br><span class="line">hexo server</span><br></pre></td></tr></table></figure><p>浏览器打开 <code>http://localhost:4000</code> 即可预览。</p><h3 id="发布到线上"><a href="#发布到线上" class="headerlink" title="发布到线上"></a>发布到线上</h3><p><strong>现在不再使用 <code>hexo deploy</code></strong>，而是用 Git 直接推送源码，让 Netlify 自动构建：</p><figure class="highlight bash"><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">git add -A</span><br><span class="line">git commit -m <span class="string">&quot;描述你改了什么&quot;</span></span><br><span class="line">git push origin main</span><br></pre></td></tr></table></figure><p>推送后 Netlify 会自动检测变更，自己执行 <code>hexo generate</code> 并部署上线（约 1-2 分钟生效）。</p><h3 id="为什么不用-hexo-deploy-了？"><a href="#为什么不用-hexo-deploy-了？" class="headerlink" title="为什么不用 hexo deploy 了？"></a>为什么不用 <code>hexo deploy</code> 了？</h3><p>之前 <code>hexo deploy</code> 会把编译后的 HTML 直接推送到 GitHub，Netlify 拿到 HTML 不知道怎么构建，导致部署失败。</p><p>现在改为推送<strong>源码</strong>到 GitHub，Netlify 在服务器上自己执行 <code>hexo generate</code>，流程正确：</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">你的电脑 ──git push──→ GitHub（源码：.md、_config.yml、主题...）</span><br><span class="line">                              ↓</span><br><span class="line">                        Netlify 自动执行 hexo generate → 部署上线</span><br></pre></td></tr></table></figure><h3 id="hexo-generate-还要用吗？"><a href="#hexo-generate-还要用吗？" class="headerlink" title="hexo generate 还要用吗？"></a><code>hexo generate</code> 还要用吗？</h3><p><strong>发布上线不需要</strong>，Netlify 会替你执行。</p><p><strong>本地预览时需要</strong>：</p><figure class="highlight bash"><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">hexo generate   <span class="comment"># 生成 static 文件</span></span><br><span class="line">hexo server     <span class="comment"># 启动预览 http://localhost:4000</span></span><br></pre></td></tr></table></figure><p>或者直接 <code>hexo server</code>（它会自动生成后再启动）。</p><blockquote><p>📱 <strong>手机 CMS 例外</strong>：CMS 点”发布”会自动 commit + push 到 GitHub，Netlify 自动构建，全程无需手动操作。</p></blockquote><hr><h2 id="三、📁-文章管理"><a href="#三、📁-文章管理" class="headerlink" title="三、📁 文章管理"></a>三、📁 文章管理</h2><h3 id="重命名文章"><a href="#重命名文章" class="headerlink" title="重命名文章"></a>重命名文章</h3><figure class="highlight bash"><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 class="built_in">mv</span> ~/blog/source/_posts/旧名称.md ~/blog/source/_posts/新名称.md</span><br><span class="line">code ~/blog/source/_posts/新名称.md    <span class="comment"># 打开后把 title 也改成新名称</span></span><br><span class="line">git add -A &amp;&amp; git commit -m <span class="string">&quot;重命名文章&quot;</span> &amp;&amp; git push origin main  <span class="comment"># 发布</span></span><br></pre></td></tr></table></figure><h3 id="删除文章"><a href="#删除文章" class="headerlink" title="删除文章"></a>删除文章</h3><p><strong>方式 1：命令行</strong></p><figure class="highlight bash"><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 class="built_in">rm</span> ~/blog/source/_posts/文件名.md</span><br><span class="line">git add -A &amp;&amp; git commit -m <span class="string">&quot;删除文章&quot;</span> &amp;&amp; git push origin main</span><br></pre></td></tr></table></figure><p><strong>方式 2：VS Code 中删除</strong><br>在左侧文件资源管理器找到 <code>source/_posts/</code>，右键文件 → Delete，然后终端执行 <code>git add -A &amp;&amp; git commit -m &quot;删除文章&quot; &amp;&amp; git push origin main</code>。</p><p><strong>方式 3：手机 CMS 删除</strong><br>登录 <code>https://mumutingyun.netlify.app/admin/</code>，进入文章后点删除（自动 commit + push，Netlify 自动部署）。</p><hr><h2 id="四、📱-手机端登录后台（Decap-CMS）"><a href="#四、📱-手机端登录后台（Decap-CMS）" class="headerlink" title="四、📱 手机端登录后台（Decap CMS）"></a>四、📱 手机端登录后台（Decap CMS）</h2><ol><li><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">https://mumutingyun.netlify.app/admin/  或</span><br><span class="line">https://mumutingyun.site/admin/</span><br></pre></td></tr></table></figure></li><li><p>点击 <strong>“Login with Netlify Identity”</strong></p></li><li><p>点击 <strong>“Continue with GitHub”</strong></p></li><li><p>用你的 GitHub 账号（<code>mumutingyun</code>）授权登录</p></li><li><p>登录后你可以：</p><ul><li>✏️ 左侧菜单 → “文章” → “新建文章”</li><li>📝 用 Markdown 格式写正文</li><li>🖼️ 上传图片（存到 <code>source/images/</code>）</li><li>📤 点击右上角 “发布” → “立即发布”</li></ul></li><li><p>发布后约 1-2 分钟网站生效</p></li></ol><hr><h2 id="五、Git-远程仓库工作流"><a href="#五、Git-远程仓库工作流" class="headerlink" title="五、Git 远程仓库工作流"></a>五、Git 远程仓库工作流</h2><p><strong>设置 Git 身份（首次执行）：</strong></p><figure class="highlight bash"><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 class="built_in">cd</span> ~/blog</span><br><span class="line">git config user.name <span class="string">&quot;mumutingyun&quot;</span></span><br><span class="line">git config user.email <span class="string">&quot;3194491988@qq.com&quot;</span></span><br></pre></td></tr></table></figure><p><strong>设置远程仓库：</strong></p><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">git remote add origin https://github.com/mumutingyun/mumutingyun.github.io.git</span><br></pre></td></tr></table></figure><p>如果已存在先删除：</p><figure class="highlight bash"><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">git remote remove origin</span><br><span class="line">git remote add origin https://github.com/mumutingyun/mumutingyun.github.io.git</span><br></pre></td></tr></table></figure><hr><h2 id="六、📋-完整工作流速查表"><a href="#六、📋-完整工作流速查表" class="headerlink" title="六、📋 完整工作流速查表"></a>六、📋 完整工作流速查表</h2><table><thead><tr><th>场景</th><th>操作方式</th></tr></thead><tbody><tr><td>💻 电脑写文章</td><td><code>hexo new &quot;标题&quot;</code> → 编辑 <code>.md</code> → <code>git push origin main</code> 发布</td></tr><tr><td>📱 手机写文章</td><td>浏览器打开 <code>/admin/</code> → GitHub 登录 → CMS 编辑 → 点”发布”</td></tr><tr><td>✏️ 重命名文章</td><td><code>mv</code> 改名 → <code>code</code> 修改 title → <code>git push origin main</code></td></tr><tr><td>🗑️ 删除文章</td><td><code>rm</code> 删除 → <code>git push origin main</code>（CMS 删除自动部署）</td></tr><tr><td>🔍 本地预览</td><td><code>hexo server</code> → 访问 <code>http://localhost:4000</code></td></tr><tr><td>🔄 拉取最新</td><td><code>git pull origin main</code></td></tr></tbody></table><hr><h2 id="七、⚠️-重要注意事项"><a href="#七、⚠️-重要注意事项" class="headerlink" title="七、⚠️ 重要注意事项"></a>七、⚠️ 重要注意事项</h2><ol><li><strong>手机端 CMS 发布后</strong>，电脑端需要先 <code>git pull</code> 再写新文章，否则会冲突</li><li><strong>电脑端 <code>hexo deploy</code> 后</strong>，CMS 中也能看到最新内容</li><li><strong>图片上传</strong>：CMS 上传的图片在 <code>source/images/</code>，引用路径为 <code>/images/xxx.jpg</code></li><li><strong>不要同时两边编辑同一篇文章</strong>，会产生 Git 冲突</li><li>如果还没在 Netlify Identity 中添加 GitHub OAuth，选中 <strong>“Let me use my own OAuth app credentials”</strong>，填入：<ul><li>Client ID: <code>Ov23li8fcEG8q7qu3CDP</code></li><li>Client Secret: <code>77292aff48c4e4f657a84389387617f7b1a50eaf</code></li></ul></li></ol><hr><h2 id="八、首次部署检查清单"><a href="#八、首次部署检查清单" class="headerlink" title="八、首次部署检查清单"></a>八、首次部署检查清单</h2><ul><li><input disabled="" type="checkbox"> GitHub 仓库 <code>mumutingyun.github.io</code> 已创建</li><li><input disabled="" type="checkbox"> 代码已 push 到 GitHub</li><li><input disabled="" type="checkbox"> Netlify 已连接仓库，构建命令 <code>hexo generate</code>，发布目录 <code>public</code></li><li><input disabled="" type="checkbox"> Netlify Identity 已启用</li><li><input disabled="" type="checkbox"> Git Gateway 已启用（Netlify Identity → Services）</li><li><input disabled="" type="checkbox"> GitHub OAuth 已配置为外部提供者</li><li><input disabled="" type="checkbox"> <code>https://mumutingyun.netlify.app</code> 能正常访问</li><li><input disabled="" type="checkbox"> <code>https://mumutingyun.netlify.app/admin/</code> 能打开 CMS 登录页</li></ul><hr><h2 id="九、🖥️-在新电脑上搭建写作环境"><a href="#九、🖥️-在新电脑上搭建写作环境" class="headerlink" title="九、🖥️ 在新电脑上搭建写作环境"></a>九、🖥️ 在新电脑上搭建写作环境</h2><p>如果你换了电脑或想在另一台电脑上写文章，不需要重新走完整搭建流程，只需把 GitHub 上的代码拉下来即可。</p><h3 id="前提：新电脑也需要-WSL-Node-js"><a href="#前提：新电脑也需要-WSL-Node-js" class="headerlink" title="前提：新电脑也需要 WSL + Node.js"></a>前提：新电脑也需要 WSL + Node.js</h3><p>在新电脑上先安装基础环境：</p><ol><li>安装 WSL2 + Ubuntu</li><li>安装 nvm + Node.js：<figure class="highlight bash"><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">curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash</span><br><span class="line"><span class="comment"># 关闭终端重新打开</span></span><br><span class="line">nvm install 24</span><br></pre></td></tr></table></figure></li></ol><h3 id="拉取博客代码"><a href="#拉取博客代码" class="headerlink" title="拉取博客代码"></a>拉取博客代码</h3><figure class="highlight bash"><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"><span class="comment"># 克隆仓库</span></span><br><span class="line">git <span class="built_in">clone</span> https://github.com/mumutingyun/mumutingyun.github.io.git ~/blog</span><br><span class="line"><span class="built_in">cd</span> ~/blog</span><br><span class="line"></span><br><span class="line"><span class="comment"># 安装依赖（等同于 npm install，自动读取 package.json）</span></span><br><span class="line">npm install</span><br><span class="line"></span><br><span class="line"><span class="comment"># 设置 Git 身份</span></span><br><span class="line">git config user.name <span class="string">&quot;mumutingyun&quot;</span></span><br><span class="line">git config user.email <span class="string">&quot;3194491988@qq.com&quot;</span></span><br></pre></td></tr></table></figure><h3 id="日常写作流程（在任何一台电脑上都一样）"><a href="#日常写作流程（在任何一台电脑上都一样）" class="headerlink" title="日常写作流程（在任何一台电脑上都一样）"></a>日常写作流程（在任何一台电脑上都一样）</h3><figure class="highlight bash"><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"><span class="comment"># 1. 开工前先拉取最新（防止另一台电脑或手机 CMS 有更新）</span></span><br><span class="line"><span class="built_in">cd</span> ~/blog</span><br><span class="line">git pull origin main</span><br><span class="line"></span><br><span class="line"><span class="comment"># 2. 写文章</span></span><br><span class="line">hexo new <span class="string">&quot;文章标题&quot;</span></span><br><span class="line">code <span class="built_in">source</span>/_posts/文章标题.md</span><br><span class="line"></span><br><span class="line"><span class="comment"># 3. 本地预览</span></span><br><span class="line">hexo server</span><br><span class="line"><span class="comment"># 浏览器打开 http://localhost:4000</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 4. 发布上线</span></span><br><span class="line">git add -A</span><br><span class="line">git commit -m <span class="string">&quot;描述改动&quot;</span></span><br><span class="line">git push origin main</span><br></pre></td></tr></table></figure><h3 id="⚠️-跨电脑协作注意事项"><a href="#⚠️-跨电脑协作注意事项" class="headerlink" title="⚠️ 跨电脑协作注意事项"></a>⚠️ 跨电脑协作注意事项</h3><ol><li><strong>写之前一定要 <code>git pull</code></strong>，否则可能和另一台电脑或手机 CMS 的更新冲突</li><li><strong><code>node_modules/</code> 已经被 <code>.gitignore</code> 忽略</strong>，不会上传到 GitHub。所以克隆后必须执行 <code>npm install</code> 才能运行</li><li><strong><code>package.json</code> 和 <code>package-lock.json</code> 会同步</strong>，如果你在其中一台电脑安装了新插件（<code>npm install xxx --save</code>），另一台电脑 <code>git pull</code> 后再 <code>npm install</code> 就能同步</li><li><strong><code>_config.yml</code> 中不要写 Token</strong>。用 HTTPS 推送时如果遇到认证问题，可以在 URL 中临时嵌入 Token，但不要 commit 包含 Token 的配置文件</li></ol>]]>
    </content>
    <id>https://mumutingyun.site/2026/07/20/%E6%93%8D%E4%BD%9C%E6%8C%87%E5%8D%97/</id>
    <link href="https://mumutingyun.site/2026/07/20/%E6%93%8D%E4%BD%9C%E6%8C%87%E5%8D%97/"/>
    <published>2026-07-20T12:48:14.000Z</published>
    <summary>
      <![CDATA[<h2 id="一、前提：进入-WSL-环境"><a href="#一、前提：进入-WSL-环境" class="headerlink" title="一、前提：进入 WSL 环境"></a>一、前提：进入 WSL 环境</h2><p>所有操作都在 WSL Ubuntu 终端中进]]>
    </summary>
    <title>操作指南</title>
    <updated>2026-07-25T04:01:08.689Z</updated>
  </entry>
</feed>
