@unisite/core-blog v0.0.2
@unisite/core-blog
The core library for
@unisite/theme-blog.
How to use
# terminal
> npm install @unisite/core-blog// gatsby-config.js
module.exports = () => {
return {
// ...
plugins: [
// ...
"@unisite/core-blog",
// ...
],
// ...
};
};Introduction
We introduce User, Tag, Category, Column and Post in this plugin.
User
The User is the owner or participator of a Post. So the Post can have more than one User.
In default, the information of User can be configured in user.yaml file. For example:
- id: "blackcater"
name: "Elon Tang"
avatar: "user/blackcater.png" # relative path
description: "Completion is more important than perfection!"
email: "blackcater2015@gmail.com"
website_url: "https://www.blackcater.com"
github_url: "https://www.github.com/blackcater"
# You also can set other social links.You can change the name of
user.yamlby settingOption.userConfigFileName.
Category
The blog can have more than one Category. The Category can have more than one Post.
In default, the information of Category can be configured in category.yaml file. For example:
- id: "frontend"
name: "前端"You can change the name of
category.yamlby settingOption.categoryConfigFileName.
Tag
The Post and Column can have more than one Tag.
In default, the information of Tag can be configured in tag.yaml file. For example:
- id: "vue"
name: "Vue"You can change the name of
tag.yamlby settingOption.tagConfigFileName.
Column
The Column can have more than one Tag, User and Post.
In default, the information of Column can be configured in column.yaml file. For example:
- id: "markdown-tutorial"
name: "Markdown Tutorial"
cover: "column/markdown-tutorial/cover.png"
# Collection of tag's id
tags:
- "markdown"
- "tutorial"
# Collection of user's id
authors:
- "blackcater"You can change the name of
column.yamlby settingOption.columnConfigFileName.
Post
The Post can have more than one Tag, User and Categories. But it can't have more than one Column.
In default, the information of Post can be configured in .md or .mdx files' front-matter. For example:
---
categories:
- "frontend"
tags:
- "markdown"
authors:
- "blackcater"
column: "markdown-tutorial"
---
# Post TitleConfiguration
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago