hugo基本操作
hugo创建新的markdown格式文档
进入到新建hugo目录下:
chenxinsideMacBook-Pro:site chenxinsi$ hugo new post/README.md
生成的README.md文件将放在content/post文件夹下
发布新建的markdown文档
hugo undraft content/post/README.md
hugo生成对应的post/index.html文件
chenxinsideMacBook-Pro:site chenxinsi$ hugo
Started building sites ...
Built site for language en:
0 of 1 draft rendered
0 future content
0 expired content
5 regular pages created
12 other pages created
0 non-page files copied
1 paginator pages created
1 tags created
1 topics created
total in 16 ms
然后进入到public/post目录下,可以看到:
chenxinsideMacBook-Pro:post chenxinsi$ ls
first index.xml soong
index.html readme virtualenv
readme文件夹生成了,里面还有index.html文件用于网站显示
最后代码上传github仓库
- add到暂存区
chenxinsideMacBook-Pro:public chenxinsi$ git add --all
- commit
chenxinsideMacBook-Pro:public chenxinsi$ git commit -m "add readme"
[master 1a82694] add readme
...
15 files changed, 627 insertions(+), 16 deletions(-)
create mode 100644 post/readme/index.html
- push到github仓库
chenxinsideMacBook-Pro:public chenxinsi$ git push
Counting objects: 24, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (22/22), done.
Writing objects: 100% (24/24), 4.49 KiB | 0 bytes/s, done.
Total 24 (delta 16), reused 0 (delta 0)
remote: Resolving deltas: 100% (16/16), completed with 10 local objects.
To https://github.com/chenxinsi/chenxinsi.github.io.git
a7370a1..1a82694 master -> master
配置文件config.toml
baseURL = "https://chenxinsi.github.io"
languageCode = "en-us"
title = "Xinsi's Blog"
#Shown in the side menu
copyright = "© 2017. All rights reserved."
canonifyurls = true
paginate = 10
theme = "blackburn"
[indexes]
tag = "tags"
topic = "topics"
[params]
#Shown in the home page
subtitle = "Move on"
brand = "Menu"
googleAnalytics = "UA-103593285-1"
#CSS name for highlight.js
highlightjs = "monokai"
dateFormat = "02 Jan 2006, 15:04"
#disqusShortname
disqus = "xinsi"
[menu]
#Shown in the side menu.
[[menu.main]]
name = "Home"
pre = "<i class='fa fa-home fa-fw'></i>"
weight = 1
identifier = "home"
url = "/"
[[menu.main]]
name = "Posts"
pre = "<i class='fa fa-list fa-fw'></i>"
weight = 2
identifier = "post"
url = "/post/"
[[menu.main]]
name = "About"
pre = "<i class='fa fa-user fa-fw'></i>"
weight = 3
identifier = "about"
url = "/about/"
[[menu.main]]
name = "Contact"
pre = "<i class='fa fa-phone fa-fw'></i>"
weight = 4
url = "/contact/"
[[menu.main]]
name = "Topics"
pre = "<i class='fa fa-folder fa-fw'></i>"
weight = 5
url = "/topics/"
[[menu.main]]
name = "Tags"
pre = "<i class='fa fa-tags fa-fw'></i>"
weight = 6
url = "/tags/"
[social]
#Link your social networking accouns to the side menu
#by entering your username or ID.
github = "chenxinsi"
facebook = "chenxinsi"
instagram = "xinsichen"
tag&&topic
---
title: "在Github使用Hugo搭建个人博客"
date: 2017-07-29T21:33:13+08:00
draft: true
tags: [2017-12]
topics: [Android]
---
==tags==对应的是日期标记,==topics==对应的是主题