hugo-theme-zzo/README.md

998 lines
23 KiB
Markdown
Raw Normal View History

2019-11-04 13:09:44 +00:00
# Zzo theme for Hugo
2019-12-07 17:48:37 +00:00
English |
[한국어](https://github.com/zzossig/hugo-theme-zzo/blob/master/README.ko.md)
2019-12-27 08:38:13 +00:00
🔥🔥🔥🤓The minimum Hugo version changed to 0.60.0. This version changed the markdown rendering library, so if you are using an older version, it may not be compatible.🔥🔥🔥
Thank you for click me!. Zzo theme is a blog theme powered by Hugo with free(always), and many features.
2019-11-04 13:09:44 +00:00
## Table of contents
* [Features](#features)
* [Minimum Hugo version](#minimum-hugo-version)
* [Installation](#installation)
* [Updating](#updating)
* [Run example site](#run-example-site)
* [Configuration](#configuration)
* [Layout](#layout)
* [Gallery](#gallery)
2019-12-17 18:14:07 +00:00
* [Contact Page](#contact-page)
2019-12-31 02:26:57 +00:00
* [Talks Page](#talks-page)
2019-11-04 13:09:44 +00:00
* [Multi Language](#multi-language)
* [Author](#author)
2019-11-07 06:14:35 +00:00
* [Customizing](#customizing)
2019-12-07 17:48:37 +00:00
* [External libraries](#external-library)
2019-11-04 13:09:44 +00:00
* [Shortcodes](#shortcodes)
## Features
2019-11-20 07:26:07 +00:00
* Multiple Skins(dark, light, solarized, hacker)
2019-11-04 13:09:44 +00:00
* A mobile menu
* CSS grid and flex for layout
* HTML5
* Hugo Pipes for js and sass
* Simple blog
2019-12-07 17:48:37 +00:00
* Search Engine Optimization(SEO)
2019-11-04 13:09:44 +00:00
* Multilingual (i18n)
* Responsive design
* RSS and JSON feeds with full content
* Search
* Gallery
2019-11-27 16:47:41 +00:00
* Fast code highlighting
2019-12-31 02:26:57 +00:00
* Talks page for external links
2019-11-04 13:09:44 +00:00
## Minimum Hugo version
Hugo version 0.60.0 or higher is required.
2019-11-04 13:09:44 +00:00
## Installation
First of all, You need to add config files.
Follow the [Configuration](#configuration) step.
2019-11-06 00:33:16 +00:00
Then, You can download and unpack the theme manually from Github but it's easier to use git to clone the repo.
2019-11-04 13:09:44 +00:00
From the root of your site:
```bash
$ git clone https://github.com/zzossig/hugo-theme-zzo.git themes/zzo
```
If you use git to version control your site, highly recommended, it's best to add the zzo theme as a submodule.
From the root of your site:
```bash
git submodule add https://github.com/zzossig/hugo-theme-zzo.git themes/zzo
```
## Updating
From the root of your site:
```bash
git submodule update --remote --merge
```
## Run example site
2019-11-05 01:11:07 +00:00
From the root of themes/zzo/exampleSite:
2019-11-04 13:09:44 +00:00
```bash
2019-11-04 15:23:24 +00:00
hugo server --themesDir ../..
2019-11-04 13:09:44 +00:00
```
## Configuration
2019-11-06 01:14:38 +00:00
0. From the root of your site: delete config.toml file and add the files below
2019-11-06 01:13:03 +00:00
1. config folder structure. Keep in mind the underscore on the `_default` folder
2019-11-04 13:09:44 +00:00
```bash
root
├── config
│   ├── _default
│   │   ├── config.toml
│   │   ├── languages.toml
│   │   ├── menus.en.toml
│   │   ├── params.toml
```
2. config.toml
```bash
baseURL = "http://example.org/" # The URL of your site.
title = "Hugo Zzo Theme" # Title of your site
theme = "zzo" # Name of Zzo theme folder in `themes/`.
2019-11-04 13:09:44 +00:00
2019-12-07 17:48:37 +00:00
defaultContentLanguage = "en" # Default language to use (if you setup multilingual)
defaultContentLanguageInSubdir = true # baseURL/en/, baseURL/kr/ ...
hasCJKLanguage = true # Set `true` for Chinese/Japanese/Korean languages.
2019-11-04 13:09:44 +00:00
2019-12-07 17:48:37 +00:00
summaryLength = 70 # The length of a post description on a list page.
2020-01-01 05:23:11 +00:00
buildFuture = true # if true, we can use future date for talks page
2019-11-04 13:09:44 +00:00
2019-12-26 10:39:34 +00:00
copyright = "©{year}, All Rights Reserved" # copyright symbol: $copy; current year: {year}
2019-11-04 13:09:44 +00:00
timeout = 10000
enableEmoji = true
paginate = 13 # Number of items per page in paginated lists.
2019-11-04 13:09:44 +00:00
rssLimit = 100
enableGitInfo = false # When true, the modified date will appear on a summary and single page. Since GitHub info needs to be fetched, this feature will slow down to build depending on a page number you have
googleAnalytics = ""
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
2019-12-10 01:33:18 +00:00
hardWraps = true
unsafe = true
2019-12-10 01:33:18 +00:00
xHTML = true
[markup.highlight]
codeFences = true
lineNos = true
lineNumbersInTable = true
noClasses = false
2020-01-01 11:00:42 +00:00
[markup.tableOfContents]
endLevel = 3
ordered = false
startLevel = 2
2019-11-20 07:26:07 +00:00
[outputs]
2019-12-19 00:21:25 +00:00
home = ["HTML", "RSS", "JSON"]
2019-11-04 13:09:44 +00:00
[taxonomies]
category = "categories"
tag = "tags"
series = "series"
```
3. languages.toml
```bash
[en]
title = "Hugo Zzo Theme"
languageName = "English"
weight = 1
[ko]
title = "Hugo Zzo Theme"
languageName = "한국어"
weight = 2
```
4. menus.en.toml
2019-11-04 15:45:35 +00:00
You shoud make your own menu.
2019-11-04 13:09:44 +00:00
```bash
[[main]]
2019-11-06 01:18:51 +00:00
identifier = "about"
name = "about"
url = "about"
2019-11-07 18:09:15 +00:00
weight = 1
2019-11-06 01:18:51 +00:00
[[main]]
identifier = "archive"
name = "archive"
url = "archive"
2019-11-07 18:09:15 +00:00
weight = 2
2019-11-06 01:18:51 +00:00
[[main]]
identifier = "gallery"
name = "gallery"
url = "gallery"
2019-11-07 18:09:15 +00:00
weight = 3
2019-11-06 01:18:51 +00:00
[[main]]
parent = "gallery"
name = "cartoon"
url = "gallery/cartoon"
[[main]]
parent = "gallery"
name = "photo"
url = "gallery/photo"
[[main]]
identifier = "posts"
name = "posts"
url = "posts"
2019-11-07 18:09:15 +00:00
weight = 4
2019-11-06 01:18:51 +00:00
[[main]]
identifier = "notes"
name = "notes"
url = "notes"
2019-11-07 18:09:15 +00:00
weight = 5
2019-11-04 15:45:35 +00:00
...
2019-11-04 13:09:44 +00:00
```
5. params.toml
```bash
2019-12-07 17:48:37 +00:00
logoText = "Zzo" # Logo text that appears in the site navigation bar.
description = "The Zzo theme for Hugo example site." # for SEO
custom_css = [] # custom_css = ["scss/custom.scss"] and then make file at root/assets/scss/custom.scss
custom_js = [] # custom_js = ["js/custom.js"] and then make file at root/assets/js/custom.js
2020-01-07 07:30:51 +00:00
themeOptions = ["dark", "light", "hacker", "solarized"] # select options for site color theme
2020-01-02 06:05:03 +00:00
notAllowedTypesInHome = ["contact", "talks", "about"] # not allowed page types in home page. type can be set in front matter or default to folder name.
# header
homeHeaderType = "text" # text, img, slide
# navbar
enableThemeChange = true # site color theme
2019-11-04 13:09:44 +00:00
# body
enableBreadcrumb = true # breadcrumb for list, single page
enableSearch = true # site search with Fuse
enableSearchHighlight = true # when true, search keyword will be highlighted
enableGoToTop = true # scroll to top
enableWhoami = true # at the end of single page
2019-11-20 07:26:07 +00:00
summaryShape = "classic" # card, classic, compact
archiveGroupByDate = "2006" # "2006-01": group by month, "2006": group by year
archivePaginate = 13 # items per page
paginateWindow = 1 # setting it to 1 gives 7 buttons, 2 gives 9, etc. If set 1: [1 ... 4 5 6 ... 356] [1 2 3 4 5 ... 356] etc
talksPaginate = 8 # items per page
2019-12-31 02:26:57 +00:00
talksGroupByDate = "2006" # "2006-01": group by month, "2006": group by year
# whoami: usage - home page sidebar, single page bottom of post. all values can be empty
2019-11-20 07:26:07 +00:00
myname = "zzossig"
email = "zzossig@gmail.com"
whoami = "Web Developer"
useGravatar = false
2019-11-20 07:26:07 +00:00
location = "Seoul, Korea"
organization = "Hugo"
link = "https://github.com/zzossig/hugo-theme-zzo"
2019-11-04 13:09:44 +00:00
# sidebar
enableBio = true # home page sidebar
2019-12-07 17:48:37 +00:00
enableSidebar = true # Set to false to create the full width of the content.
enableSidebarTags = true # if you want to use tags.
2019-11-04 13:09:44 +00:00
enableSidebarSeries = true
enableSidebarCategories = true
2019-12-26 10:39:34 +00:00
enableToc = true # single page table of contents, you can replace this param to toc(toc = true)
hideToc = false # Hide or Show toc
enableTocSwitch = true # single page table of contents visibility switch
itemsPerCategory = 5 # maximum number of posts shown in the sidebar.
2019-11-04 13:09:44 +00:00
# footer
showPoweredBy = true # show footer text: Powered by Hugo and Zzo theme
showFeedLinks = true # RSS Feed
showSocialLinks = true # email, facebook, twitter ...
enableLangChange = true # show button at bottom left of footer.
2019-11-20 07:26:07 +00:00
# service
2019-12-07 17:48:37 +00:00
baiduAnalytics = "" # alternative of google analytics
enableBusuanzi = false # if set true, total page view, total unique visitors show up in the footer.
busuanziSiteUV = true # unique visitors (total number of visitors)
busuanziSitePV = true # site total page view count
busuanziPagePV = true # post view count
2019-11-20 07:26:07 +00:00
# comment
enableComment = true
disqus_shortname = ""
2019-11-20 07:26:07 +00:00
commento = false
[gitment] # Gitment is a comment system based on GitHub issues. see https://github.com/imsun/gitment
owner = "" # Your GitHub ID
repo = "" # The repo to store comments
clientId = "" # Your client ID
clientSecret = "" # Your client secret
[utterances] # https://utteranc.es/
owner = "" # Your GitHub ID
repo = "" # The repo to store comments
[gitalk] # Gitalk is a comment system based on GitHub issues. see https://github.com/gitalk/gitalk
owner = "" # Your GitHub ID
repo = "" # The repo to store comments
clientId = "" # Your client ID
clientSecret = "" # Your client secret
# Valine.
# You can get your appid and appkey from https://leancloud.cn
# more info please open https://valine.js.org
[valine]
enable = false
appId = '你的appId'
appKey = '你的appKey'
notify = false # mail notifier , https://github.com/xCss/Valine/wiki
verify = false # Verification code
avatar = 'mm'
placeholder = '说点什么吧...'
visitor = false
[changyan]
changyanAppid = "" # Changyan app id # 畅言
changyanAppkey = "" # Changyan app key
[livere]
livereUID = "" # LiveRe UID # 来必力
# Isso: https://posativ.org/isso/
[isso]
enable = false
scriptSrc = "" # "https://isso.example.com/js/embed.min.js"
dataAttrs = "" # "data-isso='https://isso.example.com' data-isso-require-author='true'"
[socialOptions] # if set, social icons will show up.
email = "mailto:your@email.com"
2019-11-04 13:09:44 +00:00
facebook = "http://example.org/"
twitter = "http://example.org/"
2019-11-20 07:26:07 +00:00
github = "https://github.com/zzossig/hugo-theme-zzo"
2019-11-04 13:09:44 +00:00
stack-overflow = ""
instagram = ""
google-plus = ""
youtube = ""
medium = ""
tumblr = ""
linkedin = ""
pinterest = ""
2019-11-04 13:09:44 +00:00
stack-exchange = ""
2019-12-04 03:44:13 +00:00
telegram = ""
steam = ""
weibo = ""
douban = ""
csdn = ""
zhihu = ""
2019-12-25 20:35:39 +00:00
gitlab = ""
mastodon = ""
jianshu = ""
zhihu = ""
[donationOptions]
2019-12-07 17:48:37 +00:00
enable = false # if set, the donation button will show up on the single page.
alipay = "" # Alipay QR Code image (example path: images/donation/alipay-qrcode.png) and put your file at root/static/images/donation/
wechat = "" # Wechat pay QR Code image (example path: same as above)
paypal = "" # Paypal URL
patreon = "" # Patreon URL
2019-12-26 10:39:34 +00:00
[copyrightOptions]
enableCopyrightLink = false # if set, you can add copyright link
copyrightLink = ""
copyrightLinkImage = ""
copyrightLinkText = ""
2019-11-04 13:09:44 +00:00
```
## Layout
### CSS grid for layout
Modern CSS grid is the easiest and cleanest way to layout your pages.
The CSS grid layout are in `assets/sass/layout/_grid.scss`. A lot can be done by just reordering "grid-template-rows".
2019-11-11 14:44:13 +00:00
### grid structure
2019-11-04 13:09:44 +00:00
| left | right |
|--- |--- |
| 1 | 2 |
| 3 | 4 |
| 5 | 6 |
| 7 | 8 |
* left, right column width ratio => 5 : 2
* 1 => .navbar-main
* 2 => .navbar-side
* 1 + 2 => .navbar
* 3 => .header-main
* 4 => .header-side
* 3 + 4 => .header
* 5 => .main-main
* 6 => .main-side
* 5 + 6 => .main
* 7 => .footer-main
* 8 => .footer-side
* 7 + 8 => .footer
### grid structure example applied in home page
```html
<div class="navbar"></div>
<div class="header"></div>
<div>
<div class="main-main"></div>
<div class="main-side"></div>
</div>
<div class="footer></div>
```
## Gallery
2019-12-07 17:48:37 +00:00
There are two ways to make gallery. You can specify **mode** at front-matter.
```bash
2019-11-20 07:26:07 +00:00
content/gallery/anygalleryname/index.md
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
description:
type: gallery
mode: one-by-one # at-once or one-by-one
tags:
-
series:
-
categories:
-
2019-12-07 17:48:37 +00:00
images: # when mode is one-by-one, images front-matter variable works
- image: image1.jpg
caption: caption1
- image: image2.jpg
caption: caption2
...
---
```
2019-12-07 17:48:37 +00:00
If you set the mode to one-by-one, the list.html page will use images front-matter variable you set above. If you set the mode to at-once, list.html page will not use front-matter images variable and just read all files under the static/gallery/anygalleryname folder.
2019-11-04 13:09:44 +00:00
1. Make a gallery folder under the content folder
```bash
root
├── content
│   ├── gallery
```
2. Make a sub folder under the gallery folder
```bash
root
├── content
│   ├── gallery
2019-11-20 07:26:07 +00:00
│   │   ├── anygalleryname
2019-11-04 13:09:44 +00:00
```
3. Make a index.md file under the sub folder using this command
```bash
2019-11-20 07:26:07 +00:00
hugo new --kind gallery gallery/anygalleryname/index.md
2019-11-04 13:09:44 +00:00
```
4. Put your images in static folder
```bash
root
├── static
│   ├── gallery
2019-11-20 07:26:07 +00:00
│   │   ├── anygalleryname
2019-11-04 13:09:44 +00:00
│   │   │ ├── ...your images here
```
2019-12-17 18:14:07 +00:00
## Contact Page
Currently available service: [formspree]. Open an issue if you need another service vendor.
1. Make a file at root/contact/index.md
```yaml
---
title: "Contact"
date: 2019-12-17T23:58:33+09:00
description: Contact page
type: contact
service: formspree
formId: "your@email.com"
---
This is contact page.
```
2. Add contact menu at root/config/_default/menus.en.toml.
```toml
...
[[main]]
identifier = "contact"
name = "contact"
url = "contact"
weight = 6
```
2019-12-31 02:26:57 +00:00
## Talks Page
Talks page is a listing page of links(video, ppt, event, ...). UI is similar to the archive page. Follow the below steps to make it.
1. Make a file at root/content/talks/_index.md.
```yaml
---
title: "Talks"
date: 2019-12-30T11:14:14+09:00
description: Talks Page
---
```
2019-12-31 02:30:45 +00:00
2. Next, make some files under the `talks` folder you have created in step 1. If you want to make other links block, then make another file under the `talks` folder.
root/content/talks/myLinks.md
2019-12-31 02:26:57 +00:00
```yaml
---
title: "My Awesome links"
date: 2019-12-31T00:04:50+09:00
publishDate: 2019-12-31
2019-12-31 02:26:57 +00:00
description:
tags:
-
series:
-
categories:
-
links:
- link: "https://google.com"
title: "Video Link Title"
type: "video"
- link: "https://naver.com"
title: "PPT Link Title"
type: "ppt"
- link: "https://yahoo.com"
title: "Event Link Title"
type: "event"
---
2019-12-31 02:38:59 +00:00
```
2019-12-31 02:26:57 +00:00
3. Finally, make a menu at your root/config/_default/menus.en.toml file
```toml
[[main]]
identifier = "talks"
name = "talks"
url = "talks"
weight = 6
```
And we are good to go.
2020-01-01 05:40:05 +00:00
4. Additionally, if you want to use a future date for the talks page, you need more things to do.
- add config variable named `buildFuture` at root/config/_default/config.toml
```toml
...
buildFuture = true
...
```
- add publishDate front matter to your md file at root/content/talks/myLinks.md
```yaml
---
title:
date:
publishDate: 2020-02-20
...
---
...
```
2019-11-04 13:09:44 +00:00
## Multi Language
The default language of this theme is English. If you want to use another language, follow these steps
1. Make a menu file.
```bash
root
├── config
│   ├── _default
│   │   ├── ...
│   │   ├── menus.ko.toml
```
```bash
config/_default/menus.ko.toml
[[main]]
identifier = "about"
name = "about"
2019-11-04 15:23:24 +00:00
url = "/about/"
2019-11-04 13:09:44 +00:00
weight = 1
[[main]]
identifier = "archive"
name = "archive"
2019-11-04 15:23:24 +00:00
url = "/archive/"
2019-11-04 13:09:44 +00:00
weight = 2
...
```
2. Make a content file. Add your language code before the md extension.
```bash
hugo new about/index.ko.md
hugo new posts/markdown-syntax.ko.md
...
```
3. Make an i18n file.
```bash
i18n/ko.toml
[search-placeholder]
other = "검색..."
[summary-dateformat]
other = "2006년 01월 02일"
[taxo-tags]
other = "태그"
...
```
2019-12-07 17:48:37 +00:00
4. Edit config.toml file.
```bash
defaultContentLanguage = "ko"
defaultContentLanguageInSubdir = true
hasCJKLanguage = true
```
2019-11-07 06:14:35 +00:00
## Customizing
2019-12-07 17:48:37 +00:00
It's a better idea not to modify the Zzo theme's folder if you want future support and upgrade. (You can modify if it doesn't matter) If you want more customizing options, open a new issue.
2019-11-07 06:14:35 +00:00
### custom css
1. Add this line of code to your params.toml file.
2019-11-07 06:14:35 +00:00
```bash
config/_default/params.toml
...
custom_css = ["css/custom.css", "scss/custom.scss", ...]
...
```
2. Add your file to assets folder. Filename must match with config params you set above.
```bash
assets/scss/custom.scss
assets/css/custom.css
```
2019-12-07 17:48:37 +00:00
3. If you want to modify the Zzo theme's default color, you should override the theme style. For example, if you're going to change the body background-color because I set the background-color in #body selector, not in the body tag selector, you should override body background-color there. Body tag selector won't work. And make sure to set !important. After setting the values, restart Hugo.
2019-11-07 06:14:35 +00:00
```css
assets/scss/custom.scss or assets/css/custom.css
...
#body {
background-color: red !important;
}
...
```
### custom js
1. Add this line of code to your params.toml file.
2019-11-07 06:14:35 +00:00
```bash
config/_default/params.toml
...
custom_js = ["js/custom.js", ...]
...
```
2. Add your file to assets folder. Filename must match with config params you set above.
```bash
assets/js/custom.js
```
2019-11-27 16:47:41 +00:00
### custom syntax highlighting
1. Make a skin.toml file at root/data folder. Set the theme_dark_chroma, theme_light_chroma, ... params value as you want. Refer this [link](https://xyproto.github.io/splash/docs/all.html). If theme_[xxxx]_chroma value include - or _ like special character, just delete it.
2019-11-27 16:56:22 +00:00
For example, if you want use solarized-dark256 style, set the param like this.
2019-12-07 17:48:37 +00:00
2019-11-27 16:47:41 +00:00
```
root/data/skin.toml
theme_dark_chroma = "solarizeddark256"
2019-11-27 16:47:41 +00:00
```
2. Add a custom style file if you want to change specific colors. [[custom-css](#custom-css)]
Then, override chroma class. You can find this class at themes/zzo/assets/sass/syntax folder.
Example code is like this.
```
root/assets/scss/custom.scss
.chroma {
background-color: #123456 !important;
}
```
Make sure that !important is necessary. After you changed this param, restart hugo.
### custom header
2019-11-15 09:29:35 +00:00
You may want to change home page header. There are 4 options which is slider, image, text, empty.
1. Set param at config/_default/params.toml(homeHeaderType)
2019-11-15 09:29:35 +00:00
2. Make _index.md file at root/content/_index.md and copy & paste below.
2019-11-15 09:29:35 +00:00
```yaml
---
header:
- type: text
height: 200
paddingX: 50
paddingY: 0
align: center
title:
- HUGO
subtitle:
- The worlds fastest framework for building websites
titleFontSize: 44
subtitleFontSize: 16
spaceBetweenTitleSubtitle: 20
2019-11-15 09:29:35 +00:00
- type: img
imageSrc: images/header/background.jpg # your image file path: root/static/images/header/background.jpg
imageSize: cover # auto|length|cover|contain|initial|inherit
imageRepeat: no-repeat # repeat|repeat-x|repeat-y|no-repeat|initial|inherit
imagePosition: center # x% y%| xpos ypos| left top| center bottom| ...
height: 235
paddingX: 50
paddingY: 0
align: center
title:
-
subtitle:
-
titleFontSize: 44
subtitleFontSize: 16
spaceBetweenTitleSubtitle: 20
- type: slide
height: 235
slide:
- paddingX: 50
paddingY: 0
align: left
imageSrc: images/header/background.jpg
imageSize: cover
imageRepeat: no-repeat
imagePosition: center
title:
- header title1
subtitle:
- header subtitle1
titleFontSize: 44
subtitleFontSize: 16
spaceBetweenTitleSubtitle: 20
- paddingX: 50
paddingY: 0
align: center
imageSrc: images/header/background.jpg
imageSize: cover
imageRepeat: no-repeat
imagePosition: center
title:
- header title2
subtitle:
- header subtitle2
titleFontSize: 44
subtitleFontSize: 16
spaceBetweenTitleSubtitle: 20
- paddingX: 50
paddingY: 0
align: right
imageSrc: images/header/background.jpg
imageSize: cover
imageRepeat: no-repeat
imagePosition: center
title:
- header title3
subtitle:
- header subtitle3
titleFontSize: 44
subtitleFontSize: 16
spaceBetweenTitleSubtitle: 20
---
```
3. Edit params as you wish.
2019-11-11 14:44:13 +00:00
### custom grid
1. Make a grid.toml file in data folder. (data/grid.toml)
2. Copy the contents of themes/zzo/data/grid.toml file and paste it into the grid.toml file you created above.
2019-12-07 17:48:37 +00:00
3. Change the grid as you want.
2019-11-11 14:44:13 +00:00
4. Once you change the grid.toml file, restart hugo.
```toml
data/grid.toml example
grid_max_width = "960"
grid_max_unit = "px" # "px", "\"%\"" Using% is limited to using full width.
2019-11-11 14:44:13 +00:00
grid_main_main_width = "5"
grid_main_main_unit = "fr" # "fr", "px"
2019-11-11 14:44:13 +00:00
grid_main_side_width = "2"
grid_main_side_unit = "fr" # "fr", "px"
grid_column_gap_width = "32"
grid_column_gap_unit = "px" # "px"
grid_navbar_height = "50px" # "px"
2019-11-11 14:44:13 +00:00
grid_row_gap = "0"
```
2019-12-04 07:58:29 +00:00
### custom font
1. Add custom css file
```bash
config/_default/params.toml
...
custom_css = ["css/font.css"]
...
```
Set the above param and add file to assets/css/font.css
2. In your font.css file, add font-face something like this.
```css
@font-face {
font-family: 'Montserrat';
src: url('../fonts/montserrat-black.woff2') format('woff2'),
url('../fonts/montserrat-black.woff') format('woff');
font-weight: 900;
font-style: normal;
}
@font-face {
font-family: 'Merriweather';
src: url('../fonts/merriweather-regular.woff2') format('woff2'),
url('../fonts/merriweather-regular.woff') format('woff');
font-weight: 400;
font-style: normal;
}
```
3. Add your fonts file at root/static/fonts/myfont.xxx (If your url in step2 is ('../fonts/myfont.xxx')).
2019-12-07 17:48:37 +00:00
4. Make a font.toml file at root/data/font.toml and make variables as below.
2019-12-04 07:58:29 +00:00
```toml
title_font = "\"Montserrat\", sans-serif"
content_font = "\"Merriweather\", serif"
```
2019-12-06 01:53:51 +00:00
5. Another approach
2019-12-07 17:48:37 +00:00
Make a file at root/layouts/partials/head/custom-head.html and then load font style.
2019-12-06 01:53:51 +00:00
```html
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+KR:400,700&display=swap&subset=korean" rel="stylesheet">
```
2019-12-26 10:39:34 +00:00
### custom copyright
If you want to add a link to the footer copyright, not just a text, you can customize it.
1. In your config.toml file, set the copyright param like this.
```toml
...
copyright = This is my {} copyright text
...
```
The {} part will be your copyright link.
2. In your params.toml file, set the copyrightOptions params
```toml
...
[copyrightOptions]
enableCopyrightLink = false
copyrightLink = "https://..."
copyrightLinkImage = "https://..."
copyrightLinkText = "copyright link text"
```
### custom favicon
Override the default favicon by adding your favicon at root/static folder
## Author
We have some front matters for specifying the author.
```yaml
---
title:
...
author: # author name
authorEmoji: 🤖 # emoji for subtitle, summary meta data
authorImage: "/images/whoami/avatar.jpg" # image path in the static folder
authorDesc: # author description
socialOptions: # override params.toml file socialOptions
email: ""
facebook: ""
...
---
```
2019-11-15 09:29:35 +00:00
## External Library
2019-12-07 17:48:37 +00:00
If you want use external libraries, this theme currently supporting Katex, MathJax, Mermaid, Flowchart.js, chart.js, viz-graph, wavedrom, js-sequence-diagram. Just add some variable to a front-matter.
2019-11-15 09:29:35 +00:00
```bash
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
...
libraries:
2019-11-20 07:26:07 +00:00
- katex
2019-11-15 09:29:35 +00:00
- mathjax
2019-11-20 07:26:07 +00:00
- chart
2019-11-15 09:29:35 +00:00
- flowchartjs
2019-11-20 07:26:07 +00:00
- msc
- katex
2019-11-15 09:29:35 +00:00
- mermaid
2019-11-20 07:26:07 +00:00
- viz
- wavedrom
2019-11-15 09:29:35 +00:00
---
```
You can add some config option parameters at data/flowchartjs.json
2019-11-04 13:09:44 +00:00
## Shortcodes
### warning
```bash
{{% alert theme="info" %}}**this** is a text{{% /alert %}}
{{% alert theme="success" %}}**Yeahhh !** is a text{{% /alert %}}
{{% alert theme="warning" %}}**Be carefull** is a text{{% /alert %}}
{{% alert theme="danger" %}}**Beware !** is a text{{% /alert %}}
```
### expand
```bash
{{%expand "Expand me" %}}Good job{{% /expand%}}
```
### img
```bash
// path: static/images/whoami/avatar.jpg, you can set width, height also
{{< img src="/images/whoami/avatar.jpg" title="Image4" caption="Image description" alt="image alt" >}}
2019-11-04 13:09:44 +00:00
```
### notice
```bash
{{% notice note %}} # note, info, tip, warning
2019-11-04 13:09:44 +00:00
A notice disclaimer
{{% /notice %}}
2019-11-06 01:13:03 +00:00
```
### color
```bash
{{< color "#0000ff" >}}*text*{{< /color >}}
```
### box
```bash
{{< box >}}
Some markdown contents
{{< /box >}}
```