Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitbook-plugin-archive

A GitBook plugin to archive articles by date and tags.

Installation

Install via yarn or npm:

# Yarn
yarn add github:fmw666/gitbook-plugin-archive

# NPM
npm install --save fmw666/gitbook-plugin-archive

Add to plugins in book.json:

...
  "plugins": [
    ...
    "archive"
    ...
  ]
...

Usage

  • in article

    ---
    title: "title"
    author: "author"
    date: 2023-08-26 01:16:00
    tags: ["读书", "笔记"]
    ---
    
    content
  • dateinfo by 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>
  • tagsinfo by 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>

config placement

Tags will show after the title by default, you can config the placement in the bottom.

    "pluginsConfig": {
        "archive": {
            "placement": "bottom"
        }
    }

Options

limit (default: all)

Controls maximum number of articles to display, eg show only the last 5 updated articles:

{% recentlyupdated limit="5" %}{% endrecentlyupdated %}

Example output

Tue Dec 05 2017
Fri Dec 01 2017

About

Add tags and date to GitBook

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages