-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.xml
More file actions
35 lines (30 loc) · 3.12 KB
/
index.xml
File metadata and controls
35 lines (30 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>rust404的个人博客</title>
<link>https://rust404.github.io/</link>
<description>Recent content on rust404的个人博客</description>
<generator>Hugo -- gohugo.io</generator>
<language>zh-Hans</language>
<copyright><a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank" rel="noopener">CC BY-NC 4.0</a></copyright>
<lastBuildDate>Thu, 14 May 2020 09:57:21 +0800</lastBuildDate>
<atom:link href="https://rust404.github.io/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>如何使用hugo搭建个人博客</title>
<link>https://rust404.github.io/posts/my-first-post/</link>
<pubDate>Thu, 14 May 2020 09:57:21 +0800</pubDate>
<guid>https://rust404.github.io/posts/my-first-post/</guid>
<description>Hugo是由Go语言实现的一款静态博客生成器,具备简单、易用、高效、易扩展、快速部署的特点,本篇文章将带你一步步搭建一个基于github pages的个人博客。
安装hugo hugo官网提供了多种的安装方式,这里仅仅提供二进制安装及Homebrew的安装方法。
二进制安装 通过hugo的github release页面下载自己平台的对应二进制文件,最好配置一下自己平台的PATH环境变量以便于全局使用
Homebrew 对于macOS用户,可以通过以下命令行完成安装
$ brew install hugo 安装完毕后,可以通过执行hugo version来验证是否安装成功,如果成功出现对应版本号则说明安装成功。
生成站点 通过执行以下命令,即可在指定目录初始化生成一个站点
$ hugo new site blog 上述命令的blog可以自定义为任意的目录,执行成功后将会得到以下的目录结构
archetypes config.toml content data layouts static themes 添加主题 hugo的主题页面里面的主题非常丰富,这边以本博客使用的hello-friend-ng 为例子,展示如何安装主题
$ cd blog $ git init $ git clone https://github.com/rhazdon/hugo-theme-hello-friend-ng.git themes/hello-friend-ng $ git submodule add https://github.com/rhazdon/hugo-theme-hello-friend-ng.git themes/hello-friend-ng 其中第四行的意思是将主题对应仓库当作子模块,从当前仓库中独立,当前仓库并不干预这个子仓库的内容
配置主题 将config.toml替换为以下内容,其中博客名字等都可在配置文件中自定义,这里就不加赘述
baseurl = &quot;localhost&quot; title = &quot;My Blog&quot; languageCode = &quot;en-us&quot; theme = &quot;hello-friend-ng&quot; paginate = 10 [params] dateform = &quot;Jan 2, 2006&quot; dateformShort = &quot;Jan 2&quot; dateformNum = &quot;2006-01-02&quot; dateformNumTime = &quot;2006-01-02 15:04 -0700&quot; # Subtitle for home homeSubtitle = &quot;A simple and beautiful blog&quot; # Set disableReadOtherPosts to true in order to hide the links to other posts.</description>
</item>
</channel>
</rss>