diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..1d9e5915f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM node:20-slim as builder +WORKDIR /usr/src/app +COPY package.json . +COPY package-lock.json* . +RUN npm ci + +FROM node:20-slim +WORKDIR /usr/src/app +COPY --from=builder /usr/src/app/ /usr/src/app/ +COPY . . +CMD ["npx", "quartz", "build", "--serve"] diff --git a/content/.gitkeep b/content/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/content/images/dns records.png b/content/images/dns records.png deleted file mode 100644 index bf9f854bd..000000000 Binary files a/content/images/dns records.png and /dev/null differ diff --git a/content/images/quartz layout.png b/content/images/quartz layout.png deleted file mode 100644 index 03435f7d5..000000000 Binary files a/content/images/quartz layout.png and /dev/null differ diff --git a/content/images/quartz transform pipeline.png b/content/images/quartz transform pipeline.png deleted file mode 100644 index 657f0a3ab..000000000 Binary files a/content/images/quartz transform pipeline.png and /dev/null differ diff --git a/content/index.md b/content/index.md deleted file mode 100644 index 7bc5f90bf..000000000 --- a/content/index.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "" ---- -This site attempts to inform the previous, current, and future work required to fulfill the requirements of the projects under the Logos Collective, a complete tech stack that provides infrastructure for the self-sovereign network state. To learn more about the motivation, please visit the [Logos Collective Site](https://logos.co). - -This site is an ongoing work in progress. The links within are an attempt to capture a lot of moving targets. This means that the information here may or may not be the bleeding edge of what is true with respect to the development within the Logos Collective projects. Your use of this Website is subject to the following [[terms-of-use|terms of use]] which we ask you to read carefully prior to your use of the Website. - -## Navigation -- [Monthly Project Reports](tags/monthly-report) - -### Projects -- [Waku](waku/index.md) -- [Codex](codex/overview.md) -- [[nomos/index|Nomos]] - -### Services -- [Vac](vac/index.md) -- [Comms (Acid Info)](acid/index.md) -- [[insight/index|Insight]] - -### Skunk works -- [Innovation Lab](innovation_lab/index.md) diff --git a/content/tags/component.md b/content/tags/component.md deleted file mode 100644 index 57592e8cd..000000000 --- a/content/tags/component.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Components ---- - -Want to create your own custom component? Check out the advanced guide on [[creating components]] for more information. diff --git a/docs/advanced/making plugins.md b/docs/advanced/making plugins.md index 1f1616f42..d0934ad81 100644 --- a/docs/advanced/making plugins.md +++ b/docs/advanced/making plugins.md @@ -247,7 +247,7 @@ If you are creating an emitter plugin that needs to render components, there are - Your component should use `getQuartzComponents` to declare a list of `QuartzComponents` that it uses to construct the page. See the page on [[creating components]] for more information. - You can use the `renderPage` function defined in `quartz/components/renderPage.tsx` to render Quartz components into HTML. -- If you need to render an HTML AST to JSX, you can use the `toJsxRuntime` function from `hast-util-to-jsx-runtime` library. An example of this can be found in `quartz/components/pages/Content.tsx`. +- If you need to render an HTML AST to JSX, you can use the `htmlToJsx` function from `quartz/util/jsx.ts`. An example of this can be found in `quartz/components/pages/Content.tsx`. For example, the following is a simplified version of the content page plugin that renders every single page. diff --git a/docs/features/Docker Support.md b/docs/features/Docker Support.md new file mode 100644 index 000000000..cf73b7fcc --- /dev/null +++ b/docs/features/Docker Support.md @@ -0,0 +1,7 @@ +Quartz comes shipped with a Docker image that will allow you to preview your Quartz locally without installing Node. + +You can run the below one-liner to run Quartz in Docker. + +```sh +docker run --rm -itp 8080:8080 $(docker build -q .) +``` diff --git a/docs/features/breadcrumbs.md b/docs/features/breadcrumbs.md new file mode 100644 index 000000000..94db66ac0 --- /dev/null +++ b/docs/features/breadcrumbs.md @@ -0,0 +1,35 @@ +--- +title: "Breadcrumbs" +tags: + - component +--- + +Breadcrumbs provide a way to navigate a hierarchy of pages within your site using a list of its parent folders. + +By default, the element at the very top of your page is the breadcrumb navigation bar (can also be seen at the top on this page!). + +## Customization + +Most configuration can be done by passing in options to `Component.Breadcrumbs()`. + +For example, here's what the default configuration looks like: + +```typescript title="quartz.layout.ts" +Component.Breadcrumbs({ + spacerSymbol: ">", // symbol between crumbs + rootName: "Home", // name of first/root element + resolveFrontmatterTitle: false, // wether to resolve folder names through frontmatter titles (more computationally expensive) + hideOnRoot: true, // wether to hide breadcrumbs on root `index.md` page +}) +``` + +When passing in your own options, you can omit any or all of these fields if you'd like to keep the default value for that field. + +You can also adjust where the breadcrumbs will be displayed by adjusting the [[layout]] (moving `Component.Breadcrumbs()` up or down) + +Want to customize it even more? + +- Removing breadcrumbs: delete all usages of `Component.Breadcrumbs()` from `quartz.layout.ts`. +- Component: `quartz/components/Breadcrumbs.tsx` +- Style: `quartz/components/styles/breadcrumbs.scss` +- Script: inline at `quartz/components/Breadcrumbs.tsx` diff --git a/package.json b/package.json index 11a68d3ad..3fa8c2315 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "profile": "0x -D prof ./quartz/bootstrap-cli.mjs build --concurrency=1" }, "engines": { + "npm": ">=9.3.1", "node": ">=18.14" }, "keywords": [ diff --git a/quartz.layout.ts b/quartz.layout.ts index 92c3d8852..56e99d80b 100644 --- a/quartz.layout.ts +++ b/quartz.layout.ts @@ -15,7 +15,12 @@ export const sharedPageComponents: SharedLayout = { // components for pages that display a single page (e.g. a single note) export const defaultContentPageLayout: PageLayout = { - beforeBody: [Component.ArticleTitle(), Component.ContentMeta(), Component.TagList()], + beforeBody: [ + Component.Breadcrumbs(), + Component.ArticleTitle(), + Component.ContentMeta(), + Component.TagList(), + ], left: [ Component.PageTitle(), Component.MobileOnly(Component.Spacer()), diff --git a/quartz/components/ArticleTitle.tsx b/quartz/components/ArticleTitle.tsx index b8d58c6b3..a52b2a466 100644 --- a/quartz/components/ArticleTitle.tsx +++ b/quartz/components/ArticleTitle.tsx @@ -1,9 +1,9 @@ import { QuartzComponentConstructor, QuartzComponentProps } from "./types" -function ArticleTitle({ fileData }: QuartzComponentProps) { +function ArticleTitle({ fileData, displayClass }: QuartzComponentProps) { const title = fileData.frontmatter?.title if (title) { - return

{title}

+ return

{title}

} else { return null } diff --git a/quartz/components/Backlinks.tsx b/quartz/components/Backlinks.tsx index e88966b1c..c4172ce24 100644 --- a/quartz/components/Backlinks.tsx +++ b/quartz/components/Backlinks.tsx @@ -2,11 +2,11 @@ import { QuartzComponentConstructor, QuartzComponentProps } from "./types" import style from "./styles/backlinks.scss" import { resolveRelative, simplifySlug } from "../util/path" -function Backlinks({ fileData, allFiles }: QuartzComponentProps) { +function Backlinks({ fileData, allFiles, displayClass }: QuartzComponentProps) { const slug = simplifySlug(fileData.slug!) const backlinkFiles = allFiles.filter((file) => file.links?.includes(slug)) return ( -