mirror of
https://github.com/logos-co/assembly.git
synced 2026-08-27 11:11:08 +00:00
Connects the InlineComments component to the live Cloudflare worker and fixes a gap that left OAuth secrets uncovered by gitignore. - quartz.layout.ts: point apiBase at the deployed worker so the client engine activates (it no-ops on an empty apiBase) - wrangler.toml: allow the production origin (logos-co.github.io) alongside the local dev server. [vars] need a redeploy to take effect; secrets do not - .gitignore: protect .dev.vars and .wrangler/ from the repo root. The root ignore file excludes all nested .gitignore files, so the worker's own ignore rules were never tracked and did not survive a fresh clone - worker README: reorder to deploy-first, since the OAuth callback URL contains the worker URL, which does not exist until after deploy Verified against the deployed worker: routing, token/client-id bindings, origin allowlist (allow + deny), and callback state validation. Untested: GITHUB_CLIENT_SECRET, which needs a real browser OAuth round-trip. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
99 lines
2.8 KiB
TypeScript
99 lines
2.8 KiB
TypeScript
import { PageLayout, SharedLayout } from "./quartz/cfg"
|
|
import * as Component from "./quartz/components"
|
|
|
|
// components shared across all pages
|
|
export const sharedPageComponents: SharedLayout = {
|
|
head: Component.Head(),
|
|
header: [],
|
|
afterBody: [
|
|
Component.Comments({
|
|
provider: "giscus",
|
|
options: {
|
|
// from data-repo
|
|
repo: "logos-co/assembly",
|
|
// from data-repo-id
|
|
repoId: "R_kgDOQUhKqA",
|
|
// from data-category
|
|
category: "Announcements",
|
|
// from data-category-id
|
|
categoryId: "DIC_kwDOQUhKqM4Cxur2",
|
|
// from data-lang
|
|
lang: "en",
|
|
},
|
|
}),
|
|
// Inline (anchored) comments — shares the same GitHub Discussion as giscus
|
|
// above. No-ops until `apiBase` points at a deployed inline-comments worker
|
|
// (see serverless/inline-comments-worker + docs-internal/inline-comments-design.md).
|
|
Component.InlineComments({
|
|
provider: "github",
|
|
options: {
|
|
repo: "logos-co/assembly",
|
|
repoId: "R_kgDOQUhKqA",
|
|
category: "Announcements",
|
|
categoryId: "DIC_kwDOQUhKqM4Cxur2",
|
|
apiBase: "https://inline-comments.inline-assembly.workers.dev",
|
|
mapping: "url", // match giscus's mapping to share the same discussion
|
|
},
|
|
}),
|
|
],
|
|
footer: Component.Footer({
|
|
links: {
|
|
GitHub: "https://github.com/logos-co/assembly",
|
|
"Discord Community": "https://discord.gg/9At2E9esrH",
|
|
},
|
|
}),
|
|
}
|
|
|
|
// components for pages that display a single page (e.g. a single note)
|
|
export const defaultContentPageLayout: PageLayout = {
|
|
beforeBody: [
|
|
Component.ConditionalRender({
|
|
component: Component.Breadcrumbs(),
|
|
condition: (page) => page.fileData.slug !== "index",
|
|
}),
|
|
Component.ArticleTitle(),
|
|
Component.ContentMeta(),
|
|
Component.TagList(),
|
|
],
|
|
left: [
|
|
Component.PageTitle(),
|
|
Component.MobileOnly(Component.Spacer()),
|
|
Component.Flex({
|
|
components: [
|
|
{
|
|
Component: Component.Search(),
|
|
grow: true,
|
|
},
|
|
{ Component: Component.Darkmode() },
|
|
{ Component: Component.ReaderMode() },
|
|
],
|
|
}),
|
|
Component.Explorer(),
|
|
],
|
|
right: [
|
|
Component.Graph(),
|
|
Component.DesktopOnly(Component.TableOfContents()),
|
|
Component.Backlinks(),
|
|
],
|
|
}
|
|
|
|
// components for pages that display lists of pages (e.g. tags or folders)
|
|
export const defaultListPageLayout: PageLayout = {
|
|
beforeBody: [Component.Breadcrumbs(), Component.ArticleTitle(), Component.ContentMeta()],
|
|
left: [
|
|
Component.PageTitle(),
|
|
Component.MobileOnly(Component.Spacer()),
|
|
Component.Flex({
|
|
components: [
|
|
{
|
|
Component: Component.Search(),
|
|
grow: true,
|
|
},
|
|
{ Component: Component.Darkmode() },
|
|
],
|
|
}),
|
|
Component.Explorer(),
|
|
],
|
|
right: [],
|
|
}
|