<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Blogs on Zhiyu Ni 倪志宇</title>
    <link>https://samuel-nolan.github.io/blog/</link>
    <description>Recent content in Blogs on Zhiyu Ni 倪志宇</description>
    <generator>Hugo -- 0.152.2</generator>
    <language>zh-CN</language>
    <lastBuildDate>Mon, 05 Oct 2026 18:23:31 +0800</lastBuildDate>
    <atom:link href="https://samuel-nolan.github.io/blog/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>个人网站搭建教程</title>
      <link>https://samuel-nolan.github.io/blog/%E4%B8%AA%E4%BA%BA%E7%BD%91%E7%AB%99%E6%90%AD%E5%BB%BA%E6%95%99%E7%A8%8B/</link>
      <pubDate>Mon, 05 Oct 2026 18:23:31 +0800</pubDate>
      <guid>https://samuel-nolan.github.io/blog/%E4%B8%AA%E4%BA%BA%E7%BD%91%E7%AB%99%E6%90%AD%E5%BB%BA%E6%95%99%E7%A8%8B/</guid>
      <description>&lt;h2 id=&#34;前言&#34;&gt;前言&lt;/h2&gt;
&lt;p&gt;动态网站（PHP+数据库）：&lt;strong&gt;WordPress&lt;/strong&gt;
静态网站：
&lt;strong&gt;Hugo&lt;/strong&gt;：GO语言，非常快，体积小，上手难度大
&lt;strong&gt;Hexo&lt;/strong&gt;：js友好，中文社区活跃，慢&lt;/p&gt;
&lt;h2 id=&#34;hugo&#34;&gt;Hugo&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://sspai.com/post/59904&#34;&gt;借鉴的中文博客&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;一安装hugo&#34;&gt;一、安装Hugo&lt;/h3&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/gohugoio/hugo/releases&#34;&gt;官网下载&lt;/a&gt;
&lt;strong&gt;安装extended版本，功能更多&lt;/strong&gt;
&lt;a href=&#34;https://gohugo.io/getting-started/quick-start/&#34;&gt;官方文档：Quick start&lt;/a&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;放到&lt;code&gt;e:\hugo\bin&lt;/code&gt;下&lt;/li&gt;
&lt;li&gt;在此文件夹中打开&lt;code&gt;git bash&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hugo version&lt;/code&gt;：出现版本号安装成功&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hugo new site &#39;document&#39;&lt;/code&gt;：我的项目在&lt;code&gt;e:\hugo\document&lt;/code&gt;下
![[picture/hugo_document.png]]&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cd document&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git init&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;https://themes.gohugo.io/&lt;/code&gt;：安装主题&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git submodule add https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod&lt;/code&gt;：我用的PaperMod主题。国内用https下载很慢，记得开加速。或者使用浏览器的gitzip插件，下载zip文件，解压缩到&lt;code&gt;themes\PaperMod&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;网站配置文件：建议删除&lt;code&gt;hugo.toml&lt;/code&gt;，&lt;code&gt;config.toml&lt;/code&gt;。新建&lt;code&gt;hugo.yml&lt;/code&gt;
&lt;a href=&#34;https://github.com/adityatelange/hugo-PaperMod/wiki/Installation&#34;&gt;官方配置文件&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;echo &#39;theme: &amp;quot;PaperMod&amp;quot;&#39; &amp;gt;&amp;gt; hugo.yml&lt;/code&gt;：将主题配置写入Hugo的网站配置文件&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hugo new posts/my-first-post.md&lt;/code&gt;：在&lt;code&gt;content\posts&lt;/code&gt;文件下新建一个&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hugo server -D&lt;/code&gt;：启动Hugo的本地开发服务器，实时预览你的网站，&lt;code&gt;-D&lt;/code&gt;表示显示&lt;code&gt;draft&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;二部署到github作为代码托管&#34;&gt;二、部署到GitHub作为代码托管&lt;/h3&gt;
&lt;p&gt;&lt;a href=&#34;https://gohugo.io/host-and-deploy/host-on-github-pages/&#34;&gt;官方文档：Host on GitHub Pages&lt;/a&gt;&lt;/p&gt;
&lt;h4 id=&#34;1新建仓库&#34;&gt;1.新建仓库&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;在Gihub中新建一个&lt;code&gt;repositories&lt;/code&gt;，以&lt;code&gt;用户名.github.io&lt;/code&gt;命名，这是静态网站托管仓库。&lt;strong&gt;注意仓库大小写，全部改成小写！&lt;/strong&gt; 😭&lt;/li&gt;
&lt;li&gt;修改&lt;code&gt;hugo.yml&lt;/code&gt;中的，&lt;code&gt;baseURL: &#39;https://用户名.github.io/&#39;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;在项目根目录下&lt;code&gt;e:\hugo\document&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mkdir -p .github/workflows
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;touch .github/workflows/hugo.yaml    &lt;span class=&#34;c1&#34;&gt;# GitHub Actions 工作流定义文件，脚本自动部署网站&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;2工作流配置&#34;&gt;2.工作流配置&lt;/h4&gt;
&lt;p&gt;复制&lt;a href=&#34;https://gohugo.io/host-and-deploy/host-on-github-pages/&#34;&gt;官方文档&lt;/a&gt;中的标准工作流配置
&lt;strong&gt;注意修改&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;修改时区：&lt;br&gt;
将第25行的 &lt;code&gt;TZ: Europe/Oslo&lt;/code&gt; 改为 &lt;code&gt;TZ: Asia/Shanghai&lt;/code&gt;，这样生成的文章时间戳会更符合本地时间。&lt;/li&gt;
&lt;li&gt;确认主题子模块：&lt;br&gt;
这个工作流在第29行设置了 &lt;code&gt;submodules: recursive&lt;/code&gt;，这能确保你的PaperMod主题被正确拉取。必须是使用 &lt;code&gt;git submodule add&lt;/code&gt; 方式安装的。如果是&lt;code&gt;zip&lt;/code&gt;下载，直接注释掉这一行（避免弹出报错）。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;托管仓库基本不手动操作。所有更改通过Actions自动推送。
&lt;strong&gt;坑：单仓管理就行，笨蛋AI推荐双仓管理，结果配置出错了&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
