mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-28 07:14:05 -06:00
add my page
This commit is contained in:
parent
04423d4931
commit
d850615af0
@ -8,7 +8,7 @@ import * as Plugin from "./quartz/plugins"
|
|||||||
*/
|
*/
|
||||||
const config: QuartzConfig = {
|
const config: QuartzConfig = {
|
||||||
configuration: {
|
configuration: {
|
||||||
pageTitle: "🪴 Quartz 4.0",
|
pageTitle: "Janigma",
|
||||||
pageTitleSuffix: "",
|
pageTitleSuffix: "",
|
||||||
enableSPA: true,
|
enableSPA: true,
|
||||||
enablePopovers: true,
|
enablePopovers: true,
|
||||||
@ -16,7 +16,7 @@ const config: QuartzConfig = {
|
|||||||
provider: "plausible",
|
provider: "plausible",
|
||||||
},
|
},
|
||||||
locale: "en-US",
|
locale: "en-US",
|
||||||
baseUrl: "quartz.jzhao.xyz",
|
baseUrl: "summaries.janigma.com",
|
||||||
ignorePatterns: ["private", "templates", ".obsidian"],
|
ignorePatterns: ["private", "templates", ".obsidian"],
|
||||||
defaultDateType: "created",
|
defaultDateType: "created",
|
||||||
generateSocialImages: false,
|
generateSocialImages: false,
|
||||||
@ -57,9 +57,6 @@ const config: QuartzConfig = {
|
|||||||
plugins: {
|
plugins: {
|
||||||
transformers: [
|
transformers: [
|
||||||
Plugin.FrontMatter(),
|
Plugin.FrontMatter(),
|
||||||
Plugin.CreatedModifiedDate({
|
|
||||||
priority: ["frontmatter", "filesystem"],
|
|
||||||
}),
|
|
||||||
Plugin.SyntaxHighlighting({
|
Plugin.SyntaxHighlighting({
|
||||||
theme: {
|
theme: {
|
||||||
light: "github-light",
|
light: "github-light",
|
||||||
|
|||||||
@ -6,14 +6,17 @@ export const sharedPageComponents: SharedLayout = {
|
|||||||
head: Component.Head(),
|
head: Component.Head(),
|
||||||
header: [],
|
header: [],
|
||||||
afterBody: [],
|
afterBody: [],
|
||||||
footer: Component.Footer({
|
footer: Component.Footer(),
|
||||||
links: {
|
|
||||||
GitHub: "https://github.com/jackyzha0/quartz",
|
|
||||||
"Discord Community": "https://discord.gg/cRFFHYye7t",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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)
|
// components for pages that display a single page (e.g. a single note)
|
||||||
export const defaultContentPageLayout: PageLayout = {
|
export const defaultContentPageLayout: PageLayout = {
|
||||||
beforeBody: [
|
beforeBody: [
|
||||||
@ -27,10 +30,33 @@ export const defaultContentPageLayout: PageLayout = {
|
|||||||
Component.MobileOnly(Component.Spacer()),
|
Component.MobileOnly(Component.Spacer()),
|
||||||
Component.Search(),
|
Component.Search(),
|
||||||
Component.Darkmode(),
|
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: [
|
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.DesktopOnly(Component.TableOfContents()),
|
||||||
Component.Backlinks(),
|
Component.Backlinks(),
|
||||||
],
|
],
|
||||||
@ -44,7 +70,18 @@ export const defaultListPageLayout: PageLayout = {
|
|||||||
Component.MobileOnly(Component.Spacer()),
|
Component.MobileOnly(Component.Spacer()),
|
||||||
Component.Search(),
|
Component.Search(),
|
||||||
Component.Darkmode(),
|
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: [],
|
right: [],
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import { ExplorerNode, FileNode, Options } from "./ExplorerNode"
|
|||||||
import { QuartzPluginData } from "../plugins/vfile"
|
import { QuartzPluginData } from "../plugins/vfile"
|
||||||
import { classNames } from "../util/lang"
|
import { classNames } from "../util/lang"
|
||||||
import { i18n } from "../i18n"
|
import { i18n } from "../i18n"
|
||||||
|
import { FullSlug } from "../util/path"
|
||||||
|
|
||||||
// Options interface defined in `ExplorerNode` to avoid circular dependency
|
// Options interface defined in `ExplorerNode` to avoid circular dependency
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
@ -49,6 +50,14 @@ export default ((userOpts?: Partial<Options>) => {
|
|||||||
function constructFileTree(allFiles: QuartzPluginData[]) {
|
function constructFileTree(allFiles: QuartzPluginData[]) {
|
||||||
// Construct tree from allFiles
|
// Construct tree from allFiles
|
||||||
fileTree = new FileNode("")
|
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))
|
allFiles.forEach((file) => fileTree.add(file))
|
||||||
|
|
||||||
// Execute all functions (sort, filter, map) that were provided (if none were provided, only default "sort" is applied)
|
// Execute all functions (sort, filter, map) that were provided (if none were provided, only default "sort" is applied)
|
||||||
|
|||||||
@ -160,9 +160,10 @@ type ExplorerNodeProps = {
|
|||||||
opts: Options
|
opts: Options
|
||||||
fileData: QuartzPluginData
|
fileData: QuartzPluginData
|
||||||
fullPath?: string
|
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
|
// Get options
|
||||||
const folderBehavior = opts.folderClickBehavior
|
const folderBehavior = opts.folderClickBehavior
|
||||||
const isDefaultOpen = opts.folderDefaultState === "open"
|
const isDefaultOpen = opts.folderDefaultState === "open"
|
||||||
@ -170,10 +171,18 @@ export function ExplorerNode({ node, opts, fullPath, fileData }: ExplorerNodePro
|
|||||||
// Calculate current folderPath
|
// Calculate current folderPath
|
||||||
const folderPath = node.name !== "" ? joinSegments(fullPath ?? "", node.name) : ""
|
const folderPath = node.name !== "" ? joinSegments(fullPath ?? "", node.name) : ""
|
||||||
const href = resolveRelative(fileData.slug!, folderPath as SimpleSlug) + "/"
|
const href = resolveRelative(fileData.slug!, folderPath as SimpleSlug) + "/"
|
||||||
|
const isExternal = node.file && node.file.externalLink !== undefined
|
||||||
|
|
||||||
return (
|
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
|
// Single file node
|
||||||
<li key={node.file.slug}>
|
<li key={node.file.slug}>
|
||||||
<a href={resolveRelative(fileData.slug!, node.file.slug!)} data-for={node.file.slug}>
|
<a href={resolveRelative(fileData.slug!, node.file.slug!)} data-for={node.file.slug}>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user