mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-21 21:45:42 -05:00
Merge fc5a1f4987 into 59b5807601
This commit is contained in:
commit
913bfd91dc
@ -78,7 +78,11 @@ function renderTranscludes(
|
|||||||
if (classNames.includes("transclude")) {
|
if (classNames.includes("transclude")) {
|
||||||
const inner = node.children[0] as Element
|
const inner = node.children[0] as Element
|
||||||
const transcludeTarget = (inner.properties["data-slug"] ?? slug) as FullSlug
|
const transcludeTarget = (inner.properties["data-slug"] ?? slug) as FullSlug
|
||||||
if (visited.has(transcludeTarget)) {
|
const dataBlock = node.properties.dataBlock as string | undefined
|
||||||
|
const visitedKey = dataBlock
|
||||||
|
? (`${transcludeTarget}${dataBlock}` as FullSlug)
|
||||||
|
: transcludeTarget
|
||||||
|
if (visited.has(visitedKey)) {
|
||||||
console.warn(
|
console.warn(
|
||||||
styleText(
|
styleText(
|
||||||
"yellow",
|
"yellow",
|
||||||
@ -100,7 +104,7 @@ function renderTranscludes(
|
|||||||
]
|
]
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
visited.add(transcludeTarget)
|
visited.add(visitedKey)
|
||||||
|
|
||||||
const page = componentData.allFiles.find((f) => f.slug === transcludeTarget)
|
const page = componentData.allFiles.find((f) => f.slug === transcludeTarget)
|
||||||
if (!page) {
|
if (!page) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user