CHCA is a static blog generator developed using Golang. It is simple, convenient, and fast. It is necessary to use a command to compile files every time. It can automatically generate HTML.
go get -v github.com/ghaoo/chca/chca
# chca command [args...]
# 初始化博客文件夹
chca init
# 新建 markdown 文件
chca new filename
# 编译博客
chca compile/c
# 打开文件监听器
chca watch/w
# 打开文件服务器, 默认端口9900
chca http [port]
# 运行chca, 默认端口9900
chca run [port]
CHCA Init is used to initialize blogging, which will automatically generate config.yml
# config.yml
# 站点信息
title : 我的网站
subtitle : 网站标题
description : mate-description
keywords : mate-keywords
summary_line : 10 // 首页文章行数
home_art_num : 30 // 首页文章数量
# 文件夹相关
theme : theme/blog //网站模板
markdown : markdown //博客markdown文件存放文件夹
html : /data/www/html //博客html文件存放文件夹
storage : storage //数据存放文件夹,暂时未用到
# 作者信息
author : your name
avatar : /assets/avatar.png //头像连接,一般放到assets或者avatar文件夹里
github : https://github.com/ghaoo //github主页
weibo : http://weibo.com/golune //微博主页
mail : [email protected] //email 地址
zhihu : https://www.zhihu.com/people/golune //知乎主页
# 监听信息
paths : // 监听文件夹
- markdown
exts : // 监听后缀名
- md
# 上传信息
upload_theme : theme/upload // 上传模版地址
# 自定义标题,可不配置,使用chca设置好的标题
home_title : 主页标题
archive_title : 文章归档标题
tag_title : 标签导航页面标题
cate_title : 分类导航页面标题
about_title : 简历页面标题
article_title : 文章标题标头
After initialization, you need
Template folder structure
Template grammar Reference: Template
New Markdown File
Markdown file needs to be explained by ---
start:
---
date: 2017-01-01
title: 我的博客
categories:
- 技术
tags:
- golang
---
It is recommended to use CHCA to create a Markdown file
about.md
file readme.md
a file that about.md
the author's resume. It is stored in the Markdown folder.
Generate html file
Turn on the file monitor, the monitoring folder and file suffix name are configured in config.yml, and the configuration example:
// 监听文件夹
paths :
- markdown
// 监听后缀名
exts :
- md // 监听 markdown 文件(以.md为后缀的文件)
The above configuration: The listener listened to the file with .md
as the suffix under the markdown
folder. When the .md
file under the folder added or changed, CHCA would automatically compile the blog
Open the internal server, monitor port 8800
Open the internal server, the listening port 8800, and turn on the file monitor
ETCD is under the apache 2.0 livense. See the license file for details.