<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Posts on 深海黑鱼的博客 - 个人学习使用</title>
		<link>https://shhy.work/posts/</link>
		<description>Recent content in Posts on 深海黑鱼的博客 - 个人学习使用</description>
		<generator>Hugo</generator>
		<language>zh-cn</language>
		
		
		
		
			<lastBuildDate>Sun, 14 Jun 2026 00:00:00 +0000</lastBuildDate>
		
			<atom:link href="https://shhy.work/posts/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Hugo建站1</title>
				<link>https://shhy.work/posts/260614note/</link>
				<pubDate>Sun, 14 Jun 2026 00:00:00 +0000</pubDate>
				<guid>https://shhy.work/posts/260614note/</guid>
				<description>&lt;h2 id=&#34;hugo建站记录1&#34;&gt;Hugo建站记录1&lt;a class=&#34;anchor&#34; href=&#34;#hugo%e5%bb%ba%e7%ab%99%e8%ae%b0%e5%bd%951&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;从今天开始,打算通过Hugo建立新的博客&lt;/li&gt;&#xA;&lt;li&gt;通过&lt;a href=&#34;https://github.com/gohugoio/hugo/releases&#34;&gt;Hugo Github发布页&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;下载了适用于Linux x64的&lt;strong&gt;extended&lt;/strong&gt;版本,如果不使用extended版本的话,之后的挺多东西会没法用&lt;/li&gt;&#xA;&lt;li&gt;解压到服务器中,编辑了环境变量&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;nano ~/.bashrc&#xA;# 添加自定义目录到 PATH&#xA;export PATH=&amp;#34;$PATH:/file/file&amp;#34;&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;&#xA;&lt;li&gt;之后,可以使用验证版本的命令来看看是否已经配置成功&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;hugo version&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;&#xA;&lt;li&gt;通过&lt;a href=&#34;https://hugo.opendocs.io/getting-started/quick-start/&#34;&gt;教程网站&lt;/a&gt; 进行后面几步&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;# 在当前目录下,创建一个新文件夹quickstart,其中存有Hugo项目所需要的文件&#xA;hugo new site quickstart&#xA;# 移动到你创建的项目文件夹&#xA;cd quickstart&#xA;# 在当前目录中初始化一个空的 Git 仓库&#xA;git init&#xA;# 将 Ananke 主题克隆到 themes 目录中，并将其作为 Git 子模块 添加到您的项目中&#xA;# 注意,此处可能需要进行Github加速&#xA;git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke&#xA;# 向站点配置文件中追加一行，意思是使用&amp;#39;ananke&amp;#39;主题&#xA;echo &amp;#34;theme = &amp;#39;ananke&amp;#39;&amp;#34; &amp;gt;&amp;gt; hugo.toml&#xA;# 启动Hugo的测试服务器&#xA;hugo server&#xA;# 按下 Ctrl + C 停止 Hugo 的开发服务器&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;&#xA;&lt;li&gt;这些操作中,遇到了问题,国内云服务器对Github的访问速度不佳,询问ai得到解决方法如下&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;# 配置git,每当运行git命令时,用前面的加速url替换掉后面原始url&#xA;git config --global url.&amp;#34;https://ghproxy.net/https://github.com/&amp;#34;.insteadOf &amp;#34;https://github.com/&amp;#34;&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;&#xA;&lt;li&gt;配置完成后,在**/hugoProject/content/posts**目录下新建Markdown文件即可创建文章,需要加上文章信息&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;---&#xA;title: &amp;#34;文章标题&amp;#34;&#xA;date: 2026-06-14&#xA;#是否是草稿.如果是草稿,在构建public的时候不会被构建进去,测试时需要在hugo server后加上-D参数才能看到草稿&#xA;#hugo server -D&#xA;draft: true&#xA;---&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;&#xA;&lt;li&gt;附上&lt;a href=&#34;https://www.runoob.com/markdown/md-tutorial.html&#34;&gt;Markdown教程网站&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;之后因为在国内备案需要把网站页脚附上备案信息,查阅&lt;a href=&#34;https://shenshu.fun/posts/beian-in-footer-with-hugo/&#34;&gt;网站&lt;/a&gt;得知:&lt;/li&gt;&#xA;&lt;li&gt;通过编辑&lt;strong&gt;hugoProjectlayouts/partials/footer.html&lt;/strong&gt;可以更改Hugo的页脚&lt;/li&gt;&#xA;&lt;li&gt;如果使用了主题,需要把主题的页脚文件拷贝到这个位置再编辑,比如在默认使用的&lt;strong&gt;ananke主题&lt;/strong&gt;中,主题的页脚文件在&lt;strong&gt;hugoProject/themes/ananke/layouts/_partials/site-footer.html&lt;/strong&gt;,拷贝过来再编辑,在合适的地方插入&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;a href=&amp;#34;https://beian.miit.gov.cn/&amp;#34; target=&amp;#34;_blank&amp;#34;&amp;gt;你的备案信息&amp;lt;/a&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;&#xA;&lt;p&gt;&lt;strong&gt;现在,Hugo可以&lt;/strong&gt;&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
