mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-05-19 06:54:18 +02:00
Compare commits
2 Commits
437826cb6f
...
9c86d02069
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9c86d02069 | ||
![]() |
ab0b73693f |
@ -101,6 +101,13 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
|
||||
const tags: SimpleSlug[] = []
|
||||
const validLinks = new Set(data.keys())
|
||||
|
||||
const aliases = new Map<SimpleSlug, SimpleSlug>()
|
||||
for (const [slug, details] of data.entries()) {
|
||||
for (const alias of details.aliases) {
|
||||
aliases.set(simplifySlug(alias), slug)
|
||||
}
|
||||
}
|
||||
|
||||
const tweens = new Map<string, TweenNode>()
|
||||
for (const [source, details] of data.entries()) {
|
||||
const outgoing = details.links ?? []
|
||||
@ -109,6 +116,10 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
|
||||
if (validLinks.has(dest)) {
|
||||
links.push({ source: source, target: dest })
|
||||
}
|
||||
const aliased = aliases.get(dest)
|
||||
if (aliased) {
|
||||
links.push({ source: source, target: aliased })
|
||||
}
|
||||
}
|
||||
|
||||
if (showTags) {
|
||||
|
@ -14,6 +14,7 @@ export type ContentDetails = {
|
||||
title: string
|
||||
links: SimpleSlug[]
|
||||
tags: string[]
|
||||
aliases: FullSlug[]
|
||||
content: string
|
||||
richContent?: string
|
||||
date?: Date
|
||||
@ -125,6 +126,7 @@ export const ContentIndex: QuartzEmitterPlugin<Partial<Options>> = (opts) => {
|
||||
title: file.data.frontmatter?.title!,
|
||||
links: file.data.links ?? [],
|
||||
tags: file.data.frontmatter?.tags ?? [],
|
||||
aliases: file.data.aliases ?? [],
|
||||
content: file.data.text ?? "",
|
||||
richContent: opts?.rssFullHtml
|
||||
? escapeHTML(toHtml(tree as Root, { allowDangerousHtml: true }))
|
||||
|
Loading…
x
Reference in New Issue
Block a user