hexo-generator-readme
v1.0.1
Published
auto generator a readme file for hexo blog
Downloads
12
Readme
hexo-generator-readme
中文
auto generator readme file for hexo blog
It generator a readme file thant you can store it in your git repository.
features
- custom readme template
- categories filter able
- categories custom sort
- post sort
- post filter in readme
Installation
npm i hexo-generator-readme -S
Oportions
Add or modify the following sections to you root _config.yml file:
generator-readme:
categories:
name: 1
order_by: ''
layout: ''
- categories: Which categories you will use for generation, the number behind it is used for sorting, the smaller the number, the higher the sorting
- default: all the categories will be generated in the readme
- order_by Post order
- default: date descending
- layout the layout template name.you should put this file in you theme layout folder; eg:
node_modules/hexo-theme-next/layout/readme.njk
- default: 'readme'
*** Usage
The skipInReadme
parameter in ths post Front-matter will be used to filter this post generated in the readme file;
---
title: Hello World
date: 2021/1/17 20:46:25
skipInReadme: true
---
You should create a readme template into the theme layout file. in the template ,you can use the formatted page.categories
variable; and all other locals
variable you can use.
more about
eg: a readme template like this :
{%- for c in page.categories %}
## {{c.name}}
{%- for p in c.posts %}
#### [{{ moment(p.date).format('YYYY-MM-DD') }}] [{{p.title}}](https://blog.linxiaodong.com/{{p.path}})
{%- endfor %}
{%- endfor %}
this will build a README.md
like github.com/buxuku/buxuku.github.io
License
MIT