实践效果
Quick Start
Install Hugo
brew install hugo
# or
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
# 主题模板安装
#下载主题https://github.com/shenhonglei/airspace-hugo.git
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 博客添加评论功能
设置一个评论系统
-
多说 -
网易云跟帖 -
畅言
-
来必力(LiveRe)
-
Disqus
-
Hypercomments
-
valine
Valine 诞生于2017年8月7日,是一款基于LeanCloud的快速、简洁且高效的无后端评论系统。 理论上支持但不限于静态博客,目前已有Hexo、Jekyll、Typecho、Hugo、Ghost 等博客程序在使用Valine。
特性
- 快速
- 安全
- Emoji 😉
- 无后端实现
- MarkDown 全语法支持
- 轻量易用
- 文章阅读量统计
v1.2.0+
-
Github大礼包:gitment, gitalk(推荐),gitter(推荐); 三个都支持Markdown;
原则上来说比较靠谱的是gitment(依托于github issue,能够自己管理,而且被墙的概率小),不过兼容性不太好(需要chrome内核才行)。
Gitalk 是一个基于 GitHub Issue 和 Preact 开发的评论插件。
特性
- 使用 GitHub 登录
- 支持多语言 [en, zh-CN, zh-TW, es-ES, fr, ru, de, pl, ko]
- 支持个人或组织
- 无干扰模式(设置 distractionFreeMode 为 true 开启)
- 快捷键提交评论 (cmd|ctrl + enter)