From d86ca09aa610e9a49f1f443279d2bbe90c8b887f Mon Sep 17 00:00:00 2001 From: Ben C Date: Mon, 19 Jan 2026 14:58:34 +0000 Subject: [PATCH] Blog style changes --- astro.config.mjs | 5 +++++ src/components/blog/CowSay.astro | 2 -- src/content/posts/wip_screen_captures.md | 64 +++++++++++++++++++++++++++++++++++++--------------------------- src/pages/blog/[...slug].astro | 19 +++++++------------ src/pages/blog/index.astro | 8 ++++++-- src/pages/index.astro | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------- 6 file(s) changed, 130 insertion(s)(+), 117 deletion(s)(-) diff --git a/astro.config.mjs b/astro.config.mjs --- a/astro.config.mjs +++ b/astro.config.mjs @@ -10,6 +10,11 @@ export default defineConfig({ site: "https://bwc9876.dev", compressHTML: true, integrations: [mdx(), icon(), sitemap(), playformInline()], + markdown: { + shikiConfig: { + theme: "catppuccin-mocha", + }, + }, vite: { css: { transformer: "lightningcss", diff --git a/src/components/blog/CowSay.astro b/src/components/blog/CowSay.astro --- a/src/components/blog/CowSay.astro +++ b/src/components/blog/CowSay.astro @@ -21,11 +21,9 @@ } pre.warn { color: yellow; - background-color: rgb(25, 25, 0); } pre.info { color: cyan; - background-color: rgb(0, 25, 25); } diff --git a/src/content/posts/wip_screen_captures.md b/src/content/posts/wip_screen_captures.md --- a/src/content/posts/wip_screen_captures.md +++ b/src/content/posts/wip_screen_captures.md @@ -34,20 +34,24 @@ To install grimblast, all I have to do is add it to my `environment.systemPackages`: ```nix -environment.systemPackages = with pkgs; [ - # ... - grimblast - libnotify # For notifications - xdg-utils # For opening files - # ... -]; +{ + environment.systemPackages = with pkgs; [ + # ... + grimblast + libnotify # For notifications + xdg-utils # For opening files + # ... + ]; +} ``` Grimblast will automatically save screenshots to `XDG_SCREENSHOTS_DIR`, I manually set this in my _home manager_ config with: ```nix -xdg.userDirs.extraConfig.XDG_SCREENSHOTS_DIR = "${config.home.homeDirectory}/Pictures/Screenshots"; +{ + xdg.userDirs.extraConfig.XDG_SCREENSHOTS_DIR = "${config.home.homeDirectory}/Pictures/Screenshots"; +} ``` Grimblast will name the screenshots with the current date and time, which works for me. @@ -141,12 +145,14 @@ In home manager I simply have to add these strings to my Hyprland binds ```nix -wayland.windowManager.hyprland.settings.bind = [ - # ... - ",Print,exec,nu ${../res/screenshot.nu}" - "SUPER SHIFT,S,exec,nu ${../res/screenshot.nu}" - # ... -]; +{ + wayland.windowManager.hyprland.settings.bind = [ + # ... + ",Print,exec,nu ${../res/screenshot.nu}" + "SUPER SHIFT,S,exec,nu ${../res/screenshot.nu}" + # ... + ]; +} ``` Now by switching to my new config (and making sure to stage `screenshot.nu` of course), I can take @@ -162,14 +168,16 @@ For the actual screen recording I'll be using [wf-recorder](https://github.com/ammen99/wf-recorder). ```nix -environment.systemPackages = with pkgs; [ - # ... - wf-recorder - libnotify # For notifications - xdg-utils # For opening files - slurp # Will explain this later - # ... -]; +{ + environment.systemPackages = with pkgs; [ + # ... + wf-recorder + libnotify # For notifications + xdg-utils # For opening files + slurp # Will explain this later + # ... + ]; +} ``` First and foremost location, I chose to use `~/Videos/Captures` for my recordings. I didn't set an @@ -267,11 +275,13 @@ `SIGINT` to it to make it stop recording, meaning our script will continue and show the notification. ```nix -wayland.windowManager.hyprland.settings.bindr = [ - # ... - "SUPER SHIFT,R,exec,pkill wf-recorder --signal SIGINT || nu ${../res/screenrec.nu}" - # ... -]; +{ + wayland.windowManager.hyprland.settings.bindr = [ + # ... + "SUPER SHIFT,R,exec,pkill wf-recorder --signal SIGINT || nu ${../res/screenrec.nu}" + # ... + ]; +} ``` `pkill` here will exit with code `1` if it doesn't find any processes to kill, so the `||` will run diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro --- a/src/pages/blog/[...slug].astro +++ b/src/pages/blog/[...slug].astro @@ -16,9 +16,9 @@ ---

{entry.data.title}

-
+
@@ -72,26 +72,21 @@ } diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro --- a/src/pages/blog/index.astro +++ b/src/pages/blog/index.astro @@ -15,8 +15,7 @@ }; --- -

The Cowsay - Ben C's Blog

-

Here you'll find my blog posts, most recent first.

+

The Cowsay - Ben C's Blog

{ blogEntries.map((p) => (
@@ -35,6 +34,11 @@ + .view-more a { + width: 100%; + text-align: center; + font-weight: bold; + } + + -- tangled.sh