initialize my quartz modification

Signed-off-by: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
This commit is contained in:
Soc Virnyl Estela 2024-06-27 08:37:19 +08:00
parent 3faf2ff6f5
commit d6256c3f86
Signed by: uncomfyhalomacro
SSH key fingerprint: SHA256:9Ez84JDMZLHJvRH+Kjgvlb+eX82QYEW127e6Rj66zBY
9 changed files with 253 additions and 27 deletions

24
.htaccess Normal file
View file

@ -0,0 +1,24 @@
RewriteEngine On
# RewriteBase /
# Redirect to www.example.com if necessary
# RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
# RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
# Serve 404 page when a file or directory is not found
ErrorDocument 404 /404.html
# Serve the requested resource as .html if it exists
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
# Serve the requested resource directly if it exists
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^ - [L]
# Serve index.html if it exists, otherwise rewrite to the file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.html

24
justfile Normal file
View file

@ -0,0 +1,24 @@
#!/usr/bin/just
default: all
build:
rm -rfv public
npx quartz build
cp -v .htaccess public/.htaccess
serve:
rm -rfv public
npx quartz build --serve
publish: build
#!/usr/bin/env bash
set -euxo pipefail
sudo chown $USER1:$USER1 -R public/
mv public zettel.uncomfyhalomacro.pl
ssh ${USER2}@${IP_ADDRESS} 'rm -rfv "/srv/www/vhosts/zettel.uncomfyhalomacro.pl"'
rsync --rsh="ssh -o StrictHostKeyChecking=no" -azvP --progress zettel.uncomfyhalomacro.pl "${USER2}@${IP_ADDRESS}:/srv/www/vhosts" > /dev/null
rm -rvf zettel.uncomfyhalomacro.pl
all: serve

25
package-lock.json generated
View file

@ -1360,11 +1360,12 @@
}
},
"node_modules/braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"license": "MIT",
"dependencies": {
"fill-range": "^7.0.1"
"fill-range": "^7.1.1"
},
"engines": {
"node": ">=8"
@ -2351,9 +2352,10 @@
}
},
"node_modules/fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"license": "MIT",
"dependencies": {
"to-regex-range": "^5.0.1"
},
@ -3105,6 +3107,7 @@
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"license": "MIT",
"engines": {
"node": ">=0.12.0"
}
@ -3198,13 +3201,14 @@
}
},
"node_modules/katex": {
"version": "0.16.8",
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.8.tgz",
"integrity": "sha512-ftuDnJbcbOckGY11OO+zg3OofESlbR5DRl2cmN8HeWeeFIV7wTXvAOx8kEjZjobhA+9wh2fbKeO6cdcA9Mnovg==",
"version": "0.16.10",
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.10.tgz",
"integrity": "sha512-ZiqaC04tp2O5utMsl2TEZTXxa6WSC4yo0fv5ML++D3QZv/vx2Mct0mTlRx3O+uUkjfuAgOkzsCmq5MiUEsDDdA==",
"funding": [
"https://opencollective.com/katex",
"https://github.com/sponsors/katex"
],
"license": "MIT",
"dependencies": {
"commander": "^8.3.0"
},
@ -5806,6 +5810,7 @@
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"license": "MIT",
"dependencies": {
"is-number": "^7.0.0"
},

View file

@ -8,23 +8,21 @@ import * as Plugin from "./quartz/plugins"
*/
const config: QuartzConfig = {
configuration: {
pageTitle: "🪴 Quartz 4.0",
pageTitle: "uncomfy's zettel",
enableSPA: true,
enablePopovers: true,
analytics: {
provider: "plausible",
},
analytics: null,
locale: "en-US",
baseUrl: "quartz.jzhao.xyz",
ignorePatterns: ["private", "templates", ".obsidian"],
baseUrl: "zettel.uncomfyhalomacro.pl",
ignorePatterns: ["private", "templates", ".obsidian", ".zk",],
defaultDateType: "created",
theme: {
fontOrigin: "googleFonts",
fontOrigin: "typeof",
cdnCaching: true,
typography: {
header: "Schibsted Grotesk",
body: "Source Sans Pro",
code: "IBM Plex Mono",
header: "Iosevka Etoile",
body: "Iosevka Etoile",
code: "Iosevka Slab",
},
colors: {
lightMode: {

View file

@ -4,11 +4,14 @@ import * as Component from "./quartz/components"
// components shared across all pages
export const sharedPageComponents: SharedLayout = {
head: Component.Head(),
header: [],
header: [
Component.PageTitle(),
Component.Darkmode(),
Component.Search(),
],
footer: Component.Footer({
links: {
GitHub: "https://github.com/jackyzha0/quartz",
"Discord Community": "https://discord.gg/cRFFHYye7t",
"About Me": "https://uncomfyhalomacro.pl",
},
}),
}
@ -16,20 +19,58 @@ export const sharedPageComponents: SharedLayout = {
// components for pages that display a single page (e.g. a single note)
export const defaultContentPageLayout: PageLayout = {
beforeBody: [
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: 2.1, // default view scale
repelForce: 0.5, // 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: 1.2,
repelForce: 0.2,
centerForce: 1.3,
linkDistance: 15,
fontSize: 0.6,
opacityScale: 1,
removeTags: [], // what tags to remove from the graph
showTags: true, // whether to show tags in the graph
},
}),
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.Webring({
links: {
"Why People are Angry over Go 1.23 Iterators": "https://www.gingerbill.org/article/2024/06/17/go-iterator-design/",
"My RSS feed has been upgraded ✨": "https://www.roboleary.net/blog/feed-update/",
"Programming at the edge with Fastly Compute": "https://www.integralist.co.uk/posts/fastly-compute-caching/",
"israeli national police found trying to purchase stalkerware - #FuckStalkerware pt. 7": "https://maia.crimew.gay/posts/fuckstalkerware-7/",
"Obsidian Freeform": "https://macwright.com/2024/06/02/freeform.html",
"Defending myself against defensive writing": "https://pcloadletter.dev/blog/bad-networks/",
"Writing a Unix clone in about a month": "https://drewdevault.com/2024/05/24/2024-05-24-Bunnix.html",
"Quadlet: Running Podman containers under systemd": "https://mo8it.com/blog/quadlet/",
"Regex engine internals as a library": "https://blog.burntsushi.net/regex-internals/",
"Eradicating image authentication injection from the entire internet": "https://samcurry.net/eradicating-image-authentication-injection-from-the-entire-internet",
},
}),
Component.DesktopOnly(Component.TableOfContents()),
Component.Backlinks(),
],

79
quartz.layout.ts.in Normal file
View file

@ -0,0 +1,79 @@
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: [],
footer: Component.Footer({
links: {
"About Me": "https://uncomfyhalomacro.pl",
{% for article in articles %}
"{{ article.title | safe }}": "{{ article.link | safe }}",
{% endfor %}
},
}),
}
// 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({
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: 2.1, // default view scale
repelForce: 0.5, // 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: 1.2,
repelForce: 0.5,
centerForce: 1.3,
linkDistance: 30,
fontSize: 0.6,
opacityScale: 1,
removeTags: [], // what tags to remove from the graph
showTags: true, // whether to show tags in the 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.Search(),
Component.Darkmode(),
Component.DesktopOnly(Component.Explorer()),
],
center: [],
right: [],
}

View file

@ -0,0 +1,31 @@
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
import style from "./styles/webring.scss"
import { i18n } from "../i18n"
interface Options {
links: Record<string, string>
}
export default ((opts?: Options) => {
const Webring: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => {
const year = new Date().getFullYear()
const links = opts?.links ?? []
return (
<div class="webring">
<h3>
Webring
</h3>
<ul class="overflow">
{Object.entries(links).map(([text, link]) => (
<li>
<a href={link} target="_blank">{text}</a>
</li>
))}
</ul>
</div>
)
}
Webring.css = style
return Webring
}) satisfies QuartzComponentConstructor

View file

@ -19,6 +19,7 @@ import DesktopOnly from "./DesktopOnly"
import MobileOnly from "./MobileOnly"
import RecentNotes from "./RecentNotes"
import Breadcrumbs from "./Breadcrumbs"
import Webring from "./Webring"
export {
ArticleTitle,
@ -42,4 +43,5 @@ export {
RecentNotes,
NotFound,
Breadcrumbs,
Webring,
}

View file

@ -0,0 +1,22 @@
div.webring {
text-align: left;
margin-bottom: 4rem;
& > h3 {
font-size: 1rem;
}
& > ul {
margin: 0.5rem 0;
max-height: 8rem;
transition: max-height 0.35s ease;
list-style: none;
padding: 0px;
gap: 1rem;
margin-top: -1rem;
& > li {
margin-top: 0.55rem;
line-height: 1.5rem;
}
}
}