Generate post toc on build time

This commit is contained in:
DefectingCat
2022-08-19 10:50:02 +08:00
parent 03d6fd1a0f
commit f6cb2a8f74
7 changed files with 114 additions and 75 deletions

View File

@ -4,7 +4,7 @@ import matter from 'gray-matter';
import { MyMatters, Post } from 'types';
import { sortByDate } from 'lib/utils';
const dataPath = 'data/posts';
export const dataPath = 'data/posts';
/**
* Read post meta info with gray-matter.