fix emit filepaths, tag emit being overriden by content
| | |
| | | --- |
| | | title: Private Pages |
| | | tags: |
| | | - plugin/filter |
| | | --- |
| | | |
| | | There may be some notes you want to avoid publishing as a website. Quartz supports this through two mechanisms which can be used in conjunction: |
| | |
| | | title: "Table of Contents" |
| | | tags: |
| | | - component |
| | | - plugins/transformer |
| | | - plugin/transformer |
| | | --- |
| | | |
| | | Quartz can automatically generate a table of contents from a list of headings on each page. It will also show you your current scroll position on the site by marking headings you've scrolled through with a different colour. |
| | |
| | | analytics: { |
| | | provider: "plausible", |
| | | }, |
| | | baseUrl: "quartz.jzhao.xyz", |
| | | baseUrl: "four.quartz.jzhao.xyz", |
| | | ignorePatterns: ["private", "templates"], |
| | | theme: { |
| | | typography: { |
| | |
| | | import { toJsxRuntime } from "hast-util-to-jsx-runtime" |
| | | import style from "../styles/listPage.scss" |
| | | import { PageList } from "../PageList" |
| | | import { ServerSlug, canonicalizeServer, getAllSegmentPrefixes } from "../../path" |
| | | import { ServerSlug, canonicalizeServer, getAllSegmentPrefixes, joinSegments } from "../../path" |
| | | import { QuartzPluginData } from "../../plugins/vfile" |
| | | |
| | | const numPages = 10 |
| | |
| | | const { tree, fileData, allFiles } = props |
| | | const slug = fileData.slug |
| | | |
| | | if (!slug?.startsWith("tags/")) { |
| | | if (!(slug?.startsWith("tags/") || slug === "tags")) { |
| | | throw new Error(`Component "TagContent" tried to render a non-tag page: ${slug}`) |
| | | } |
| | | |
| | |
| | | return ( |
| | | <div> |
| | | <h2> |
| | | <a class="internal tag-link" href={`./tags/${tag}`}> |
| | | <a class="internal tag-link" href={`./${joinSegments("tags", tag)}`}> |
| | | #{tag} |
| | | </a> |
| | | </h2> |
| | |
| | | const dir = path.dirname(dest) as FilePath |
| | | await fs.promises.mkdir(dir, { recursive: true }) // ensure dir exists |
| | | await fs.promises.copyFile(src, dest) |
| | | res.push(fp) |
| | | res.push(dest) |
| | | } |
| | | |
| | | return res |
| | |
| | | const staticPath = joinSegments(QUARTZ, "static") |
| | | const fps = await glob("**", staticPath, cfg.configuration.ignorePatterns) |
| | | await fs.promises.cp(staticPath, joinSegments(argv.output, "static"), { recursive: true }) |
| | | return fps.map((fp) => joinSegments("static", fp)) as FilePath[] |
| | | return fps.map((fp) => joinSegments(argv.output, "static", fp)) as FilePath[] |
| | | }, |
| | | }) |
| | |
| | | return [ |
| | | tag, |
| | | defaultProcessedContent({ |
| | | slug: joinSegments("tags", tag, "index") as ServerSlug, |
| | | slug: joinSegments("tags", tag) as ServerSlug, |
| | | frontmatter: { title, tags: [] }, |
| | | }), |
| | | ] |
| | |
| | | for (const [tree, file] of content) { |
| | | const slug = file.data.slug! |
| | | if (slug.startsWith("tags/")) { |
| | | const tag = joinSegments(slug.slice("tags/".length), "index") |
| | | const tag = slug.slice("tags/".length) |
| | | if (tags.has(tag)) { |
| | | tagDescriptions[tag] = [tree, file] |
| | | } |