From d71535eeba45a3855239a90413de9b89786c2898 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 29 Jun 2022 23:16:53 +0100 Subject: [PATCH] feat: add `uses` page --- src/composables/prefetch.ts | 21 +++++++++++++++------ src/content/uses.md | 26 ++++++++++++++++++++++++++ src/pages/uses.vue | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 src/content/uses.md create mode 100644 src/pages/uses.vue diff --git a/src/composables/prefetch.ts b/src/composables/prefetch.ts index e717bdd6..b6743a64 100644 --- a/src/composables/prefetch.ts +++ b/src/composables/prefetch.ts @@ -1,3 +1,6 @@ +const normalizeVercelResponse = async (r: unknown) => + process.client && r instanceof Blob ? JSON.parse(await r.text()) : r + export const usePageData = (path = useRoute().path) => { switch (path) { case '/': @@ -8,6 +11,8 @@ export const usePageData = (path = useRoute().path) => { return useAsyncTalks() case '/blog': return useAsyncBlogIndex() + case '/uses': + return useAsyncUses() default: return useAsyncBlogArticle(path) } @@ -18,9 +23,15 @@ const useAsyncHome = () => queryContent('/') .only(['title', 'type', 'body']) .findOne() - .then(async r => - process.client && r instanceof Blob ? JSON.parse(await r.text()) : r - ) + .then(normalizeVercelResponse) + ) + +const useAsyncUses = () => + useAsyncData('uses', () => + queryContent('/uses') + .only(['title', 'type', 'body']) + .findOne() + .then(normalizeVercelResponse) ) const useAsyncBlogIndex = () => @@ -84,7 +95,5 @@ const useAsyncBlogArticle = (path: string) => queryContent(path) .only(['title', 'type', 'body', 'date', 'tags']) .findOne() - .then(async r => - process.client && r instanceof Blob ? JSON.parse(await r.text()) : r - ) + .then(normalizeVercelResponse) ) diff --git a/src/content/uses.md b/src/content/uses.md new file mode 100644 index 00000000..a13d5e4d --- /dev/null +++ b/src/content/uses.md @@ -0,0 +1,26 @@ +## Editor + +- [Visual Studio Code](https://code.visualstudio.com/) with [minimal settings](https://gist.github.com/danielroe/5ea82608dc680fe6c0179240803437ab). +- Font: [Dank Mono](https://dank.sh/). +- Theme: [Palenight Operator](https://marketplace.visualstudio.com/items?itemName=whizkydee.material-palenight-theme) and [Tomorrow Operator Mono](https://marketplace.visualstudio.com/items?itemName=chiragpat.tomorrow-and-tomorrow-night-operator-mono-theme). +- Icons: [City Lights](https://marketplace.visualstudio.com/items?itemName=Yummygum.city-lights-icon-vsc) and [Carbon Icons](https://github.com/antfu/vscode-icons-carbon). + +## Terminal + +- [Alacritty](https://alacritty.org/) terminal emulator, running with [Starship prompt](https://starship.rs/) on [zsh](https://www.zsh.org/). +- Font: [MesloLGS Nerd Font](https://www.nerdfonts.com/). +- Cool tools: [exa](https://the.exa.website/), [difft](https://difftastic.wilfred.me.uk/). + +## Desktop apps + +- [Firefox Developer Edition] with Alpenglow theme. +- Window management: [Rectangle](https://rectangleapp.com/). +- App hotkeys: [Snap](https://apps.apple.com/us/app/snap/id418073146?mt=12). +- Launcher: [Raycast](https://www.raycast.com/). + +## Hardware + +- MacBook Air 13" M1 +- Microphone: Rode NT-USB +- Camera: Sony Alpha ZV-E10 with Sigma 16 mm lens, running to an Elgato Cam Link +- Headphones: Bose NC 700 diff --git a/src/pages/uses.vue b/src/pages/uses.vue new file mode 100644 index 00000000..73b4db81 --- /dev/null +++ b/src/pages/uses.vue @@ -0,0 +1,37 @@ + + + + + -- knotmirror 0.0.1