Hugo 主题
阴阳
阴阳是 Hugo 的一个黑白主题。
演示
特性
- 极简主义
- 多语言支持
- Disqus 支持
- SEO 优化
截图
安装
从你的站点根目录
git clone git@github.com:joway/hugo-theme-yinyang.git themes/yinyang
更改 config.toml
theme = "yinyang"
配置
头部标题
[params]
headTitle = "Joway Wang"
如果参数中没有 headTitle
,则使用 .Site.Author.name
。
主节
设置您的主节
[params]
mainSections = ["posts"]
多语言
[languages]
[languages.en]
contentDir = "content/en"
languageName = "English"
weight = 1
[languages.cn]
contentDir = "content/cn"
languageName = "Chinese"
weight = 2
然后你的帖子文件应该放在 content/en
或 content/cn
中。
页脚
[[params.socials]]
name = "About Me"
link = "https://joway.io"
[[params.socials]]
name = "Github"
link = "https://github.com/joway"
额外头部
[params]
extraHead = '<script src="xxxx.js"></script>'
额外 CSS 文件
[params]
extraCSSFiles = ["css/foo.css", "css/bar.css"]
Twitter 卡片
添加以下设置
[params]
twitterCards = true
在帖子的 front matter 中,包含一个关键字 images
,其值为将用于 Twitter 卡片的图像 URL 列表。
在每篇文章中插入内容
[params]
postHeaderContent = ""
postFooterContent = "<br/><br/><p>Subscribe:<a target='_blank' href='https://mailchi.mp/a1a0d59e7a19/joway'>Joway's Blog</a></p>"
示例
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://#/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 = []