<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <author>
    <name>secco</name>
  </author>
  <generator uri="https://hexo.io/">Hexo</generator>
  <id>https://youlixsecco.online/</id>
  <link href="https://youlixsecco.online/" rel="alternate"/>
  <link href="https://youlixsecco.online/atom.xml" rel="self"/>
  <rights>All rights reserved 2026, secco</rights>
  <title>Secco</title>
  <updated>2026-08-23T15:26:37.000Z</updated>
  <entry>
    <author>
      <name>secco</name>
    </author>
    <category term="技术文档" scheme="https://youlixsecco.online/categories/%E6%8A%80%E6%9C%AF%E6%96%87%E6%A1%A3/"/>
    <category term="Hexo" scheme="https://youlixsecco.online/tags/Hexo/"/>
    <category term="水贴" scheme="https://youlixsecco.online/tags/%E6%B0%B4%E8%B4%B4/"/>
    <content>
      <![CDATA[<h2 id="基础核心命令"><a href="#基础核心命令" class="headerlink" title="基础核心命令"></a>基础核心命令</h2><ul><li>初始化blog<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 init myblog</span><br></pre></td></tr></table></figure>这会创建一个名为 myblog 的目录，目录下包含博客的所有文件和目录。</li><li>安装依赖<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">npm install</span><br></pre></td></tr></table></figure>这会安装博客的所有依赖，包括主题、插件等。</li><li>新建一篇文章<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">hexo new <span class="string">&quot;我的第一篇文章&quot;</span></span><br><span class="line">或者简写为</span><br><span class="line">hexo n <span class="string">&quot;我的第一篇文章&quot;</span></span><br></pre></td></tr></table></figure>这会在创建的目录下，新建一个名为 “我的第一篇文章.md” 的文件，文件内容为默认的 Hexo 文章模板。</li><li>生成静态页面（public文件夹）<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">hexo generate</span><br><span class="line">或者简写为</span><br><span class="line">hexo g</span><br></pre></td></tr></table></figure>这会在 public 文件夹下生成所有静态页面，包括文章、标签、分类等。</li><li>本地预览服务器<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">hexo server</span><br><span class="line">或者简写为</span><br><span class="line">hexo s</span><br></pre></td></tr></table></figure>这会在启动一个本地服务器，你可以在浏览器中访问 <a href="http://localhost:4000/">http://localhost:4000</a> 查看博客。</li><li>部署到远端<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">hexo deploy</span><br><span class="line">或者简写为</span><br><span class="line">hexo d</span><br></pre></td></tr></table></figure>这会将本地生成的静态页面部署到远端服务器，包括 GitHub Pages、Netlify 等。</li></ul><h2 id="组合常用命令"><a href="#组合常用命令" class="headerlink" title="组合常用命令"></a>组合常用命令</h2><ul><li>生成并本地预览<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 &amp;&amp; hexo server</span><br></pre></td></tr></table></figure>这会先生成静态页面，然后启动本地服务器，你可以在浏览器中访问 <a href="http://localhost:4000/">http://localhost:4000</a> 查看博客。</li><li>生成并部署到远端<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 &amp;&amp; hexo deploy</span><br></pre></td></tr></table></figure>这会先生成静态页面，然后部署到远端服务器，包括 GitHub Pages、Netlify 等。</li><li>清理缓存 + 生成静态页面 + 部署到远端<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 clean &amp;&amp; hexo generate &amp;&amp; hexo deploy</span><br></pre></td></tr></table></figure>这会先清理缓存，然后生成静态页面，最后部署到远端服务器。</li></ul><h2 id="辅助命令"><a href="#辅助命令" class="headerlink" title="辅助命令"></a>辅助命令</h2><ul><li>清理缓存<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">hexo clean</span><br><span class="line">或者简写为</span><br><span class="line">hexo c</span><br></pre></td></tr></table></figure>这会清理 Hexo 缓存，包括临时文件、缓存等。</li><li>草稿文章<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 draft <span class="string">&quot;我的草稿文章&quot;</span></span><br></pre></td></tr></table></figure>这会在草稿目录下，新建一个名为 “我的草稿文章.md” 的文件，文件内容为默认的 Hexo 草稿文章模板。<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 publish <span class="string">&quot;我的草稿文章&quot;</span></span><br></pre></td></tr></table></figure>这会将草稿文章发布到文章目录下，文件名与草稿文章相同。</li><li>查看版本<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 -v</span><br></pre></td></tr></table></figure>这会显示 Hexo 的版本号，包括 Node.js、npm、Hexo 等。</li><li>强制刷新，预览时监听文件改动<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 --watch</span><br></pre></td></tr></table></figure>这会在启动本地服务器时，监听文件改动，当文件改动时，会自动刷新浏览器。</li></ul><h2 id="常见踩坑提示"><a href="#常见踩坑提示" class="headerlink" title="常见踩坑提示"></a>常见踩坑提示</h2><ul><li>hexo d 部署失败：检查 _config.yml 的 deploy 配置，确认安装部署插件<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">npm install hexo-deployer-git --save</span><br></pre></td></tr></table></figure></li><li>页面不更新，执行<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 clean</span><br></pre></td></tr></table></figure>这会清理 Hexo 缓存，包括临时文件、缓存等。</li><li>本地预览失败，执行<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 s -p 端口号</span><br></pre></td></tr></table></figure>这会在启动本地服务器时，指定端口号，默认端口号为 4000。</li></ul>]]>
    </content>
    <id>https://youlixsecco.online/2026/08/23/hexo%E5%B8%B8%E7%94%A8%E6%8C%87%E4%BB%A4/</id>
    <link href="https://youlixsecco.online/2026/08/23/hexo%E5%B8%B8%E7%94%A8%E6%8C%87%E4%BB%A4/"/>
    <published>2026-08-23T14:56:57.000Z</published>
    <summary>
      <![CDATA[<h2 id="基础核心命令"><a href="#基础核心命令" class="headerlink" title="基础核心命令"></a>基础核心命令</h2><ul>
<li>初始化blog<figure class="highlight bash"><table><tr]]>
    </summary>
    <title>hexo常用指令</title>
    <updated>2026-08-23T15:26:37.000Z</updated>
  </entry>
  <entry>
    <author>
      <name>secco</name>
    </author>
    <category term="技术文档" scheme="https://youlixsecco.online/categories/%E6%8A%80%E6%9C%AF%E6%96%87%E6%A1%A3/"/>
    <category term="Hexo" scheme="https://youlixsecco.online/tags/Hexo/"/>
    <category term="博客搭建" scheme="https://youlixsecco.online/tags/%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/"/>
    <category term="Butterfly" scheme="https://youlixsecco.online/tags/Butterfly/"/>
    <category term="GitHubPages" scheme="https://youlixsecco.online/tags/GitHubPages/"/>
    <content>
      <![CDATA[<h1 id="一、安装-Node-js-和-Git"><a href="#一、安装-Node-js-和-Git" class="headerlink" title="一、安装 Node.js 和 Git"></a>一、安装 Node.js 和 Git</h1><ol><li>安装 Node.js</li></ol><ul><li>更新软件源列表<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">sudo</span> apt update</span><br></pre></td></tr></table></figure></li><li>安装 Node.js 和 npm<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">sudo</span> apt install nodejs npm -y</span><br></pre></td></tr></table></figure></li><li>安装验证<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">node -v</span><br><span class="line">npm -v</span><br></pre></td></tr></table></figure></li></ul><ol start="2"><li>安装 Git</li></ol><ul><li>安装 Git<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">sudo</span> apt install git -y</span><br></pre></td></tr></table></figure></li><li>安装验证<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 --version</span><br></pre></td></tr></table></figure></li></ul><h1 id="二、安装-Hexo"><a href="#二、安装-Hexo" class="headerlink" title="二、安装 Hexo"></a>二、安装 Hexo</h1><ol><li>安装 Hexo</li></ol><ul><li>安装 Hexo<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">sudo</span> npm install -g hexo-cli</span><br></pre></td></tr></table></figure></li><li>安装验证<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 -v</span><br></pre></td></tr></table></figure></li></ul><h1 id="三、博客项目创建"><a href="#三、博客项目创建" class="headerlink" title="三、博客项目创建"></a>三、博客项目创建</h1><ol><li>创建博客项目, 并进入项目目录,这里以 blog 为例<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">mkdir</span> blog</span><br><span class="line"><span class="built_in">cd</span> blog</span><br></pre></td></tr></table></figure></li><li>初始化 Hexo 项目<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 init .</span><br><span class="line">npm install</span><br></pre></td></tr></table></figure></li><li>项目验证<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><br><span class="line">hexo server</span><br></pre></td></tr></table></figure></li><li>访问 <a href="http://localhost:4000/">http://localhost:4000</a> 即可查看初步搭建好的博客</li></ol><h1 id="四、博客项目配置"><a href="#四、博客项目配置" class="headerlink" title="四、博客项目配置"></a>四、博客项目配置</h1><ol><li>进入配置文件<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">vim _config.yml</span><br></pre></td></tr></table></figure></li><li>站点基本信息设置<figure class="highlight yaml"><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 class="attr">title:</span> <span class="string">我的技术博客</span>          <span class="comment"># 博客标题</span></span><br><span class="line"><span class="attr">subtitle:</span> <span class="string">记录学习与成长</span>      <span class="comment"># 副标题（部分主题显示）</span></span><br><span class="line"><span class="attr">description:</span> <span class="string">一个</span> <span class="string">Hexo</span> <span class="string">博客</span>  <span class="comment"># 博客描述（用于 SEO）</span></span><br><span class="line"><span class="attr">keywords:</span> <span class="string">Hexo,</span> <span class="string">博客,</span> <span class="string">技术</span>   <span class="comment"># 关键词（用于 SEO）</span></span><br><span class="line"><span class="attr">author:</span> <span class="string">你的名字</span>             <span class="comment"># 作者名，会显示在页脚等位置</span></span><br><span class="line"><span class="attr">language:</span> <span class="string">zh-CN</span>             <span class="comment"># 语言，中文填 zh-CN</span></span><br><span class="line"><span class="attr">timezone:</span> <span class="string">Asia/Shanghai</span>     <span class="comment"># 时区,为空时默认使用系统时区</span></span><br></pre></td></tr></table></figure></li><li>主题设置, 这里以 Butterfly 为例</li></ol><ul><li>安装 Butterfly 主题<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 <span class="built_in">clone</span> -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly</span><br><span class="line">npm install hexo-renderer-pug hexo-renderer-stylus --save</span><br></pre></td></tr></table></figure></li><li>配置主题<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">theme:</span> <span class="string">butterfly</span></span><br></pre></td></tr></table></figure></li></ul><ol start="4"><li>关闭 _config.yml 文件, 并保存</li><li>建立独立主题配置文件, 之后可在 _config.butterfly.yml 中配置主题相关参数<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">cp</span> themes/butterfly/_config.yml _config.butterfly.yml</span><br></pre></td></tr></table></figure></li><li>本地预览 Butterfly 主题博客<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">hexo clean</span><br><span class="line">hexo generate</span><br><span class="line">hexo server</span><br></pre></td></tr></table></figure></li><li>访问 <a href="http://localhost:4000/">http://localhost:4000</a> 即可查看 Butterfly 主题博客</li></ol><h1 id="五、博客部署到-GitHubPages"><a href="#五、博客部署到-GitHubPages" class="headerlink" title="五、博客部署到 GitHubPages"></a>五、博客部署到 GitHubPages</h1><ol><li>创建 GitHub 仓库</li></ol><ul><li>登录 GitHub 并创建一个新的仓库, 仓库名称为 你的用户名.github.io</li><li>仓库设置为公开</li></ul><ol start="2"><li>配置 _config.yml 文件, 此处路径为 blog&#x2F;_config.yml</li></ol><ul><li>设置网址<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">url:</span> <span class="string">https://你的用户名.github.io/你的用户名.github.io</span></span><br></pre></td></tr></table></figure></li><li>部署设置<figure class="highlight yaml"><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 class="attr">deploy:</span></span><br><span class="line">  <span class="attr">type:</span> <span class="string">git</span></span><br><span class="line">  <span class="attr">repo:</span> <span class="string">git@github.com:你的用户名/你的用户名.github.io.git</span></span><br><span class="line">  <span class="attr">branch:</span> <span class="string">main</span></span><br></pre></td></tr></table></figure></li></ul><ol start="3"><li>配置 SSH 密钥</li></ol><ul><li>生成 SSH 密钥<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">ssh-keygen -t ed25519 -C <span class="string">&quot;你的邮箱&quot;</span></span><br></pre></td></tr></table></figure>后续直接回车即可</li><li>查询并复制公钥<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">cat</span> ~/.ssh/id_ed25519.pub</span><br></pre></td></tr></table></figure></li><li>登录 GitHub 并添加公钥到 SSH 密钥对</li><li>点击设置 -&gt; SSH 密钥对</li><li>点击添加密钥对</li><li>输入密钥对名称, 例如 blog</li><li>粘贴公钥内容</li><li>点击添加密钥对</li><li>测试 SSH 连接<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">ssh -T git@github.com</span><br></pre></td></tr></table></figure>如果返回 “Hello, 你的用户名! You’ve successfully authenticated, but GitHub does not provide shell access.” 则表示配置成功</li></ul><ol start="4"><li>安装 Hexo 插件<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-deployer-git --save-dev</span><br></pre></td></tr></table></figure></li><li>部署博客<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">hexo clean</span><br><span class="line">hexo generate</span><br><span class="line">hexo deploy</span><br></pre></td></tr></table></figure>等待 5-10 分钟即可在 <a href="https://你的用户名.github.io/%E4%BD%A0%E7%9A%84%E7%94%A8%E6%88%B7%E5%90%8D.github.io">https:&#x2F;&#x2F;你的用户名.github.io&#x2F;你的用户名.github.io</a> 查看部署好的博客</li></ol>]]>
    </content>
    <id>https://youlixsecco.online/2026/08/23/%E4%B8%AA%E4%BA%BAblog%E9%83%A8%E7%BD%B2%E6%8C%87%E5%8D%97/</id>
    <link href="https://youlixsecco.online/2026/08/23/%E4%B8%AA%E4%BA%BAblog%E9%83%A8%E7%BD%B2%E6%8C%87%E5%8D%97/"/>
    <published>2026-08-23T14:25:28.000Z</published>
    <summary>
      <![CDATA[<h1 id="一、安装-Node-js-和-Git"><a href="#一、安装-Node-js-和-Git" class="headerlink" title="一、安装 Node.js 和 Git"></a>一、安装 Node.js 和 Git</h1><ol>
<li>]]>
    </summary>
    <title>个人blog部署指南</title>
    <updated>2026-08-23T14:46:47.127Z</updated>
  </entry>
</feed>
