add my page

This commit is contained in:
TieHaxJan 2025-02-18 15:56:04 +01:00
parent 04423d4931
commit d850615af0
5 changed files with 68 additions and 16 deletions

View File

View File

@ -8,7 +8,7 @@ import * as Plugin from "./quartz/plugins"
*/
const config: QuartzConfig = {
configuration: {
pageTitle: "🪴 Quartz 4.0",
pageTitle: "Janigma",
pageTitleSuffix: "",
enableSPA: true,
enablePopovers: true,
@ -16,7 +16,7 @@ const config: QuartzConfig = {
provider: "plausible",
},
locale: "en-US",
baseUrl: "quartz.jzhao.xyz",
baseUrl: "summaries.janigma.com",
ignorePatterns: ["private", "templates", ".obsidian"],
defaultDateType: "created",
generateSocialImages: false,
@ -57,9 +57,6 @@ const config: QuartzConfig = {
plugins: {
transformers: [
Plugin.FrontMatter(),
Plugin.CreatedModifiedDate({
priority: ["frontmatter", "filesystem"],
}),
Plugin.SyntaxHighlighting({
theme: {
light: "github-light",

View File

@ -6,14 +6,17 @@ export const sharedPageComponents: SharedLayout = {
head: Component.Head(),
header: [],
afterBody: [],
footer: Component.Footer({
links: {
GitHub: "https://github.com/jackyzha0/quartz",
"Discord Community": "https://discord.gg/cRFFHYye7t",
},
}),
footer: Component.Footer(),
}
const order = new Map([
["FS3", 1],
["FS4", 2],
["FS5", 3],
["Elective", 4],
["Blog", 5]
]);
// components for pages that display a single page (e.g. a single note)
export const defaultContentPageLayout: PageLayout = {
beforeBody: [
@ -27,10 +30,33 @@ export const defaultContentPageLayout: PageLayout = {
Component.MobileOnly(Component.Spacer()),
Component.Search(),
Component.Darkmode(),
Component.Explorer(),
Component.Explorer(
{
title: "Inhalt",
useSavedState: false,
sortFn: (a, b) => {
const orderA = order.get(a.displayName) ?? 99;
const orderB = order.get(b.displayName) ?? 99;
return orderA - orderB;
}
}
),
],
right: [
Component.Graph(),
Component.Graph({
localGraph: {
scale: 2.0,
depth: 3,
fontSize: 1.5,
repelForce: 0.2,
},
globalGraph: {
scale: 3.0,
fontSize: 1,
repelForce: 2,
}
}),
Component.DesktopOnly(Component.TableOfContents()),
Component.Backlinks(),
],
@ -44,7 +70,18 @@ export const defaultListPageLayout: PageLayout = {
Component.MobileOnly(Component.Spacer()),
Component.Search(),
Component.Darkmode(),
Component.Explorer(),
Component.Explorer(
{
title: "Inhalt",
useSavedState: false,
sortFn: (a, b) => {
const orderA = order.get(a.displayName) ?? 99;
const orderB = order.get(b.displayName) ?? 99;
return orderA - orderB;
}
}
),
],
right: [],
}

View File

@ -7,6 +7,7 @@ import { ExplorerNode, FileNode, Options } from "./ExplorerNode"
import { QuartzPluginData } from "../plugins/vfile"
import { classNames } from "../util/lang"
import { i18n } from "../i18n"
import { FullSlug } from "../util/path"
// Options interface defined in `ExplorerNode` to avoid circular dependency
const defaultOptions = {
@ -49,6 +50,14 @@ export default ((userOpts?: Partial<Options>) => {
function constructFileTree(allFiles: QuartzPluginData[]) {
// Construct tree from allFiles
fileTree = new FileNode("")
fileTree.add({
slug: "Photography" as FullSlug,
externalLink: "https://jan.schulz-nigmann.de"
})
fileTree.add({
slug: "GitHub" as FullSlug,
externalLink: "https://github.com/TieHaxJan"
})
allFiles.forEach((file) => fileTree.add(file))
// Execute all functions (sort, filter, map) that were provided (if none were provided, only default "sort" is applied)

View File

@ -160,9 +160,10 @@ type ExplorerNodeProps = {
opts: Options
fileData: QuartzPluginData
fullPath?: string
externalLink?: { url: string; target?: string }
}
export function ExplorerNode({ node, opts, fullPath, fileData }: ExplorerNodeProps) {
export function ExplorerNode({ node, opts, fullPath, fileData, externalLink }: ExplorerNodeProps) {
// Get options
const folderBehavior = opts.folderClickBehavior
const isDefaultOpen = opts.folderDefaultState === "open"
@ -170,10 +171,18 @@ export function ExplorerNode({ node, opts, fullPath, fileData }: ExplorerNodePro
// Calculate current folderPath
const folderPath = node.name !== "" ? joinSegments(fullPath ?? "", node.name) : ""
const href = resolveRelative(fileData.slug!, folderPath as SimpleSlug) + "/"
const isExternal = node.file && node.file.externalLink !== undefined
return (
<>
{node.file ? (
{isExternal ? (
// External link node
<li>
<a href={node.file.externalLink} target={"_blank"} class="external-link">
{node.displayName}
</a>
</li>
) : node.file ? (
// Single file node
<li key={node.file.slug}>
<a href={resolveRelative(fileData.slug!, node.file.slug!)} data-for={node.file.slug}>