blob: c473f0b20013313b782b792b801b678d722b2f00 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
# YinYang
[YinYang](https://en.wikipedia.org/wiki/Yin_and_yang) is a black-white theme for [Hugo](https://gohugo.io/).
[**Demo**](https://blog.joway.io)
## Feature
- minimalist
- multi-language support
- [disqus](https://disqus.com) support
- [SEO Optimization](https://github.com/joway/hugo-theme-yinyang/blob/master/layouts/partials/seo.html)
## Screenshot
![](./images/screenshot.png)
## Installation
From the root of your site:
```shell
git clone git@github.com:joway/hugo-theme-yinyang.git themes/yinyang
```
Change `config.toml`:
```toml
theme = "yinyang"
```
## Configuration
### Head Title
```
[params]
headTitle = "Joway Wang"
```
If there is no `headTitle` in params, use `.Site.Author.name`.
### Main section
Set your main section:
```
[params]
mainSections = ["posts"]
```
### Multi-Language
```
[languages]
[languages.en]
contentDir = "content/en"
languageName = "English"
weight = 1
[languages.cn]
contentDir = "content/cn"
languageName = "Chinese"
weight = 2
```
Then your posts files should be put into `content/en` or `content/cn`.
### Footer
```
[[params.socials]]
name = "About Me"
link = "https://joway.io"
[[params.socials]]
name = "Github"
link = "https://github.com/joway"
```
### Extra Head
```
[params]
extraHead = '<script src="xxxx.js"></script>'
```
### Extra CSS files
```
[params]
extraCSSFiles = ["css/foo.css", "css/bar.css"]
```
### Twitter Cards
Add the following setting:
```
[params]
twitterCards = true
```
In a post's front matter, include a keyword `images` with a value of a list of
URLs of images that will be used for Twitter Cards.
### Insert content on every post
```
[params]
postHeaderContent = ""
postFooterContent = "<br/><br/><p>Subscribe:<a target='_blank' href='https://mailchi.mp/a1a0d59e7a19/joway'>Joway's Blog</a></p>"
```
### Example
```
baseURL = "https://blog.joway.io/"
languageCode = "en-us"
title = "Joway's Blog"
theme = "yinyang"
DefaultContentLanguage = "cn"
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
[markup.highlight]
guessSyntax = true
noClasses = true
style = "bw"
tabWidth = 2
[author]
name = "Joway"
homepage = "https://joway.io/"
[languages]
[languages.en]
contentDir = "content/en"
languageName = "English"
weight = 1
[languages.cn]
contentDir = "content/cn"
languageName = "Chinese"
weight = 2
[params]
mainSections = ["posts"]
headTitle = "Joway Wang"
disqus = "joway" # disqus account name
extraHead = '<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxx"></script>'
[[params.socials]]
name = "About Me"
link = "https://joway.io"
[[params.socials]]
name = "Github"
link = "https://github.com/joway"
postHeaderContent = ""
postFooterContent = "<br/><br/><p>Subscribe to:<a target='_blank' href='https://mailchi.mp/a1a0d59e7a19/joway'>Joway's Blog</a></p>"
# extraCSSFiles = ["css/foo.css", "css/bar.css"]
extraCSSFiles = []
```
|