From 79b31df1364c52573d0733e00acfa95de89b1fcd Mon Sep 17 00:00:00 2001 From: Branimir Georgiev Date: Sun, 26 Apr 2026 15:08:18 +0300 Subject: [PATCH 1/2] fix: address P1 and P2 issues from code review - Remove set:html XSS risk in Footer (#208) - Fix hardcoded JSON-LD URLs to use Astro.site (#209) - Fix dark mode link contrast for WCAG AAA (#210) - Remove unused search box CSS (#211) Co-Authored-By: Claude Opus 4.6 (1M context) --- astro-site/src/components/Footer.astro | 2 +- astro-site/src/pages/[...slug].astro | 2 +- astro-site/src/pages/index.astro | 2 +- astro-site/src/styles/global.css | 42 ++------------------------ 4 files changed, 5 insertions(+), 43 deletions(-) diff --git a/astro-site/src/components/Footer.astro b/astro-site/src/components/Footer.astro index 714873d..b83758f 100644 --- a/astro-site/src/components/Footer.astro +++ b/astro-site/src/components/Footer.astro @@ -3,5 +3,5 @@ import site from "../data/site.json"; ---
- + {site.copyright}
diff --git a/astro-site/src/pages/[...slug].astro b/astro-site/src/pages/[...slug].astro index f38997b..6a7593d 100644 --- a/astro-site/src/pages/[...slug].astro +++ b/astro-site/src/pages/[...slug].astro @@ -37,7 +37,7 @@ const jsonLd = { "isPartOf": { "@type": "Course", "name": "Git Tutorial — Code with Branko", - "url": "https://braboj.github.io/tutorial-git/" + "url": new URL(import.meta.env.BASE_URL, import.meta.env.SITE).toString() } }; --- diff --git a/astro-site/src/pages/index.astro b/astro-site/src/pages/index.astro index 17c0ec8..00c19db 100644 --- a/astro-site/src/pages/index.astro +++ b/astro-site/src/pages/index.astro @@ -16,7 +16,7 @@ const jsonLd = { "@type": "Course", "name": "Git Tutorial — Code with Branko", "description": "A hands-on Git tutorial from first commit to confident daily use — concepts, exercises, and real-world examples.", - "url": "https://braboj.github.io/tutorial-git/", + "url": new URL(import.meta.env.BASE_URL, import.meta.env.SITE).toString(), "provider": { "@type": "Person", "name": "Branimir Georgiev", diff --git a/astro-site/src/styles/global.css b/astro-site/src/styles/global.css index 402cdb8..38c59f6 100644 --- a/astro-site/src/styles/global.css +++ b/astro-site/src/styles/global.css @@ -55,8 +55,8 @@ --color-fg-muted: #aaaaaa; --color-fg-faint: #888888; --color-border: #ffffff1f; - --color-link: #4dd0e1; - --color-focus: #4dd0e1; + --color-link: #00bcd4; + --color-focus: #00bcd4; --color-code-bg: #2a2a2a; --color-code-fg: #e0e0e0; } @@ -169,44 +169,6 @@ a:hover { gap: var(--space-sm); } -/* Search box */ -.search-box { - position: relative; - display: flex; - align-items: center; -} - -.search-icon { - position: absolute; - left: 0.5rem; - color: #fff; - opacity: 0.7; - pointer-events: none; -} - -.search-box input { - background: rgba(255, 255, 255, 0.15); - border: none; - border-radius: 3px; - color: #fff; - font-family: var(--font-text); - font-size: var(--font-size-sm); - padding: 0.35rem 0.5rem 0.35rem 2rem; - width: 10rem; - transition: background 0.2s, width 0.2s; -} - -.search-box input::placeholder { - color: rgba(255, 255, 255, 0.7); -} - -.search-box input:focus-visible { - background: rgba(255, 255, 255, 0.25); - width: 14rem; - outline: 2px solid #fff; - outline-offset: 1px; -} - /* Theme toggle */ .theme-toggle { background: none; From aec4a47568c42ba3d4b3b547079dbcf05a0a58a4 Mon Sep 17 00:00:00 2001 From: Branimir Georgiev Date: Sun, 26 Apr 2026 15:09:44 +0300 Subject: [PATCH 2/2] feat: add custom 404 page Branded error page with header, footer, and link back to tutorial home. Includes noindex meta tag and dark mode support. Closes #212 Co-Authored-By: Claude Opus 4.6 (1M context) --- astro-site/src/pages/404.astro | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 astro-site/src/pages/404.astro diff --git a/astro-site/src/pages/404.astro b/astro-site/src/pages/404.astro new file mode 100644 index 0000000..5483ea9 --- /dev/null +++ b/astro-site/src/pages/404.astro @@ -0,0 +1,35 @@ +--- +import "../styles/global.css"; +import Header from "../components/Header.astro"; +import Footer from "../components/Footer.astro"; +import site from "../data/site.json"; + +const base = import.meta.env.BASE_URL; +--- + + + + + + + Page Not Found — {site.title} + + + + +
+
+

404 — Page Not Found

+

+ The page you're looking for doesn't exist or has been moved. +

+ Back to the tutorial +
+