Skip to content

Commit 7ca3178

Browse files
committed
init
0 parents  commit 7ca3178

9 files changed

Lines changed: 126 additions & 0 deletions

File tree

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "themes/hugo-lithium"]
2+
path = themes/hugo-lithium
3+
url = git@github.com:draveness/hugo-lithium.git

.hugo_build.lock

Whitespace-only changes.

archetypes/default.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "{{ replace .Name "-" " " | title }}"
3+
date: {{ .Date }}
4+
draft: true
5+
---
6+

config.toml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
baseurl = "https://yanhj93.github.io/"
2+
languageCode = "en-us"
3+
title = "A Hugo website"
4+
theme = "hugo-lithium"
5+
googleAnalytics = ""
6+
disqusShortname = ""
7+
ignoreFiles = ["\\.Rmd$", "\\.Rmarkdown$", "_files$", "_cache$"]
8+
9+
[permalinks]
10+
# post = "/:year/:month/:day/:slug/"
11+
posts = "/:slug"
12+
13+
14+
[taxonomies]
15+
category = 'categories'
16+
tag = 'tags'
17+
18+
[[menu.main]]
19+
name = "demo"
20+
url = "/pl/"
21+
22+
[params]
23+
description = "A website built through Hugo and blogdown."
24+
25+
# options for highlight.js (version, additional languages, and theme)
26+
highlightjsVersion = "9.12.0"
27+
highlightjsCDN = "//cdnjs.cloudflare.com/ajax/libs"
28+
highlightjsLang = ["r", "yaml"]
29+
highlightjsTheme = "github"
30+
31+
MathJaxCDN = "//cdnjs.cloudflare.com/ajax/libs"
32+
MathJaxVersion = "2.7.5"
33+
34+
# path to the favicon, under "static"
35+
favicon = "favicon.ico"
36+
37+
[params.logo]
38+
url = "hugo-logo.png"
39+
width = 50
40+
height = 50
41+
alt = "Logo"

content/posts/blog_setup.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: "Blog_setup"
3+
date: 2022-10-02T21:36:07+08:00
4+
draft: false
5+
---
6+
7+
# hugo quick start
8+
跟着 [quick start doc](https://gohugo.io/getting-started/quick-start/) 初始化站点, theme 选择 [hugo-lithium](https://github.com/draveness/hugo-lithium)
9+
10+
# theme config
11+
替换 config.toml 为主题example site 的config.
12+
修改如下:
13+
- 修改posts permlink 为 baseURL/post_name.
14+
- 修改single page template, 增加 tag 显示区域.
15+
- 避免 `_index.md` 使用list page 模板渲染. 因为要自定义索引页.
16+
- 配置 archetype.
17+
- 配置菜单
18+
19+
# content organization
20+
如果需要发表系类文章, 系列名为demo, 陆续发表两篇文章 Go, Java.
21+
过程如下:
22+
- `hugo new posts/demo/_index.md`, 作为系列文章首页包含概述和文章索引. 发布后的URL为demo
23+
- posts 间的引用语法[link](https://gohugobrasil.netlify.app/content-management/cross-references/).
24+
- `hugo new posts/demo/Java.md`. 发布后的URL为 /java
25+
- `hugo new posts/demo/Go.md`. 发布后的URL为 /Go
26+
- 添加菜单
27+
```
28+
[[menu.main]]
29+
name = "demo"
30+
url = "/pl/"
31+
```
32+
# deploy
33+
use github action and github pages.
34+
action refer this [repo](https://github.com/peaceiris/actions-hugo).
35+
rename your baseURL in config.toml with the value `https://<USERNAME>.github.io`
36+
Go to repo settings->pages->source branch drop down, select branch `gh-pages` as page's source.
37+
After a while, action automation finished successfully, visit your page's address.
38+
39+
# references
40+
- hugo content organization and how hugo parse posts url. [link1](https://gohugobrasil.netlify.app/content-management/organization/)
41+
- single page(article) vs list page(_index.md, tag.md, categories.md) and their templates. [link2](https://gohugo.io/templates/introduction/)
42+
- hugo variables and scope bind. [link3](https://gohugo.io/variables/)

content/posts/demo/Go.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: "Go"
3+
date: 2022-10-01T12:24:46+08:00
4+
draft: false
5+
---
6+
7+
# Go

content/posts/demo/Java.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: "Java"
3+
date: 2022-10-01T12:24:46+08:00
4+
draft: false
5+
tags:
6+
- "pl"
7+
- "java"
8+
---
9+
10+
# Java

content/posts/demo/_index.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: "title in front matter"
3+
date: 2022-10-01T12:24:46+08:00
4+
draft: false
5+
slug: "pl"
6+
url: "/pl"
7+
non_ls_tpl: true
8+
---
9+
10+
# h1 in content
11+
12+
## h2
13+
- [Java]({{< ref "Java" >}})
14+
15+
## h2
16+
- [Go]({{< ref "go" >}})

themes/hugo-lithium

Submodule hugo-lithium added at 24bad9a

0 commit comments

Comments
 (0)