<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blog式日记小站</title><link>http://localhost:1313/</link><description>Recent content from Blog式日记小站</description><generator>Hugo</generator><language>en</language><managingEditor>bi499096@hotmail.com (溟里)</managingEditor><webMaster>bi499096@hotmail.com (溟里)</webMaster><copyright>All articles on this blog are licensed under the BY-NC-SA license agreement unless otherwise stated. Please indicate the source when reprinting!</copyright><lastBuildDate>Sat, 05 Sep 2026 13:43:05 +0800</lastBuildDate><atom:link href="http://localhost:1313/index.xml" rel="self" type="application/rss+xml"/><item><title>Nginx响应头优化问题记录</title><link>http://localhost:1313/posts/nginx%E5%93%8D%E5%BA%94%E5%A4%B4%E4%BC%98%E5%8C%96%E9%97%AE%E9%A2%98%E8%AE%B0%E5%BD%95/</link><pubDate>Sat, 05 Sep 2026 13:43:05 +0800</pubDate><author>bi499096@hotmail.com (溟里)</author><guid>http://localhost:1313/posts/nginx%E5%93%8D%E5%BA%94%E5%A4%B4%E4%BC%98%E5%8C%96%E9%97%AE%E9%A2%98%E8%AE%B0%E5%BD%95/</guid><description>
<![CDATA[<h1>Nginx响应头优化问题记录</h1><p>Author: 溟里(bi499096@hotmail.com)</p>
        
          <h2 id="一原始问题">
<a class="header-anchor" href="#%e4%b8%80%e5%8e%9f%e5%a7%8b%e9%97%ae%e9%a2%98"></a>
一、原始问题
</h2><p>查看FeHelper在 Nginx 配置中发现三个关键头部缺失：</p>
<p>❌ Cache-Control —— 浏览器端无缓存策略</p>
<p>❌ X-Content-Type-Options —— 存在 MIME 嗅探 XSS 风险</p>
<p>❌ X-Frame-Options —— 可能被嵌入 iframe 遭受点击劫持</p>
<h2 id="二已完成的优化-成功">
<a class="header-anchor" href="#%e4%ba%8c%e5%b7%b2%e5%ae%8c%e6%88%90%e7%9a%84%e4%bc%98%e5%8c%96-%e6%88%90%e5%8a%9f"></a>
二、已完成的优化（✅ 成功）
</h2><h3 id="nginx-配置添加">
<a class="header-anchor" href="#nginx-%e9%85%8d%e7%bd%ae%e6%b7%bb%e5%8a%a0"></a>
Nginx 配置添加
</h3><ul>
<li>静态资源（css/js/图片等）缓存 30 天，添加 <code>Cache-Control: public, no-transform</code></li>
<li>HTML 页面添加 <code>Cache-Control: no-cache, must-revalidate</code></li>
<li>安全头部已在 Nginx 中配置</li>
</ul>
<h3 id="配置验证">
<a class="header-anchor" href="#%e9%85%8d%e7%bd%ae%e9%aa%8c%e8%af%81"></a>
配置验证
</h3><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>curl -I http://localhost/
</span></span></code></pre></div><p>确认 Nginx 本地响应完全正常，缓存策略已生效 ✅</p>
<h2 id="三当前状态-部分受限">
<a class="header-anchor" href="#%e4%b8%89%e5%bd%93%e5%89%8d%e7%8a%b6%e6%80%81-%e9%83%a8%e5%88%86%e5%8f%97%e9%99%90"></a>
三、当前状态（⚠️ 部分受限）
</h2><table>
	<thead>
			<tr>
					<th>配置项</th>
					<th>Nginx 本地</th>
					<th>公网访问 (Cloudflare Tunnel)</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>Cache-Control</td>
					<td>✅ 生效</td>
					<td>✅ 生效</td>
			</tr>
			<tr>
					<td>X-Content-Type-Options</td>
					<td>✅ 生效</td>
					<td>❌ 被过滤</td>
			</tr>
			<tr>
					<td>X-Frame-Options</td>
					<td>✅ 生效</td>
					<td>❌ 被过滤</td>
			</tr>
			<tr>
					<td>X-XSS-Protection</td>
					<td>✅ 生效</td>
					<td>❌ 被过滤</td>
			</tr>
	</tbody>
</table>
<blockquote>
<p>通过 cloudflared 免费 Tunnel 访问时，Cloudflare 会剥离自定义响应头。这是免费域名的限制。</p>
</blockquote>
        
        <hr><p>Published on 2026-09-05 at <a href='http://localhost:1313/'>Blog式日记小站</a>, last modified on 2026-09-05</p>]]></description><category>cloudflare</category><category>工具运用</category><category>Nginx</category></item><item><title>Nginx替换hugo服务进行公网开放踩坑全记录</title><link>http://localhost:1313/posts/nginx%E6%9B%BF%E6%8D%A2hugo%E6%9C%8D%E5%8A%A1%E8%BF%9B%E8%A1%8C%E5%85%AC%E7%BD%91%E5%BC%80%E6%94%BE%E8%B8%A9%E5%9D%91%E5%85%A8%E8%AE%B0%E5%BD%95/</link><pubDate>Mon, 31 Aug 2026 01:18:29 +0800</pubDate><author>bi499096@hotmail.com (溟里)</author><guid>http://localhost:1313/posts/nginx%E6%9B%BF%E6%8D%A2hugo%E6%9C%8D%E5%8A%A1%E8%BF%9B%E8%A1%8C%E5%85%AC%E7%BD%91%E5%BC%80%E6%94%BE%E8%B8%A9%E5%9D%91%E5%85%A8%E8%AE%B0%E5%BD%95/</guid><description>
<![CDATA[<h1>Nginx替换hugo服务进行公网开放踩坑全记录</h1><p>Author: 溟里(bi499096@hotmail.com)</p>
        
          <h1 id="nginx替换hugo服务进行公网开放踩坑全记录">
<a class="header-anchor" href="#nginx%e6%9b%bf%e6%8d%a2hugo%e6%9c%8d%e5%8a%a1%e8%bf%9b%e8%a1%8c%e5%85%ac%e7%bd%91%e5%bc%80%e6%94%be%e8%b8%a9%e5%9d%91%e5%85%a8%e8%ae%b0%e5%bd%95"></a>
Nginx替换hugo服务进行公网开放踩坑全记录
</h1><p>这不是一篇普通教程，而是一个“踩坑专家”用血泪换来的终极避坑手册。</p>
<p>涵盖：端口占用、权限地狱、开发/生产模式混淆、DNS 隧道、配置覆盖、CDN 403、路径盲区、情绪管理……</p>
<p>适合 Ubuntu 云服务器 + Cloudflare Tunnel + VS Code Remote 组合。</p>
<h2 id="一最终架构先看明白再动手">
<a class="header-anchor" href="#%e4%b8%80%e6%9c%80%e7%bb%88%e6%9e%b6%e6%9e%84%e5%85%88%e7%9c%8b%e6%98%8e%e7%99%bd%e5%86%8d%e5%8a%a8%e6%89%8b"></a>
一、最终架构（先看明白再动手）
</h2><p>本地电脑（物理机）</p>
<p>- VS Code 远程连接云服务器</p>
<p>- 端口转发：云服务器 1313 → 本地 12287</p>
<p>- 浏览器访问：http://localhost:12287（本地预览）</p>
<p>通过 SSH 隧道连接至云服务器（Ubuntu）</p>
<p>云服务器部署服务：</p>
<p>1. Hugo Server（端口1313，内存模式、包含草稿）
启动命令：hugo server -D --renderToMemory</p>
<p>2. Nginx（端口80，托管public静态文件、无草稿）
站点目录：/home/ubuntu/digital-garden/public/</p>
<p>3. Cloudflared Tunnel（内网穿透，映射 localhost:80）
公网访问地址：https://xxxxx.trycloudflare.com</p>
<p>公网用户访问链路：公网 → Cloudflared 隧道 → Nginx → 静态资源目录 public/</p>
<p><strong>双入口完全独立，分工明确</strong></p>
<table>
	<thead>
			<tr>
					<th>访问方式</th>
					<th>数据源</th>
					<th>含草稿</th>
					<th>用途</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>http://localhost:12287</td>
					<td>Hugo Server 内存</td>
					<td>✅ 是</td>
					<td>写稿/实时预览</td>
			</tr>
			<tr>
					<td>https://xxxxx.trycloudflare.com</td>
					<td>Nginx 托管 public/</td>
					<td>❌ 否</td>
					<td>公网正式访问</td>
			</tr>
	</tbody>
</table>
<h2 id="二踩坑总览按操作阶段排序">
<a class="header-anchor" href="#%e4%ba%8c%e8%b8%a9%e5%9d%91%e6%80%bb%e8%a7%88%e6%8c%89%e6%93%8d%e4%bd%9c%e9%98%b6%e6%ae%b5%e6%8e%92%e5%ba%8f"></a>
二、踩坑总览（按操作阶段排序）
</h2><table>
	<thead>
			<tr>
					<th>阶段</th>
					<th>坑点</th>
					<th>典型报错/问题</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>服务启动</td>
					<td>端口被旧进程占用</td>
					<td>bind: address already in use</td>
			</tr>
			<tr>
					<td>服务启动</td>
					<td>只看浏览器不看终端，盲目排错</td>
					<td>WebSocket failed 全屏报错</td>
			</tr>
			<tr>
					<td>服务启动</td>
					<td>端口自动偏移，找不到运行端口</td>
					<td>端口随机变为1314/1315</td>
			</tr>
			<tr>
					<td>权限与网络</td>
					<td>Nginx 无静态文件读取权限</td>
					<td>403 Forbidden / Permission denied</td>
			</tr>
			<tr>
					<td>权限与网络</td>
					<td>直接暴露服务器80公网端口</td>
					<td>服务器端口被扫描、存在安全风险</td>
			</tr>
			<tr>
					<td>权限与网络</td>
					<td>DuckDNS 无法绑定 Cloudflare</td>
					<td>隧道健康但域名访问超时</td>
			</tr>
			<tr>
					<td>权限与网络</td>
					<td>Cloudflare 临时隧道地址重启变动</td>
					<td>历史公网链接失效</td>
			</tr>
			<tr>
					<td>Hugo 配置</td>
					<td>主题配置修改不生效</td>
					<td>网站样式、参数无任何变化</td>
			</tr>
			<tr>
					<td>Hugo 配置</td>
					<td>多配置文件混杂，配置被覆盖</td>
					<td>参数丢失、配置错乱</td>
			</tr>
			<tr>
					<td>Hugo 配置</td>
					<td>相对路径配置失效</td>
					<td>链接自动跳转 localhost:1313</td>
			</tr>
			<tr>
					<td>Hugo 配置</td>
					<td>公网泄露草稿文章</td>
					<td>未完成内容对外展示</td>
			</tr>
			<tr>
					<td>Hugo 配置</td>
					<td>CDN 资源加载失败</td>
					<td>静态资源403/404，页面裸奔</td>
			</tr>
			<tr>
					<td>Hugo 配置</td>
					<td>首页空白、文章不展示</td>
					<td>mainSections 目录不匹配</td>
			</tr>
			<tr>
					<td>Hugo 配置</td>
					<td>图片/静态资源404</td>
					<td>路径错误、大小写不匹配</td>
			</tr>
			<tr>
					<td>性能优化</td>
					<td>公网直接使用hugo server服务</td>
					<td>页面加载2s+、CPU占用极高</td>
			</tr>
			<tr>
					<td>性能优化</td>
					<td>生产环境未压缩代码</td>
					<td>文件体积大、访问速度慢</td>
			</tr>
	</tbody>
</table>
<h2 id="三逐个击破--详细解决方案">
<a class="header-anchor" href="#%e4%b8%89%e9%80%90%e4%b8%aa%e5%87%bb%e7%a0%b4--%e8%af%a6%e7%bb%86%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88"></a>
三、逐个击破 · 详细解决方案
</h2><h3 id="-坑1端口占用--服务异常断开">
<a class="header-anchor" href="#-%e5%9d%911%e7%ab%af%e5%8f%a3%e5%8d%a0%e7%94%a8--%e6%9c%8d%e5%8a%a1%e5%bc%82%e5%b8%b8%e6%96%ad%e5%bc%80"></a>
🔥 坑1：端口占用 / 服务异常断开
</h3><p><strong>现象</strong>：hugo server 启动报错 <code>bind: address already in use</code>，浏览器控制台大量 WebSocket 连接失败报错。</p>
        
        <hr><p>Published on 2026-08-31 at <a href='http://localhost:1313/'>Blog式日记小站</a>, last modified on 2026-08-31</p>]]></description></item><item><title>关于MarkDown本身语法</title><link>http://localhost:1313/posts/%E5%85%B3%E4%BA%8Emarkdown%E6%9C%AC%E8%BA%AB%E8%AF%AD%E6%B3%95/</link><pubDate>Thu, 16 Jul 2026 02:15:19 +0800</pubDate><author>bi499096@hotmail.com (溟里)</author><guid>http://localhost:1313/posts/%E5%85%B3%E4%BA%8Emarkdown%E6%9C%AC%E8%BA%AB%E8%AF%AD%E6%B3%95/</guid><description>
<![CDATA[<h1>关于MarkDown本身语法</h1><p>Author: 溟里(bi499096@hotmail.com)</p>
        
          <h1 id="技术随笔markdown语法从零入门教程">
<a class="header-anchor" href="#%e6%8a%80%e6%9c%af%e9%9a%8f%e7%ac%94markdown%e8%af%ad%e6%b3%95%e4%bb%8e%e9%9b%b6%e5%85%a5%e9%97%a8%e6%95%99%e7%a8%8b"></a>
【技术随笔】Markdown语法从零入门教程
</h1><blockquote>
<p>发布时间：2026-07-16 | 分类：工具教程 | 阅读时长：8分钟</p>
</blockquote>
<h2 id="一前言">
<a class="header-anchor" href="#%e4%b8%80%e5%89%8d%e8%a8%80"></a>
一、前言
</h2><p>日常写博客、文档、笔记都离不开Markdown，相比Word更加轻量化，纯文本即可渲染精美排版。</p>
<h2 id="二核心语法速查表">
<a class="header-anchor" href="#%e4%ba%8c%e6%a0%b8%e5%bf%83%e8%af%ad%e6%b3%95%e9%80%9f%e6%9f%a5%e8%a1%a8"></a>
二、核心语法速查表
</h2><h3 id="21-文字样式">
<a class="header-anchor" href="#21-%e6%96%87%e5%ad%97%e6%a0%b7%e5%bc%8f"></a>
2.1 文字样式
</h3><p><em>斜体</em> <strong>粗体</strong> <em><strong>粗斜</strong></em> <del>删除线</del> ==高亮==</p>
<h3 id="22-待办清单">
<a class="header-anchor" href="#22-%e5%be%85%e5%8a%9e%e6%b8%85%e5%8d%95"></a>
2.2 待办清单
</h3><ul>
<li><input checked="" disabled="" type="checkbox"> 掌握标题、引用、列表</li>
<li><input checked="" disabled="" type="checkbox"> 学会代码块与表格</li>
<li><input disabled="" type="checkbox"> 练习搭建个人博客MD模板</li>
</ul>
<h3 id="23-代码示例">
<a class="header-anchor" href="#23-%e4%bb%a3%e7%a0%81%e7%a4%ba%e4%be%8b"></a>
2.3 代码示例
</h3><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#75715e">// 前端示例代码
</span></span></span><span style="display:flex;"><span><span style="color:#66d9ef">function</span> <span style="color:#a6e22e">renderMd</span>() {
</span></span><span style="display:flex;"><span>  <span style="color:#a6e22e">console</span>.<span style="color:#a6e22e">log</span>(<span style="color:#e6db74">&#34;渲染Markdown文档&#34;</span>)
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><h3 id="24-数据表格">
<a class="header-anchor" href="#24-%e6%95%b0%e6%8d%ae%e8%a1%a8%e6%a0%bc"></a>
2.4 数据表格
</h3><table>
	<thead>
			<tr>
					<th style="text-align: left">语法</th>
					<th style="text-align: center">符号</th>
					<th style="text-align: right">用途</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td style="text-align: left">标题</td>
					<td style="text-align: center">#</td>
					<td style="text-align: right">分层章节</td>
			</tr>
			<tr>
					<td style="text-align: left">引用</td>
					<td style="text-align: center">&gt;</td>
					<td style="text-align: right">摘抄备注</td>
			</tr>
			<tr>
					<td style="text-align: left">代码</td>
					<td style="text-align: center">```</td>
					<td style="text-align: right">展示程序</td>
			</tr>
	</tbody>
</table>
<p><mark>竖线|分割，然后冒号＋减号，左对齐是冒号加减号,右对齐是减号加冒号,居中两冒号夹减号。<mark></p>
<h3 id="25-高亮与块状提示框">
<a class="header-anchor" href="#25-%e9%ab%98%e4%ba%ae%e4%b8%8e%e5%9d%97%e7%8a%b6%e6%8f%90%e7%a4%ba%e6%a1%86"></a>
2.5 高亮与块状提示框
</h3><p>行内高亮：使用<mark>成对尖括号内mark<mark></p>

  <blockquote class="alert-blockquote note">
    <p class="alert-heading">
      Note
    </p>
    <p><p>蓝色｜普通补充说明、背景知识!NOTE&gt; [!NOTE]</p></p>
  </blockquote>


  <blockquote class="alert-blockquote tip">
    <p class="alert-heading">
      Tip
    </p>
    <p><p>绿色｜实用小技巧、优化方案!TIP&gt; [!TIP]</p></p>
  </blockquote>
        
        <hr><p>Published on 2026-07-16 at <a href='http://localhost:1313/'>Blog式日记小站</a>, last modified on 2026-07-16</p>]]></description></item><item><title>Canvas 2D 星际战斗机演示</title><link>http://localhost:1313/posts/fighter-demo/</link><pubDate>Wed, 15 Jul 2026 22:00:00 +0800</pubDate><author>bi499096@hotmail.com (溟里)</author><guid>http://localhost:1313/posts/fighter-demo/</guid><description>
<![CDATA[<h1>Canvas 2D 星际战斗机演示</h1><p>Author: 溟里(bi499096@hotmail.com)</p>
        
          <h1 id="canvas-深空飞船加力飞行动画">
<a class="header-anchor" href="#canvas-%e6%b7%b1%e7%a9%ba%e9%a3%9e%e8%88%b9%e5%8a%a0%e5%8a%9b%e9%a3%9e%e8%a1%8c%e5%8a%a8%e7%94%bb"></a>
Canvas 深空飞船加力飞行动画
</h1><p>原生Canvas粒子动画，含尾焰、马赫环、镜头震动、星空视差。</p>
<div style="margin: 10px 0;">
<button onclick="load('/html/demo1.html')">版本一 Aemeath</button>
<button onclick="load('/html/demo2.html')" style="margin-left:10px;">版本二 Daniya</button>
</div>
<div id="box" style="width:100%;height:800px;"></div>
<h2 id="使用的prompt">
<a class="header-anchor" href="#%e4%bd%bf%e7%94%a8%e7%9a%84prompt"></a>
使用的prompt
</h2>
  <blockquote class="alert-blockquote note">
    <p class="alert-heading">
      Note
    </p>
    <p><details>
<summary>✈️ 点击展开完整战机动画开发需求</summary>
创建一个 HTML 文件，用来呈现一架高速、充满攻击性的战斗机在全力加速状态下的飞行动画。画面背景为纯黑深空，镜头始终锁定在战机中心位置。请使用 CSS 和 JavaScript（优先使用 Canvas 或WebGL）来实现整体动画效果。
<h2 id="重点表现以下视觉细节">
<a class="header-anchor" href="#%e9%87%8d%e7%82%b9%e8%a1%a8%e7%8e%b0%e4%bb%a5%e4%b8%8b%e8%a7%86%e8%a7%89%e7%bb%86%e8%8a%82"></a>
重点表现以下视觉细节：
</h2><ul>
<li><mark>极其写实的运动模糊效果</mark></li>
<li><mark>亮度强烈的加力燃烧尾焰（afterburner）发光效果</mark></li>
<li>发动机周围的热浪扭曲（heat distortion)</li>
<li>轻微但可见的尾迹（contrails)</li>
<li>电影级光影与环境照明</li>
<li>机身金属表面的高光反射与镜面质感</li>
</ul>
<h2 id="附加交互镜头效果">
<a class="header-anchor" href="#%e9%99%84%e5%8a%a0%e4%ba%a4%e4%ba%92%e9%95%9c%e5%a4%b4%e6%95%88%e6%9e%9c"></a>
附加交互/镜头效果：
</h2><ul>
<li>细微的镜头抖动，增强速度与冲击力</li>
<li>一定的景深层次，让画面更具空间感与压迫感</li>
</ul>
<h2 id="开发约束条件">
<a class="header-anchor" href="#%e5%bc%80%e5%8f%91%e7%ba%a6%e6%9d%9f%e6%9d%a1%e4%bb%b6"></a>
开发约束条件
</h2><ul>
<li>要求不依赖任何外部库或资源文件，不使用第三方依赖。</li>
<li>性能优化不必优先考虑，可以尽可能追求视觉表现力。</li>
<li><mark>战机必须始终向左侧（西方）高速飞行。</mark></li>
</ul>
</details></p>
  </blockquote>

<h2 id="此外">
<a class="header-anchor" href="#%e6%ad%a4%e5%a4%96"></a>
此外
</h2><p>后续更改了宇宙飞船的形态、配色，加入了<strong>爱弥斯和达尼娅</strong></p>
<script>
function load(url){
  const iframe = document.createElement('iframe');
  iframe.src = url;
  iframe.sandbox = "allow-same-origin allow-scripts";
  iframe.style.width = "100%";
  iframe.style.height = "100%";
  iframe.style.border = "0";
  box.innerHTML = "";
  box.appendChild(iframe);
}
// 默认打开版本一
load('/html/demo1.html') 
</script>
<h2 id="允许的操作">
<a class="header-anchor" href="#%e5%85%81%e8%ae%b8%e7%9a%84%e6%93%8d%e4%bd%9c"></a>
允许的操作
</h2><p>您可以通过键盘的数字键 1（降低）和 2（增强）来实时调整镜头抖动的强度，按 0 键恢复默认</p>
        
        <hr><p>Published on 2026-07-15 at <a href='http://localhost:1313/'>Blog式日记小站</a>, last modified on 2026-07-15</p>]]></description></item><item><title>实现本地博客远程repo到github进行备份</title><link>http://localhost:1313/posts/%E5%AE%9E%E7%8E%B0%E6%9C%AC%E5%9C%B0%E5%8D%9A%E5%AE%A2%E8%BF%9C%E7%A8%8Brepo%E5%88%B0github%E8%BF%9B%E8%A1%8C%E5%A4%87%E4%BB%BD/</link><pubDate>Fri, 10 Jul 2026 00:32:03 +0800</pubDate><author>bi499096@hotmail.com (溟里)</author><guid>http://localhost:1313/posts/%E5%AE%9E%E7%8E%B0%E6%9C%AC%E5%9C%B0%E5%8D%9A%E5%AE%A2%E8%BF%9C%E7%A8%8Brepo%E5%88%B0github%E8%BF%9B%E8%A1%8C%E5%A4%87%E4%BB%BD/</guid><description>
<![CDATA[<h1>实现本地博客远程repo到github进行备份</h1><p>Author: 溟里(bi499096@hotmail.com)</p>
        
          <h2 id="-你的三条日常备份命令">
<a class="header-anchor" href="#-%e4%bd%a0%e7%9a%84%e4%b8%89%e6%9d%a1%e6%97%a5%e5%b8%b8%e5%a4%87%e4%bb%bd%e5%91%bd%e4%bb%a4"></a>
✅ 你的三条日常备份命令
</h2><p>在 VS Code 终端（Ubuntu）执行：
bash</p>
<p>git add .
git commit -m &ldquo;你的修改说明&rdquo;
git push</p>
<h2 id="-一次配置永久免密">
<a class="header-anchor" href="#-%e4%b8%80%e6%ac%a1%e9%85%8d%e7%bd%ae%e6%b0%b8%e4%b9%85%e5%85%8d%e5%af%86"></a>
🔑 一次配置，永久免密
</h2><p>如果每次 git push 都要输入用户名和 Token，会很烦。在 Ubuntu 终端执行一次：
bash</p>
<p>git config &ndash;global credential.helper store</p>
<p>然后随便执行一次 git push，输入用户名（rtxpe049）和密码（粘贴你的 Token）。从此以后，git push 再也不会问你要密码了。</p>
<h2 id="-操作前的黄金习惯">
<a class="header-anchor" href="#-%e6%93%8d%e4%bd%9c%e5%89%8d%e7%9a%84%e9%bb%84%e9%87%91%e4%b9%a0%e6%83%af"></a>
🧠 操作前的黄金习惯
</h2><p>备份前，先看一眼修改了哪些文件：
bash</p>
<p>git status</p>
<pre><code>红色 = 已修改但未暂存

绿色 = 已暂存，准备提交
</code></pre>
<p>确认无误后，再执行上面的三条命令。</p>
<h2 id="-总结">
<a class="header-anchor" href="#-%e6%80%bb%e7%bb%93"></a>
📝 总结
</h2><p>以后每次写完博客：</p>
<pre><code>看一眼：git status（确认改了什么）

打包：git add .

起名：git commit -m &quot;写个描述&quot;

发货：git push
</code></pre>
<p>没了。就这四步，前三步可合并为 git add . &amp;&amp; git commit -m &ldquo;描述&rdquo;，但分开更稳。</p>
        
        <hr><p>Published on 2026-07-10 at <a href='http://localhost:1313/'>Blog式日记小站</a>, last modified on 2026-07-10</p>]]></description></item><item><title>博客搭建过程中的一些问题</title><link>http://localhost:1313/posts/%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA%E8%BF%87%E7%A8%8B%E4%B8%AD%E7%9A%84%E4%B8%80%E4%BA%9B%E9%97%AE%E9%A2%98/</link><pubDate>Thu, 09 Jul 2026 23:18:06 +0800</pubDate><author>bi499096@hotmail.com (溟里)</author><guid>http://localhost:1313/posts/%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA%E8%BF%87%E7%A8%8B%E4%B8%AD%E7%9A%84%E4%B8%80%E4%BA%9B%E9%97%AE%E9%A2%98/</guid><description>
<![CDATA[<h1>博客搭建过程中的一些问题</h1><p>Author: 溟里(bi499096@hotmail.com)</p>
        
          <h1 id="博客搭建完整总结ubuntu--hugo--reimu-主题">
<a class="header-anchor" href="#%e5%8d%9a%e5%ae%a2%e6%90%ad%e5%bb%ba%e5%ae%8c%e6%95%b4%e6%80%bb%e7%bb%93ubuntu--hugo--reimu-%e4%b8%bb%e9%a2%98"></a>
博客搭建完整总结（Ubuntu + Hugo + reimu 主题）
</h1><p>—— 含 Windows 远程写作工作流</p>
<h2 id="一环境与工具">
<a class="header-anchor" href="#%e4%b8%80%e7%8e%af%e5%a2%83%e4%b8%8e%e5%b7%a5%e5%85%b7"></a>
一、环境与工具
</h2><pre><code>服务器端：Ubuntu

本地客户端：Windows（写作端）

博客生成器：Hugo（v0.164.0）

主题：reimu（基座是博丽灵梦）

远程连接：VS Code + Remote-SSH

终端：Ubuntu bash / Windows PowerShell
</code></pre>
<h2 id="二从零搭建博客的完整流程ubuntu-本地操作">
<a class="header-anchor" href="#%e4%ba%8c%e4%bb%8e%e9%9b%b6%e6%90%ad%e5%bb%ba%e5%8d%9a%e5%ae%a2%e7%9a%84%e5%ae%8c%e6%95%b4%e6%b5%81%e7%a8%8bubuntu-%e6%9c%ac%e5%9c%b0%e6%93%8d%e4%bd%9c"></a>
二、从零搭建博客的完整流程（Ubuntu 本地操作）
</h2><ol>
<li>安装 Hugo（Ubuntu 终端）
bash</li>
</ol>
<p>sudo snap install hugo &ndash;channel=extended
hugo version   # 验证安装</p>
<ol start="2">
<li>创建站点
bash</li>
</ol>
<p>hugo new site digital-garden
cd digital-garden</p>
<ol start="3">
<li>初始化 Git 仓库
bash</li>
</ol>
<p>git init
git branch -m main   # 将默认 master 分支重命名为 main</p>
<ol start="4">
<li>安装主题（reimu）
bash</li>
</ol>
<p>git submodule add <a href="https://github.com/D-Sketon/hugo-theme-reimu.git">https://github.com/D-Sketon/hugo-theme-reimu.git</a> themes/reimu</p>
        
        <hr><p>Published on 2026-07-09 at <a href='http://localhost:1313/'>Blog式日记小站</a>, last modified on 2026-07-09</p>]]></description></item><item><title>我的第一篇记录</title><link>http://localhost:1313/posts/%E6%88%91%E7%9A%84%E7%AC%AC%E4%B8%80%E7%AF%87%E8%AE%B0%E5%BD%95/</link><pubDate>Thu, 09 Jul 2026 22:41:05 +0800</pubDate><author>bi499096@hotmail.com (溟里)</author><guid>http://localhost:1313/posts/%E6%88%91%E7%9A%84%E7%AC%AC%E4%B8%80%E7%AF%87%E8%AE%B0%E5%BD%95/</guid><description>
<![CDATA[<h1>我的第一篇记录</h1><p>Author: 溟里(bi499096@hotmail.com)</p>
        
          <p>今天成功搭建了个人Blog，换上了自己喜欢的主题和背景。
接下去不定期记录一些学习和生活上的思考。</p>
        
        <hr><p>Published on 2026-07-09 at <a href='http://localhost:1313/'>Blog式日记小站</a>, last modified on 2026-07-09</p>]]></description></item></channel></rss>