Skip to content

joway/hugo-theme-yinyang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

149 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YinYang

YinYang is a black-white theme for Hugo.

Demo

Feature

Screenshot

Installation

From the root of your site:

git submodule add https://github.com/joway/hugo-theme-yinyang.git themes/yinyang

Change config.toml:

theme = "yinyang"

Configuration

Head Title

[params]
headTitle = "Joway Wang"

If there is no headTitle in params, use .Site.Params.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

# ---------- Site ----------
baseURL = "https://blog.joway.io/"
languageCode = "en-us"
theme = "yinyang"
title = "Random Thoughts"
DefaultContentLanguage = "cn"
canonifyURLs = false
enableRobotsTXT = true

# ---------- Content Language ----------
[languages]
# [languages.en]
#   contentDir = "content/en"
#   languageName = "English"
#   weight = 1
[languages.cn]
contentDir = "content/cn"
languageName = "简体中文"
weight = 2

# ---------- URL ----------
[permalinks]
post = "/blog/:title/"

# ---------- Markdown / Highlight ----------
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
[markup.highlight]
guessSyntax = true
noClasses = false
style = "tango"
tabWidth = 2

# ---------- Theme Params ----------
[params]
description = "Log something useless, but interesting." 
disqus = "joway" # disqus account name
extraHead = ''
favicon = "/logo.png" 
headTitle = "Random Thoughts" 
mainSections = ["posts"] 
postFooterContent = '<br/><br/><p>Subscribe:<a target="_blank" href="https://mailchi.mp/a1a0d59e7a19/joway"><b>Mailchimp</b></a></p><br/><a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://blog.joway.io/images/cc.png" /></a>' 
postHeaderContent = "" 
staticPrefix = "https://cdn.jsdelivr.net/gh/joway/blog" 
# extraBody = '<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>'
# postAds = '<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-6400651395935595" data-ad-slot="5705651853" data-ad-format="auto" data-full-width-responsive="true"></ins>'
lazyImage = true

# ---------- Analytics ----------
[services]
  [services.googleAnalytics]
    id = "" # e.g. G-XXXXXXXXXX

# ---------- Author ----------
[params.author]
homepage = "https://joway.io/"
name = "Joway"

# ---------- Social Links ----------
# [[params.socials]]
# name = "Telegram"
# link = "https://t.me/biosthinking"

# [[params.socials]]
# name = "RSS"
# link = "/index.xml"

# [[params.socials]]
# name = "Slides"
# link = "/presentations"

[[params.socials]]
link = "https://mailchi.mp/a1a0d59e7a19/joway"
name = "Subscribe"
[[params.socials]]
link = "/travel"
name = "Travel"
[[params.socials]]
link = "https://joway.io"
name = "About"

# ---------- Optional: Related Posts ----------
# [related]
# includeNewer = true
# threshold = 80
# toLower = false
# [[related.indices]]
# name = "date"
# weight = 100
# [[related.indices]]
# name = "keywords"
# weight = 100

About

A black-white theme for Hugo.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors