A GitBook plugin to archive articles by date and tags.
Install via yarn or npm:
# Yarn
yarn add github:fmw666/gitbook-plugin-archive
# NPM
npm install --save fmw666/gitbook-plugin-archiveAdd to plugins in book.json:
...
"plugins": [
...
"archive"
...
]
...-
in article
--- title: "title" author: "author" date: 2023-08-26 01:16:00 tags: ["读书", "笔记"] --- content
-
dateinfoby blocks{% dateinfo %}{% enddateinfo %}Example output
<h6>2023-08-26</h6> <ul> <li><a href="http://example.com">My first article</a></li> <li><a href="http://example.com">My second article</a></li> </ul> <h6>2023-08-25</h6> <ul> <li><a href="http://example.com">My third article</a></li> </ul>
-
tagsinfoby blocks{% tagsinfo %}{% endtagsinfo %}Example output
<div id="tags" class="tags"> <p> <i class="fa fa-tags" aria-hidden="true"></i> <a href="#读书">读书</a> <a href="#笔记">笔记</a> </p> </div> <h6>读书</h6> <ul> <li><a href="http://example.com">path1 > path2 > My first article</a></li> <li><a href="http://example.com">path1 > My second article</a></li> </ul> <h6>笔记</h6> <ul> <li><a href="http://example.com">My third article</a></li> </ul>
Tags will show after the title by default, you can config the placement in the bottom.
"pluginsConfig": {
"archive": {
"placement": "bottom"
}
}
Controls maximum number of articles to display, eg show only the last 5 updated articles:
{% recentlyupdated limit="5" %}{% endrecentlyupdated %}