From 998198cffb9bbcc8a75cd07310c06fabff6750bd Mon Sep 17 00:00:00 2001
From: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun, 11 Feb 2024 19:27:16 +0000
Subject: [PATCH] chore(deps): bump esbuild-sass-plugin from 2.16.0 to 2.16.1 (#778)
---
quartz/components/renderPage.tsx | 29 +++++++++++++++++++++++------
1 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/quartz/components/renderPage.tsx b/quartz/components/renderPage.tsx
index 02db2b0..4643d0a 100644
--- a/quartz/components/renderPage.tsx
+++ b/quartz/components/renderPage.tsx
@@ -7,6 +7,8 @@
import { visit } from "unist-util-visit"
import { Root, Element, ElementContent } from "hast"
import { QuartzPluginData } from "../plugins/vfile"
+import { GlobalConfiguration } from "../cfg"
+import { i18n } from "../i18n"
interface RenderComponents {
head: QuartzComponent
@@ -23,7 +25,7 @@
staticResources: StaticResources,
): StaticResources {
const contentIndexPath = joinSegments(baseDir, "static/contentIndex.json")
- const contentIndexScript = `const fetchData = fetch(\`${contentIndexPath}\`).then(data => data.json())`
+ const contentIndexScript = `const fetchData = fetch("${contentIndexPath}").then(data => data.json())`
return {
css: [joinSegments(baseDir, "index.css"), ...staticResources.css],
@@ -63,6 +65,7 @@
}
export function renderPage(
+ cfg: GlobalConfiguration,
slug: FullSlug,
componentData: QuartzComponentProps,
components: RenderComponents,
@@ -101,7 +104,9 @@
type: "element",
tagName: "a",
properties: { href: inner.properties?.href, class: ["internal"] },
- children: [{ type: "text", value: `Link to original` }],
+ children: [
+ { type: "text", value: i18n(cfg.locale).components.transcludes.linkToOriginal },
+ ],
},
]
}
@@ -136,7 +141,9 @@
type: "element",
tagName: "a",
properties: { href: inner.properties?.href, class: ["internal"] },
- children: [{ type: "text", value: `Link to original` }],
+ children: [
+ { type: "text", value: i18n(cfg.locale).components.transcludes.linkToOriginal },
+ ],
},
]
} else if (page.htmlAst) {
@@ -147,7 +154,14 @@
tagName: "h1",
properties: {},
children: [
- { type: "text", value: page.frontmatter?.title ?? `Transclude of ${page.slug}` },
+ {
+ type: "text",
+ value:
+ page.frontmatter?.title ??
+ i18n(cfg.locale).components.transcludes.transcludeOf({
+ targetSlug: page.slug!,
+ }),
+ },
],
},
...(page.htmlAst.children as ElementContent[]).map((child) =>
@@ -157,7 +171,9 @@
type: "element",
tagName: "a",
properties: { href: inner.properties?.href, class: ["internal"] },
- children: [{ type: "text", value: `Link to original` }],
+ children: [
+ { type: "text", value: i18n(cfg.locale).components.transcludes.linkToOriginal },
+ ],
},
]
}
@@ -193,8 +209,9 @@
</div>
)
+ const lang = componentData.frontmatter?.lang ?? cfg.locale?.split("-")[0] ?? "en"
const doc = (
- <html>
+ <html lang={lang}>
<Head {...componentData} />
<body data-slug={slug}>
<div id="quartz-root" class="page">
--
Gitblit v1.10.0