website

Personal website
git clone https://github.com/michaelneuper/website.git
README | Files | Log | Refs

commit 4d6a4ae97fdbc7c61e3e20b119ed7d619825d42a
parent b83023eb74830c9b640c92eac38068340fdd8f58
Author: Michael Neuper <michael@michaelneuper.com>
Date:   Tue, 20 Oct 2026 21:32:32 +0200

remove doom- prefix

Diffstat:
Msrc/components/frame/Modeline.astro | 6++++--
Msrc/components/home/Posts.astro | 2+-
Msrc/layouts/Base.astro | 10++++++----
Msrc/scripts/emacs/modeline.js | 7++++---
Msrc/scripts/themes.js | 14+++++++-------
Msrc/styles/themes.css | 14+++++++-------
6 files changed, 29 insertions(+), 24 deletions(-)

diff --git a/src/components/frame/Modeline.astro b/src/components/frame/Modeline.astro @@ -7,11 +7,13 @@ interface Props { /** Buffer name and major mode until a section scrolls into view. */ buf: string; mode: string; + /** The back-to-top button. The home page leaves it out; gg still works there. */ + toTop?: boolean; } -const { buf, mode } = Astro.props; +const { buf, mode, toTop = true } = Astro.props; --- -<button class="btn to-top" type="button" title="Back to the top (gg)" hidden>back to top</button> +{toTop && <button class="btn to-top" type="button" title="Back to the top (gg)" hidden>back to top</button>} <div class="which-key" hidden aria-live="polite"></div> <div class="frame-bottom"> <div class="modeline"> diff --git a/src/components/home/Posts.astro b/src/components/home/Posts.astro @@ -10,7 +10,7 @@ const posts = await publishedPosts(); --- <Buffer id="posts" file="posts.org" mode="Org" metaAttrs={{ "data-org": "meta" }}> <h2 class="h2">Posts</h2> - <p class="org-p">From my blog at michaelneuper.com, shown the way I read them. <kbd>TAB</kbd> on a heading folds it, <kbd>S-TAB</kbd> cycles the whole buffer, and clicking a heading’s stars does the same.</p> + <p class="org-p">I write about Linux, Emacs and Org mode, security, and a little maths. The list below is an Org buffer: <kbd>TAB</kbd> folds the heading you’re on, <kbd>S-TAB</kbd> cycles the whole list from folded to open, and clicking a heading’s stars folds that heading.</p> {/* data-tags are space separated; each tag gets its colour from TAG_COLORS in src/scripts/tags.js. */} <ol class="posts"> diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro @@ -32,7 +32,7 @@ const { } = Astro.props; --- <!doctype html> -<html lang="en" data-theme="doom-gruvbox"> +<html lang="en" data-theme="gruvbox"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"> @@ -47,8 +47,10 @@ const { // Pick the theme before first paint so there is no flash. Keep this list in sync with src/scripts/themes.js. try { var t = localStorage.getItem("theme"); - var known = /^(doom-gruvbox|doom-gruvbox-light|doom-one|atom-one-dark|modus-vivendi|modus-operandi|doom-dracula|doom-nord|catppuccin|doom-tokyo-night|doom-solarized-light)$/; - if (!known.test(t || "")) t = matchMedia("(prefers-color-scheme: light)").matches ? "doom-gruvbox-light" : ""; + // Themes saved before the doom- prefix was dropped (all but doom-one). + if (t && t !== "doom-one") t = t.replace(/^doom-/, ""); + var known = /^(gruvbox|gruvbox-light|doom-one|atom-one-dark|modus-vivendi|modus-operandi|dracula|nord|catppuccin|tokyo-night|solarized-light)$/; + if (!known.test(t || "")) t = matchMedia("(prefers-color-scheme: light)").matches ? "gruvbox-light" : ""; if (t) document.documentElement.dataset.theme = t; } catch (e) {} </script> @@ -60,7 +62,7 @@ const { <a class="skip" href={skip}>Skip to content</a> <TopBar home={home} /> <slot /> -<Modeline buf={buf} mode={mode} /> +<Modeline buf={buf} mode={mode} toTop={!home} /> <Help><slot name="help" /></Help> </body> </html> diff --git a/src/scripts/emacs/modeline.js b/src/scripts/emacs/modeline.js @@ -27,9 +27,10 @@ document.addEventListener("focusin", evilState); document.addEventListener("focusout", () => setTimeout(evilState)); document.addEventListener("selectionchange", evilState); -// back to top, once the reader is a screen down; gg does the same +// back to top, once the reader is a screen down; gg does the same. The home +// page has no button. const toTop = $(".to-top"); -toTop.addEventListener("click", () => { +toTop?.addEventListener("click", () => { scrollTo({ top: 0, behavior: reducedMotion.matches ? "instant" : "smooth" }); // the button hides at the top, so focus goes to the first link on the page $(".brand")?.focus({ preventScroll: true }); @@ -41,7 +42,7 @@ function onScroll() { ml.pct.textContent = y <= 2 ? "Top" : y >= max - 2 ? "Bot" : `${Math.round((y / max) * 100)}%`; ml.pos.textContent = `${Math.floor(y / 21) + 1}:0`; root.classList.toggle("is-scrolled", y > 24); - toTop.hidden = y < innerHeight; + if (toTop) toTop.hidden = y < innerHeight; } addEventListener("scroll", onScroll, { passive: true }); onScroll(); diff --git a/src/scripts/themes.js b/src/scripts/themes.js @@ -3,17 +3,17 @@ // src/layouts/Base.astro in sync. export const THEMES = [ - { id: "doom-gruvbox", desc: "Gruvbox, medium contrast. The theme my own Emacs uses" }, - { id: "doom-gruvbox-light", desc: "Gruvbox's light variant" }, + { id: "gruvbox", desc: "Gruvbox, medium contrast. The theme my own Emacs uses" }, + { id: "gruvbox-light", desc: "Gruvbox's light variant" }, { id: "doom-one", desc: "Doom Emacs's default, inspired by Atom One Dark" }, { id: "atom-one-dark", desc: "Atom's One Dark" }, { id: "modus-vivendi", desc: "Emacs's built-in high-contrast dark theme" }, { id: "modus-operandi", desc: "Emacs's built-in high-contrast light theme" }, - { id: "doom-dracula", desc: "Dracula" }, - { id: "doom-nord", desc: "Nord, arctic and north-bluish" }, + { id: "dracula", desc: "Dracula" }, + { id: "nord", desc: "Nord, arctic and north-bluish" }, { id: "catppuccin", desc: "Catppuccin, Mocha flavour" }, - { id: "doom-tokyo-night", desc: "Tokyo Night" }, - { id: "doom-solarized-light", desc: "Solarized light" }, + { id: "tokyo-night", desc: "Tokyo Night" }, + { id: "solarized-light", desc: "Solarized light" }, ]; -export const DEFAULT_THEME = "doom-gruvbox"; +export const DEFAULT_THEME = "gruvbox"; diff --git a/src/styles/themes.css b/src/styles/themes.css @@ -45,7 +45,7 @@ --c-sec: var(--red); } -:root[data-theme="doom-gruvbox-light"] { +:root[data-theme="gruvbox-light"] { color-scheme: light; --bg: #fbf1c7; --bg-alt: #ebdbb2; --fg: #3c3836; --red: #9d0006; --orange: #af3a03; --yellow: #b57614; --green: #79740e; @@ -84,14 +84,14 @@ --glow: 0; } -:root[data-theme="doom-dracula"] { +:root[data-theme="dracula"] { --bg: #282a36; --bg-alt: #1e2029; --fg: #f8f8f2; --red: #ff5555; --orange: #ffb86c; --yellow: #f1fa8c; --green: #50fa7b; --cyan: #8be9fd; --blue: #61bfff; --magenta: #ff79c6; --dim-mix: 64%; } -:root[data-theme="doom-nord"] { +:root[data-theme="nord"] { --bg: #2e3440; --bg-alt: #3b4252; --fg: #eceff4; --red: #bf616a; --orange: #d08770; --yellow: #ebcb8b; --green: #a3be8c; --cyan: #88c0d0; --blue: #81a1c1; --magenta: #b48ead; @@ -105,7 +105,7 @@ --dim-mix: 68%; } -:root[data-theme="doom-tokyo-night"] { +:root[data-theme="tokyo-night"] { --bg: #1a1b26; --bg-alt: #16161e; --fg: #c0caf5; --red: #f7768e; --orange: #ff9e64; --yellow: #e0af68; --green: #9ece6a; --cyan: #7dcfff; --blue: #7aa2f7; --magenta: #bb9af7; @@ -115,7 +115,7 @@ /* doom's foreground, #556b72, is only 5.2:1 on this cream, which leaves no room for a lighter --dim that still reads. So the text is darkened a fifth towards base03 (#002b36), and --dim lands about where the old text colour was. */ -:root[data-theme="doom-solarized-light"] { +:root[data-theme="solarized-light"] { color-scheme: light; --bg: #fdf6e3; --bg-alt: #eee8d5; --fg: #445e66; --red: #dc322f; --orange: #cb4b16; --yellow: #b58900; --green: #859900; @@ -126,11 +126,11 @@ /* gruvbox's blue is a grey-green beside its yellow, purple and red, so the software colour pulls it towards blue, keeping a little of its own tone */ -:root[data-theme="doom-gruvbox"] { +:root[data-theme="gruvbox"] { --c-sw: color-mix(in oklch, var(--blue) 20%, oklch(0.7 0.11 242)); } -:root[data-theme="doom-gruvbox-light"] { +:root[data-theme="gruvbox-light"] { --c-sw: color-mix(in oklch, var(--blue) 40%, oklch(0.47 0.11 245)); }