Hugo 主题
Whiteplain
这是一个简洁实用的 Hugo 主题。
安装
$ git clone https://github.com/taikii/whiteplain.git themes/whiteplain
或
$ git submodule add https://github.com/taikii/whiteplain.git themes/whiteplain
更多颜色
此主题根据操作系统颜色方案自动在浅色和深色样式之间切换。您可以通过添加以下主题来固定浅色或深色样式。
- 深色:固定为深色样式。
- 浅色:固定为浅色样式。
用法
配置
baseurl = "https://example.com/"
title = "Whiteplain"
theme = "whiteplain"
languageCode = "en"
# Disqus shortname
disqusShortname = "Shortname"
# google analytics tracking id
googleAnalytics = "Toracking ID"
# Copyright notice. This is displayer in the footer.
copyright = "© Copyright 2017 Your name"
[params]
# whether to use CDN or local file for fontawesome
#useCDN = false
# whether to include external sharing scripts and icons for twitter, facebook and co.
#showShareIcons = false
# Date format
#dateFormat = "January 2, 2006"
# This is displayer in About page.
[params.author]
name = "Your name"
# Gravatar or Abatar image
gravatar = "Gravatar email or MD5 Hash"
#avatar = "/path/to/avatar"
x = "X username"
twitter = "Twitter username"
facebook = "Facebook username"
googleplus = "Googleplus username"
instagram = "Instagram username"
threads = "Threads username"
tumblr = "Tumblr username"
flickr = "Flickr username"
reddit = "Reddit username"
linkedin = "Linkedin username"
slideshare = "Slideshare username"
github = "Github username"
gitlab = "Gitlab username"
bitbucket = "Bitbucket username"
stackoverflow = "Stackoverflow username"
jsfiddle = "Jsfiddle username"
codepen = "Codepen username"
deviantart = "Deviantart username"
behance = "Behance username"
dribbble = "Dribbble username"
wordpress = "Wordpress username"
medium = "Medium username"
foursquare = "Foursquare username"
xing = "Xing username"
quora = "Quora username"
youtube = "YouTube username"
tiktok = "TikTok username"
vimeo = "Vimeo username"
whatsapp = "Whatsapp username"
skype = "Skype username"
snapchat = "Snapchat username"
pinterest = "Pinterest username"
telegram = "Telegram username"
vine = "Vine username"
email = "Your email"
[[params.author.social]]
name = "Custom social link1"
iclass = "fa-brands fa-github"
url = "https://example.com/whiteplain"
[[params.author.social]]
name = "Custom social link2"
iclass = "fa-brands fa-google"
url = "https://example.com/whiteplain"
[taxonomies]
category = "categories"
tag = "tags"
series = "series"
# Header Menu
[[menu.main]]
name = "Categories"
identifier = "categories"
url = "/categories/"
weight = 1
[[menu.main]]
name = "Tags"
identifier = "tags"
url = "/tags/"
weight = 2
[[menu.main]]
name = "Archives"
identifier = "archives"
url = "/archives/"
weight = 3
[[menu.main]]
name = "About"
identifier = "about"
url = "/about/"
weight = 4
# Footer Menu
[[menu.footer]]
name = "About"
weight = 1
identifier = "about"
url = "/about/"
归档页面
如果您创建 content/archives/_index.html
,则会显示“归档”页面。该文件可以是 0 字节。
Hugo site direcctory
└── content
└── archives
└── _index.md
关于页面
作者信息显示在“关于”页面上。您应该在 content/about/_index.md
中创建“关于”页面。
Your site direcctory
└── content
└── about
└── _index.md
自定义样式表和 Javascript
您可以自定义样式表和 Javascript。当您创建 static/css/custom.css
和 static/js/custom.js
时,它们将自动加载。
默认语法高亮样式为 monokai
。如果您想更改样式,请创建 static/css/syntax.css
。请参阅 Hugo 语法高亮 了解有关语法高亮的信息。
Your site direcctory
└── static
├── css
│ ├── custom.css
│ └── syntax.css
└── js
└── custom.js
如果您想使用库和框架,请创建 layouts/partials/head_custom.html
。它的内容将被读取到 <head>...</head>
中。
Your site direcctory
├── layouts
└── partials
└── head_custom.html
自定义分享按钮
- 将
themes/whiteplain/layouts/partials/share.html
复制到layouts/partials/share.html
。 - 自定义
layouts/partials/share.html
。
Your site direcctory
├── layouts
│ └── partials
│ └── share.html
└── themes
└── whiteplain
└── layouts
└── partials
└── share.html
自定义作者 SNS 图标
- 将
themes/whiteplain/layouts/partials/social.html
复制到layouts/partials/social.html
。 - 自定义
layouts/partials/social.html
。
Your site direcctory
├── layouts
│ └── partials
│ └── social.html
└── themes
└── whiteplain
└── layouts
└── partials
└── social.html
图标
此主题使用 Font Awesome。
许可证
MIT