本站建设记录

· 57字 · 1分钟

安装hugo,下载直接可用 🔗

https://github.com/gohugoio/hugo/releases

验证是否成功 🔗

hugo version

建站 🔗

hugo new site gker

添加主题 🔗

cd gker;
git init;
git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke;
//编辑你的 config.toml 配置文件使用该主题
echo ’theme = “ananke”’ » config.toml

新建文章 🔗

hugo new post/first.md

本地测试 🔗

hugo server -D
访问http://localhost:1313

生成静态网站 🔗

hugo

生成的网站源码结构 🔗

archetypes: 储存.md的模板文件,类似于hexo的scaffolds,该文件夹的优先级高于主题下的/archetypes文件夹
config.toml: 配置文件
content: 储存网站的所有内容,类似于hexo的source
data: 储存数据文件供模板调用,类似于hexo的source/_data
layouts: 储存.html模板,该文件夹的优先级高于主题下的/layouts文件夹
static: 储存图片,css,js等静态文件,该目录下的文件会直接拷贝到/public,该文件夹的优先级高于主题下的/static文件夹
themes: 储存主题
public: 执行hugo命令后,储存生成的静态文件

comments powered by Disqus