mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-05-18 14:34:23 +02:00
Merge ab0b73693f860f354b82a5c326253b92c32eb088 into 7be47742a6dc86f22d148ca9d304f7a9eea318cf
This commit is contained in:
commit
ba6a833af8
@ -99,6 +99,13 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
|
|||||||
const tags: SimpleSlug[] = []
|
const tags: SimpleSlug[] = []
|
||||||
const validLinks = new Set(data.keys())
|
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>()
|
const tweens = new Map<string, TweenNode>()
|
||||||
for (const [source, details] of data.entries()) {
|
for (const [source, details] of data.entries()) {
|
||||||
const outgoing = details.links ?? []
|
const outgoing = details.links ?? []
|
||||||
@ -107,6 +114,10 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
|
|||||||
if (validLinks.has(dest)) {
|
if (validLinks.has(dest)) {
|
||||||
links.push({ source: source, target: dest })
|
links.push({ source: source, target: dest })
|
||||||
}
|
}
|
||||||
|
const aliased = aliases.get(dest)
|
||||||
|
if (aliased) {
|
||||||
|
links.push({ source: source, target: aliased })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (showTags) {
|
if (showTags) {
|
||||||
|
@ -14,6 +14,7 @@ export type ContentDetails = {
|
|||||||
title: string
|
title: string
|
||||||
links: SimpleSlug[]
|
links: SimpleSlug[]
|
||||||
tags: string[]
|
tags: string[]
|
||||||
|
aliases: FullSlug[]
|
||||||
content: string
|
content: string
|
||||||
richContent?: string
|
richContent?: string
|
||||||
date?: Date
|
date?: Date
|
||||||
@ -125,6 +126,7 @@ export const ContentIndex: QuartzEmitterPlugin<Partial<Options>> = (opts) => {
|
|||||||
title: file.data.frontmatter?.title!,
|
title: file.data.frontmatter?.title!,
|
||||||
links: file.data.links ?? [],
|
links: file.data.links ?? [],
|
||||||
tags: file.data.frontmatter?.tags ?? [],
|
tags: file.data.frontmatter?.tags ?? [],
|
||||||
|
aliases: file.data.aliases ?? [],
|
||||||
content: file.data.text ?? "",
|
content: file.data.text ?? "",
|
||||||
richContent: opts?.rssFullHtml
|
richContent: opts?.rssFullHtml
|
||||||
? escapeHTML(toHtml(tree as Root, { allowDangerousHtml: true }))
|
? escapeHTML(toHtml(tree as Root, { allowDangerousHtml: true }))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user