实践效果
Quick Start
Install Hugo
brew install hugo
port install hugo
hugo version
Create a New Site
hugo new site quickstart
Add a Theme
cd quickstart
git init
git submodule add https://github.com/shenhonglei/airspace-hugo.git themes/airspace-hugo
Then, add the theme to the site configuration:
echo 'theme = "ananke"' >> config.toml
Add Some Content
You can manually create content files (for example as content/<CATEGORY>/<FILE>.<FORMAT> ) and provide metadata in them, however you can use the new command to do a few things for you (like add title and date):
hugo new posts/my-first-post.md
Start the Hugo server
Now, start the Hugo server with drafts enabled:
hugo server -D
Navigate to your new site at http://localhost:1313/.
Build static pages
It is simple. Just call:
hugo -D
Output will be in ./public/ directory by default (-d /--destination flag to change it, or set publishdir in the config file).
Theme Installation
使用模板方法一
git clone https://github.com/shenhonglei/airspace-hugo.git
cd exampleSite/
hugo server --themesDir ../..
使用模板方法二
hugo new site demo
cd demo/themes
将下载的airspace-hugo copy到themes,然后将exampleSite目录的内容copy到demo目录,替换全部。
hugo server
http://localhost:1313
个人博客快速建站
快速下载Themefisher模板,每个模板都有自己的文档、支持、持续更新内容。
eg:github-模板代码-airspace-hugo ,airspace-hugo使用文档
然后再参照,GitHub Actions 自动化部署 Hugo for GitHub Pages,自动化部署。
申请域名,解析服务等。
个人博客仓库名:xxxxx.github.io
Your GitHub Pages site is currently being built from the master branc:
master/root
Custom domain:xxxx.com
Enforce HTTPS :yes
hexo 博客添加评论功能
设置一个评论系统
|