From d3bb86a2d4bda26a59de937338a85b07ffabd126 Mon Sep 17 00:00:00 2001 From: Justin <9146678+brickfrog@users.noreply.github.com> Date: Tue, 25 Jun 2024 05:36:53 -0400 Subject: [PATCH] Quartz sync: Jun 25, 2024, 5:36 AM --- content/daily/2024/06/2024-06-25.md | 69 +++++++++++++++++++++++ content/daily/2024/index.md | 3 + content/daily/index.md | 0 content/index.md | 14 ++++- content/notes/testing_again.md | 20 +++++++ quartz.config.ts | 12 ++-- quartz.layout.ts | 56 +++++++++++++++++- quartz/components/pages/FolderContent.tsx | 2 +- 8 files changed, 167 insertions(+), 9 deletions(-) create mode 100644 content/daily/2024/06/2024-06-25.md create mode 100644 content/daily/2024/index.md create mode 100644 content/daily/index.md create mode 100644 content/notes/testing_again.md diff --git a/content/daily/2024/06/2024-06-25.md b/content/daily/2024/06/2024-06-25.md new file mode 100644 index 000000000..e2fadcbde --- /dev/null +++ b/content/daily/2024/06/2024-06-25.md @@ -0,0 +1,69 @@ +--- +title: 2024-06-25 +author: ["Justin"] +lastmod: 2024-06-25T05:33:14-04:00 +draft: false +--- + +## Agenda {#agenda} + + +### Tasks {#tasks} + +- [ ] Anki Review - Chinese +- [ ] Exercise +- [ ] Watch a new movie +- [ ] Write a new note +- [ ] Read + + +## Notes {#notes} + + +### Reading {#reading} + +- [I Will Fucking Piledrive You If You Mention AI Again — Ludicity](https://ludic.mataroa.blog/blog/i-will-fucking-piledrive-you-if-you-mention-ai-again/) + - I think this is directionally correct. I love LLMs and use them quite a bit + (my god, it's so cheap, It cost me ~3 dollars to do something + that'd take hours before) but for the forseeable future I don't think I'd + trust most corporate initiatives to pull it off under budget or in a way + that doesn't give bad optics. + - A (personal) example is I used an LLM to generate mnemonics for my Chinese decks + (I'd say about 5% of them had to be redone, but I'm low agency enough to + admit if I didn't use a script to create them I wouldn't have ~1000+ hanzi + memorized by now) + - I've seen enough corporate initiatives go insane that should've + been simple (example in the article, a simple CRUD app, + etc. etc.) that I wouldn't trust 90% of the Fortune 500 to rollout + something without SERIOUS cost overruns. + + +## Journal {#journal} + + +### Morning {#morning} + +- Trying this out, I ended up making a new capture template for my org-roam + dailies, as you can see here. The differences between capture-today and the + template is a bit finnicky. + + + +```elisp +(setq org-roam-dailies-capture-templates + '(("d" "daily" plain + "* Agenda\n** Tasks\n- [ ] %?\n\n* Notes\n** Ideas\n- \n\n* Journal\n** Morning\n- \n\n** Evening\n- \n" + :target (file+head "%<%Y/%m/%Y-%m-%d>.org" + "#+title: %<%Y-%m-%d>\n#+hugo_tags: noexport\n\n") + :unnarrowed t + :empty-lines 1 + ))) +``` + +- I have some lunch meetings so I'm not sure how much I'll get done today. I'd + like to work on this site some more. + + +### Evening {#evening} + +- diff --git a/content/daily/2024/index.md b/content/daily/2024/index.md new file mode 100644 index 000000000..8f89f5fe6 --- /dev/null +++ b/content/daily/2024/index.md @@ -0,0 +1,3 @@ +--- +title: "2024" +--- diff --git a/content/daily/index.md b/content/daily/index.md new file mode 100644 index 000000000..e69de29bb diff --git a/content/index.md b/content/index.md index 2bdfd8337..50235961a 100644 --- a/content/index.md +++ b/content/index.md @@ -1,6 +1,14 @@ --- -title: Welcome to Quartz +title: Welcome --- -This is a blank Quartz installation. -See the [documentation](https://quartz.jzhao.xyz) for how to get started. +I haven't prettied it up yet, but plan on using this as a dumping ground for notes and media and such. +The ideal would be then to utilize those for bigger articles on the [main site(?)](https://justin.vc) - we'll see how it goes. + +Before this I was planning on doing some mass exports with a doomscript but I found quartz to be a easier solution, with a bonus that it kind of looks like (which I'm sure it was originally meant for) a host-yourself variant of obsidian publish. + +My workflow idea is: org-roam-daily note -> daily -> notes + +Most of these will be just random things I'm reading, I think. I still need to figure out a good way to do a slip-box. I have a org server extension I can send links to but I forget to do it. Same with pocket (non-open source reasons aside, it has a really nice package for emacs) + +- [Daily Notes](/daily/) diff --git a/content/notes/testing_again.md b/content/notes/testing_again.md new file mode 100644 index 000000000..15f951ad2 --- /dev/null +++ b/content/notes/testing_again.md @@ -0,0 +1,20 @@ +--- +title: "Testing Again" +author: ["Justin"] +date: 2024-06-23T23:57:00-04:00 +lastmod: 2024-06-25T05:35:20-04:00 +tags: ["stub"] +draft: false +--- + +Beep. + +I don't know how I want to handle links under the notes section. +Categories, maybe? + + + +```python +def add(x,y): + return x + y +``` diff --git a/quartz.config.ts b/quartz.config.ts index 7a64acf2d..8a20cf761 100644 --- a/quartz.config.ts +++ b/quartz.config.ts @@ -59,14 +59,18 @@ const config: QuartzConfig = { Plugin.SyntaxHighlighting({ theme: { light: "github-light", - dark: "github-dark", + dark: "dracula", }, keepBackground: false, }), - Plugin.ObsidianFlavoredMarkdown({ enableInHtmlEmbed: false }), + Plugin.OxHugoFlavouredMarkdown(), Plugin.GitHubFlavoredMarkdown(), - Plugin.TableOfContents(), - Plugin.CrawlLinks({ markdownLinkResolution: "shortest" }), + Plugin.TableOfContents({ showByDefault: true, collapseByDefault: false, maxDepth: 5 }), + Plugin.CrawlLinks({ + markdownLinkResolution: "absolute", + openLinksInNewTab: true, + lazyLoad: true, + }), Plugin.Description(), Plugin.Latex({ renderEngine: "katex" }), ], diff --git a/quartz.layout.ts b/quartz.layout.ts index b5a1639eb..ceb7ff628 100644 --- a/quartz.layout.ts +++ b/quartz.layout.ts @@ -26,7 +26,61 @@ export const defaultContentPageLayout: PageLayout = { Component.MobileOnly(Component.Spacer()), Component.Search(), Component.Darkmode(), - Component.DesktopOnly(Component.Explorer()), + Component.DesktopOnly( + Component.Explorer({ + mapFn: (node) => { + // Don't change name of root node + node.displayName = node.displayName.toLowerCase() + if (node.depth > 0) { + // Set emoji for file/folder + if (node.file) { + node.displayName = "📄 " + node.displayName + } else { + node.displayName = "📁 " + node.displayName + } + } + }, + sortFn: (a, b) => { + // Function to check if a file name is in date format (YYYY-MM-DD) + const isDateFormatted = (name: string): boolean => /^\d{4}-\d{2}-\d{2}/.test(name) + + // Extract date from filename if it's date-formatted + const getDate = (name: string): Date | null => { + const match = name.match(/^(\d{4})-(\d{2})-(\d{2})/) + return match + ? new Date(parseInt(match[1]), parseInt(match[2]) - 1, parseInt(match[3])) + : null + } + + // If both items are date-formatted, sort by date in descending order + if (isDateFormatted(a.name) && isDateFormatted(b.name)) { + const dateA = getDate(a.name) + const dateB = getDate(b.name) + if (dateA && dateB) { + return dateB.getTime() - dateA.getTime() + } + } + + // For folders, sort by name in ascending order + if (!a.file && !b.file) { + return a.name.localeCompare(b.name, undefined, { + numeric: true, + sensitivity: "base", + }) + } + + // Files come after folders + if (a.file && !b.file) return 1 + if (!a.file && b.file) return -1 + + // For non-date files, sort by name in ascending order + return a.name.localeCompare(b.name, undefined, { + numeric: true, + sensitivity: "base", + }) + }, + }), + ), ], right: [ Component.Graph(), diff --git a/quartz/components/pages/FolderContent.tsx b/quartz/components/pages/FolderContent.tsx index a13f135f8..d9209f8e4 100644 --- a/quartz/components/pages/FolderContent.tsx +++ b/quartz/components/pages/FolderContent.tsx @@ -31,7 +31,7 @@ export default ((opts?: Partial) => { const folderParts = folderSlug.split(path.posix.sep) const fileParts = fileSlug.split(path.posix.sep) const isDirectChild = fileParts.length === folderParts.length + 1 - return prefixed && isDirectChild + return prefixed }) const cssClasses: string[] = fileData.frontmatter?.cssclasses ?? [] const classes = ["popover-hint", ...cssClasses].join(" ")