mirror of
https://github.com/alrayyes/wiki.git
synced 2025-06-09 07:03:38 +00:00
local and global graph
This commit is contained in:
parent
8bfee04c8c
commit
c4cf0dcb02
23 changed files with 1288 additions and 110 deletions
quartz/plugins/emitters
|
@ -14,19 +14,20 @@ const defaultOptions: Options = {
|
|||
indexExternalLinks: false,
|
||||
}
|
||||
|
||||
type ContentIndex = Map<string, {
|
||||
export type ContentIndex = Map<string, ContentDetails>
|
||||
export type ContentDetails = {
|
||||
title: string,
|
||||
links?: string[],
|
||||
tags?: string[],
|
||||
content: string,
|
||||
}>
|
||||
}
|
||||
|
||||
export const ContentIndex: QuartzEmitterPlugin<Options> = (userOpts) => {
|
||||
const opts = { ...userOpts, ...defaultOptions }
|
||||
return {
|
||||
name: "ContentIndex",
|
||||
async emit(_contentDir, _cfg, content, _resources, emit) {
|
||||
const fp = "contentIndex"
|
||||
const fp = path.join("static", "contentIndex")
|
||||
const linkIndex: ContentIndex = new Map()
|
||||
for (const [tree, file] of content) {
|
||||
let slug = trimPathSuffix(file.data.slug!)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue