前言
最近用vitepress整了个博客,写写博客的同时记录下每日的生活,想用时间轴(时间线)的形式展示每天的工作和日常,去官网翻了翻vitepress的markdown增强能力,发现也没有这一块的支持。于是在npm上找了找,发现一个好用的插件能实现时间轴功能。npm搜索vitepress-markdown-timeline,或直接点击链接进入。
安装
# NPM
$ npm install vitepress-markdown-timeline
# Yarn
$ yarn add vitepress-markdown-timeline
# pnpm
$ pnpm install vitepress-markdown-timeline
引入
在.vitepress/config.ts
中先注册 markdown 解析插件
// .vitepress/config.ts or .vitepress/config.js
import timeline from "vitepress-markdown-timeline";
export default {
// ...
markdown: {