website/quartz.layout.ts.in
Soc Virnyl Estela 6e9ee9d4b5
adjust forces
Signed-off-by: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
2024-06-30 23:19:39 +08:00

91 lines
2.8 KiB
TypeScript

import { PageLayout, SharedLayout } from "./quartz/cfg"
import * as Component from "./quartz/components"
import { pathToRoot } from "../util/path"
const leGraph = Component.Graph({
localGraph: {
drag: true, // whether to allow panning the view around
zoom: true, // whether to allow zooming in and out
depth: 1, // how many hops of notes to display
scale: 1.2, // default view scale
repelForce: 0.8, // how much nodes should repel each other
centerForce: 1.0, // how much force to use when trying to center the nodes
linkDistance: 30, // how long should the links be by default?
fontSize: 0.6, // what size should the node labels be?
opacityScale: 1, // how quickly do we fade out the labels when zooming out?
removeTags: [], // what tags to remove from the graph
showTags: true, // whether to show tags in the graph
},
globalGraph: {
drag: true,
zoom: true,
depth: -1,
scale: 0.8,
repelForce: 0.3,
centerForce: 0.6,
linkDistance: 30,
fontSize: 0.6,
opacityScale: 1,
removeTags: [], // what tags to remove from the graph
showTags: true, // whether to show tags in the graph
},
});
const commonbeforeBody = [
Component.MobileOnly(Component.Spacer()),
Component.Breadcrumbs(),
Component.ArticleTitle(),
Component.ContentMeta(),
Component.TagList(),
Component.MobileOnly(Component.TableOfContents()),
leGraph,
];
const webring = [
Component.Webring({
links: {
{%- for article in articles %}
"{{ article.title | safe }}": "{{ article.link | safe }}",
{% endfor -%}
},
}),
Component.MobileOnly(Component.Explorer()),
Component.DesktopOnly(Component.TableOfContents()),
Component.DesktopOnly(Component.Backlinks()),
];
const commonleft = [
Component.DesktopOnly(Component.Explorer()),
Component.MobileOnly(Component.PageTitle()),
Component.MobileOnly(Component.Spacer()),
Component.MobileOnly(Component.Search()),
Component.MobileOnly(Component.Darkmode()),
];
// components shared across all pages
export const sharedPageComponents: SharedLayout = {
head: Component.Head(),
header: [
Component.DesktopOnly(Component.PageTitle()),
Component.DesktopOnly(Component.Darkmode()),
Component.DesktopOnly(Component.Search()),
],
footer: Component.Footer({
}),
}
// components for pages that display a single page (e.g. a single note)
export const defaultContentPageLayout: PageLayout = {
beforeBody: commonbeforeBody,
left: commonleft,
right: webring,
}
// components for pages that display lists of pages (e.g. tags or folders)
export const defaultListPageLayout: PageLayout = {
beforeBody: commonbeforeBody,
left: commonleft,
right: webring,
}