website/themes/cactus/README.md
A hugo theme for personal blog. Fork from hexo theme cactus created by @probberechts.
Some works are still in progress. See TODOS below.
themes folder.git clone https://github.com/monkeyWzr/hugo-theme-cactus.git themes/cactus
# config.toml
theme = "cactus"
hugo server
[params]
colortheme = "white" # dark, light, white, or classic
# Main menu which appears below site header.
[[menu.main]]
name = "Home"
url = "/"
weight = 1
[[menu.main]]
name = "All posts"
url = "/posts"
weight = 2
[[menu.main]]
name = "Tags"
url = "/tags"
weight = 3
[[menu.main]]
name = "About"
url = "/about"
weight = 4
[params]
description = "Hugo is a general-purpose website framework. Technically speaking, Hugo is a static site generator. Unlike systems that dynamically build a page with each visitor request, Hugo builds pages when you create or update your content. Since websites are viewed far more often than they are edited, Hugo is designed to provide an optimal viewing experience for your website’s end users and an ideal writing experience for website authors."
[params]
mainSection = "posts"
[params]
showAllPostsOnHomePage = false
postsOnHomePage = 5
[params]
showAllPostsOnHomePage = true
postsOnHomePage = 5 # this option will be ignored
[params]
tagsOverview = true
[params]
showProjectsList = true
projectsUrl = "https://github.com/monkeyWzr"
Projects section will not be shown if no data file detecSee Projects list below.
Create your projects data file data/projects.yaml|toml|json. Hugo support yaml, toml and json formats.
for former hexo cactus users: please assign your json array to a list key.
for example, data/projects.json:
{
"list": [
{
"name":"Hexo",
"url":"https://hexo.io/",
"desc":"A fast, simple & powerful blog framework"
},
{
"name":"Font Awesome",
"url":"http://fontawesome.io/",
"desc":"The iconic font and CSS toolkit"
}
]
}
[[params.social]]
name = "github"
link = "https://github.com/monkeyWzr"
[[params.social]]
name = "email"
link = "[email protected]" # no need for "mailto:" at the start
[[params.social]]
name = "linkedin"
link = "https://www.linkedin.com/in/monkeywzr/"
The name key expects the name of a Font Awesome icon.
Assign your copy right to .Site.Copyright. Cactus will append current year to the head.
TODO: Customizable copyright year
copyright = "Zeran Wu" # cactus theme will use site title if copyright is not set
Comments is disabled by default. Enable comments in your .Site.Params.
[params]
[params.comments]
enabled = true
# engine = "disqus" # in progress
You can also enable/disable comments per post. in your posts' front matter, add:
comments: true
The site config is ignored when comments option exists in front matter.
The default engine is disqus. By now only disqus is supported in cactus. I will add more options sooner or later. See Comments Alternatives
Before using disqus, you need to register and get your disqus shortname. Assign your shortname in .Site.disqusShortname, or cactus will use .Site.Title by default.
disqusShortname = "wzr" # cactus will use site title if not set
Use hugo's built-in syntax highlighting.
default config:
[markup]
[markup.highlight]
codeFences = true
guessSyntax = false
hl_Lines = ""
lineNoStart = 1
lineNos = false
lineNumbersInTable = true
noClasses = true
style = "monokai"
tabWidth = 4
Cactus uses hugo's bulit in analytics templates
Add you tracking id in your site config. By default cactus uses synchronous tracking code. You can switch to asynchronous tracking by set googleAnalyticsAsync to true.
googleAnalytics = "UA-123-45"
googleAnalyticsAsync = true # not required
The rss feed is not generated by default. you can enable it in your site config:
[params]
rss = true
The rss link will be https://example.com/index.xml assuming your baseURL is set to https://example.com/
Please also check Configure RSS
Cactus supports mathjax. Just add mathjax option in your site config:
[params]
mathjax = true # not required
You can also enable/disable mathjax per post. In your posts' front matter, add:
mathjax: true # or false
The site config will be ignored when mathjax option exists in front matter.
MIT