Skip to content

Commit

Permalink
doc: trying new giscus component
Browse files Browse the repository at this point in the history
  • Loading branch information
nhannht committed May 7, 2024
1 parent ae3bf11 commit 56a1b76
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 118 deletions.
169 changes: 89 additions & 80 deletions quartz.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-ignore
import { QuartzConfig } from "./quartz/cfg"
import {QuartzConfig} from "./quartz/cfg"
// @ts-ignore
import * as Plugin from "./quartz/plugins"

Expand All @@ -9,86 +9,95 @@ import * as Plugin from "./quartz/plugins"
* See https://quartz.jzhao.xyz/configuration for more information.
*/
const config: QuartzConfig = {
configuration: {
pageTitle: "HISTORICA",
enableSPA: true,
enablePopovers: true,
analytics: {
configuration: {
pageTitle: "HISTORICA",
enableSPA: true,
enablePopovers: true,
discussion: {
provider: "giscus",
configure: {
dataRepo: "nhannht/obsidian-historica",
dataRepoId: "R_kgDOLWDFnQ",
dataCategory: "Comments from documents",
dataCategoryId: "DIC_kwDOLWDFnc4CfMZ6",
}
},
analytics: {
// @ts-ignore
provider: null,
},
locale: "en-US",
baseUrl: "https://historica.pages.dev",
ignorePatterns: ["private", "templates", ".obsidian"],
defaultDateType: "created",
theme: {
fontOrigin: "googleFonts",
cdnCaching: true,
typography: {
header: "Cinzel Decorative",
body: "Lora",
code: "Jetbrains Mono",
},
colors: {
lightMode: {
light: "#ffffff",
lightgray: "#e5e5e5",
gray: "#b8b8b8",
darkgray: "#4e4e4e",
dark: "#2b2b2b",
secondary: "#ea1717",
tertiary: "#84a59d",
highlight: "rgb(250,231,234)",
},
darkMode: {
light: "#161618",
lightgray: "#393639",
gray: "#646464",
darkgray: "#d4d4d4",
dark: "#ebebec",
secondary: "#7b97aa",
tertiary: "#84a59d",
highlight: "rgba(143, 159, 169, 0.15)",
},
},
},
},
plugins: {
transformers: [
Plugin.FrontMatter(),
Plugin.CreatedModifiedDate({
priority: ["frontmatter", "filesystem"],
}),
Plugin.Latex({ renderEngine: "katex" }),
Plugin.SyntaxHighlighting({
theme: {
light: "github-light",
dark: "github-dark",
},
keepBackground: false,
}),
Plugin.ObsidianFlavoredMarkdown({ enableInHtmlEmbed: false }),
Plugin.GitHubFlavoredMarkdown(),
Plugin.TableOfContents(),
Plugin.CrawlLinks({ markdownLinkResolution: "shortest" }),
Plugin.Description(),
],
filters: [Plugin.RemoveDrafts()],
emitters: [
Plugin.AliasRedirects(),
Plugin.ComponentResources(),
Plugin.ContentPage(),
Plugin.FolderPage(),
Plugin.TagPage(),
Plugin.ContentIndex({
enableSiteMap: true,
enableRSS: true,
}),
Plugin.Assets(),
Plugin.Static(),
Plugin.NotFoundPage(),
],
},
provider: null,
},
locale: "en-US",
baseUrl: "https://historica.pages.dev",
ignorePatterns: ["private", "templates", ".obsidian"],
defaultDateType: "created",
theme: {
fontOrigin: "googleFonts",
cdnCaching: true,
typography: {
header: "Cinzel Decorative",
body: "Lora",
code: "Jetbrains Mono",
},
colors: {
lightMode: {
light: "#ffffff",
lightgray: "#e5e5e5",
gray: "#b8b8b8",
darkgray: "#4e4e4e",
dark: "#2b2b2b",
secondary: "#ea1717",
tertiary: "#84a59d",
highlight: "rgb(250,231,234)",
},
darkMode: {
light: "#161618",
lightgray: "#393639",
gray: "#646464",
darkgray: "#d4d4d4",
dark: "#ebebec",
secondary: "#7b97aa",
tertiary: "#84a59d",
highlight: "rgba(143, 159, 169, 0.15)",
},
},
},
},
plugins: {
transformers: [
Plugin.FrontMatter(),
Plugin.CreatedModifiedDate({
priority: ["frontmatter", "filesystem"],
}),
Plugin.Latex({renderEngine: "katex"}),
Plugin.SyntaxHighlighting({
theme: {
light: "github-light",
dark: "github-dark",
},
keepBackground: false,
}),
Plugin.ObsidianFlavoredMarkdown({enableInHtmlEmbed: false}),
Plugin.GitHubFlavoredMarkdown(),
Plugin.TableOfContents(),
Plugin.CrawlLinks({markdownLinkResolution: "shortest"}),
Plugin.Description(),
],
filters: [Plugin.RemoveDrafts()],
emitters: [
Plugin.AliasRedirects(),
Plugin.ComponentResources(),
Plugin.ContentPage(),
Plugin.FolderPage(),
Plugin.TagPage(),
Plugin.ContentIndex({
enableSiteMap: true,
enableRSS: true,
}),
Plugin.Assets(),
Plugin.Static(),
Plugin.NotFoundPage(),
],
},
}

export default config
79 changes: 41 additions & 38 deletions quartz.layout.ts
Original file line number Diff line number Diff line change
@@ -1,53 +1,56 @@
// @ts-ignore
import { PageLayout, SharedLayout } from "./quartz/cfg"
import {PageLayout, SharedLayout} from "./quartz/cfg"
// @ts-ignore
import * as Component from "./quartz/components"

// components shared across all pages
export const sharedPageComponents: SharedLayout = {
head: Component.Head(),
header: [],
footer: Component.Footer(
{
links: {
"Source code": "https://github.com/nhannht/historica",
"RSS": "https://historica.pages.dev/index.xml"
,
},
}),
head: Component.Head(),
header: [],
footer: Component.Footer(
{
links: {
"Source code": "https://github.com/nhannht/historica",
"RSS": "https://historica.pages.dev/index.xml"
,
},
}),
}

// components for pages that display a single page (e.g. a single note)
export const defaultContentPageLayout: PageLayout = {
beforeBody: [
Component.Breadcrumbs(),
Component.ArticleTitle(),
Component.ContentMeta(),
Component.TagList(),
],
left: [
Component.PageTitle(),
Component.MobileOnly(Component.Spacer()),
Component.Search(),
Component.Darkmode(),
Component.DesktopOnly(Component.Explorer()),
],
right: [
Component.Graph(),
Component.DesktopOnly(Component.TableOfContents()),
Component.Backlinks(),
],
beforeBody: [
Component.Breadcrumbs(),
Component.ArticleTitle(),
Component.ContentMeta(),
Component.TagList(),
],
left: [
Component.PageTitle(),
Component.MobileOnly(Component.Spacer()),
Component.Search(),
Component.Darkmode(),
Component.DesktopOnly(Component.Explorer()),
],
right: [
Component.Graph(),
Component.DesktopOnly(Component.TableOfContents()),
Component.Backlinks(),
],
footer: Component.Discussion()


}

// 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.Search(),
Component.Darkmode(),
Component.DesktopOnly(Component.Explorer()),
],
right: [],
beforeBody: [Component.Breadcrumbs(), Component.ArticleTitle(), Component.ContentMeta()],
left: [
Component.PageTitle(),
Component.MobileOnly(Component.Spacer()),
Component.Search(),
Component.Darkmode(),
Component.DesktopOnly(Component.Explorer()),
],
right: [],
}

0 comments on commit 56a1b76

Please sign in to comment.