-
Notifications
You must be signed in to change notification settings - Fork 11
Home
There are 3 different places where configuration options can be found:
- The global config, which is the
_config.yml
file located in the project root directory. - The theme config located in
/theme/gradient/_config.yml
- Different front matter attributes, which can be configured individually for each post.
Listed bellow are configuration options for the common site/theme features.
The site title can be set by changing the title
property in the global config.
The menu can be configured in the theme config.
Example:
menu:
Home: /
🗂️Archives: /archives
Hexo: https://hexo.io/
The footer is a list of font awesome icons and can be configured in the theme config.
Example:
footer_icons:
'Hexo.io':
url: 'https://hexo.io/'
class: 'fas fa-home'
'@hexojs':
url: 'https://twitter.com/hexojs'
class: 'fab fa-twitter'
'Report issue':
url: 'https://github.com/RandomAdversary/Gradient/issues'
class: 'fas fa-bug'
The recommended way is to use featured_image
attribute in front matter, and have different image for each post.
Example:
---
title: ❤️ Welcome to Gradient ❤️
date: 2018-10-14 23:47:55
featured_image: images/welcome.jpg
---
This post uses welcome.jpg as featured image.
If featured_image attribute is missing from the front matter, then, the default featured image will be used.
The default featured image can be found at /source/img/default.jpg
and can be configured through the theme config like this:
# If featured_image is missing from a post, this one will be used.
featured_image: ./img/default.jpg
The post summary should be configured through the summary
attribute in front matter. if the summary is missing, the article.excerpt variable will be used.
Example:
---
title: ❤️ Welcome to Gradient ❤️
date: 2018-10-14 23:47:55
summary: Gradient is clean and modern hexo theme.
---
Welcome to gradient!
The sidebar can be changed in the theme config. It has 2 parts, a twitter widget and unlimited amount of html blocks.
Example:
sidebar:
twitter:
enabled: true
username: 'hexojs'
height: 800
tldr:
- block1:
title: 'TL;DR'
content: 'Yet another hexo theme.'
- block2:
title: 'TL;DR 2'
content: '<a href="https://borche.dev/">Yes, you can use html.</a>'
Gradient supports twitter cards and open graph protocol in order to provide better experience for social media shares and search engine optimisation.
The mapping for these meta tags can be seen in the source code of the theme.