diff --git a/astro.config.mjs b/astro.config.mjs
index 87c4c0f..dde729c 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -6,5 +6,14 @@ import preact from "@astrojs/preact";
// https://astro.build/config
export default defineConfig({
site: "https://blog.n-daisuke897.com/",
- integrations: [preact()]
+ integrations: [preact()],
+ markdown: {
+ shikiConfig: {
+ themes: {
+ light: 'github-light',
+ dark: 'github-dark',
+ },
+ wrap: true,
+ },
+ },
});
\ No newline at end of file
diff --git a/src/components/BlogPost.astro b/src/components/BlogPost.astro
index e10aa0b..32cfb32 100644
--- a/src/components/BlogPost.astro
+++ b/src/components/BlogPost.astro
@@ -12,11 +12,19 @@ const { title, url, datetime } = Astro.props;
font-size: 14px;
color: #666;
}
+ :global(.dark) .new-article-date {
+ color: #94a3b8;
+ }
.new-article-title {
font-size: 18px;
font-weight: bold;
- color: #333f;
+ color: var(--text-color);
+ text-decoration: none;
}
+ .new-article-title:hover {
+ text-decoration: underline;
+ }
+ /* Removed specific dark mode color to inherit var(--text-color) */
{datetime}
diff --git a/src/components/Header.astro b/src/components/Header.astro
index b058c25..bd43431 100644
--- a/src/components/Header.astro
+++ b/src/components/Header.astro
@@ -9,3 +9,11 @@ import Navigation from "./Navigation.astro";
+
+
diff --git a/src/components/Navigation.astro b/src/components/Navigation.astro
index 67284b2..fe72b60 100644
--- a/src/components/Navigation.astro
+++ b/src/components/Navigation.astro
@@ -1,8 +1,9 @@
---
-
+import ThemeIcon from "./ThemeIcon.astro";
---
+
Home
About
Articles
diff --git a/src/components/ThemeIcon.astro b/src/components/ThemeIcon.astro
new file mode 100644
index 0000000..de9258b
--- /dev/null
+++ b/src/components/ThemeIcon.astro
@@ -0,0 +1,36 @@
+---
+---
+
+
+
+
+
\ No newline at end of file
diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro
index 3e068d8..0837182 100644
--- a/src/layouts/BaseLayout.astro
+++ b/src/layouts/BaseLayout.astro
@@ -12,6 +12,22 @@ const { pageTitle } = Astro.props;
{pageTitle + " | Naputo"}
+
diff --git a/src/layouts/MarkdownPostLayout.astro b/src/layouts/MarkdownPostLayout.astro
index b236a24..280e17b 100644
--- a/src/layouts/MarkdownPostLayout.astro
+++ b/src/layouts/MarkdownPostLayout.astro
@@ -30,7 +30,11 @@ const optionsForDate = {
-
-
- {
- sortedPosts.slice(0, 5).map((post: any) => (
-
- ))
- }
-
+
+
+ {
+ sortedPosts.slice(0, 5).map((post: any) => (
+
+ ))
+ }
+
-
+
diff --git a/src/pages/tags/index.astro b/src/pages/tags/index.astro
index 7d91fa3..61f315b 100644
--- a/src/pages/tags/index.astro
+++ b/src/pages/tags/index.astro
@@ -20,7 +20,7 @@ const pageTitle = "Tag List";
diff --git a/src/styles/global.css b/src/styles/global.css
index 0ebece4..c94e447 100644
--- a/src/styles/global.css
+++ b/src/styles/global.css
@@ -1,5 +1,19 @@
+/* Dark Mode support */
+:root {
+ --bg-color: #f1f5f9;
+ --text-color: #333333;
+ --nav-hover: #e0e0e0;
+}
+
+html.dark {
+ --bg-color: #0f172a;
+ --text-color: #f8fafc;
+ --nav-hover: #1e293b;
+}
+
html {
- background-color: #f1f5f9;
+ background-color: var(--bg-color);
+ color: var(--text-color);
font-family: sans-serif;
}
@@ -21,6 +35,14 @@ h1 {
}
/* nav styles */
+a {
+ color: #3b82f6; /* Blue 500 - vivid but readable on light */
+}
+
+html.dark a {
+ color: #60a5fa; /* Blue 400 - lighter and softer for dark mode */
+}
+
.hamburger {
padding-right: 20px;
cursor: pointer;
@@ -31,17 +53,22 @@ h1 {
width: 32px;
height: 4px;
margin-bottom: 8px;
- background-color: #333333;
+ background-color: var(--text-color);
}
.nav-links {
width: 100%;
- display: flex;
+ display: none;
justify-content: center;
align-items: center;
margin: 0;
}
+.nav-links.expanded {
+ display: flex;
+ flex-direction: column;
+}
+
.nav-links a {
display: block;
text-align: center;
@@ -51,12 +78,12 @@ h1 {
font-weight: bold;
text-transform: uppercase;
border-radius: 4px;
- color: #333333;
+ color: var(--text-color);
}
.nav-links a:hover,
.nav-links a:focus {
- background-color: #e0e0e0;
+ background-color: var(--nav-hover);
}
.nav-links img {
@@ -66,14 +93,16 @@ h1 {
display: inline-block;
}
-.expanded {
- display: unset;
+html.dark .nav-links img {
+ filter: invert(1) hue-rotate(180deg);
}
+/* .expanded removed as it is handled by .nav-links.expanded */
+
@media screen and (min-width: 636px) {
.nav-links {
margin-left: 5em;
- display: block;
+ display: flex;
position: static;
width: auto;
background: none;
@@ -94,3 +123,14 @@ pre,
code {
font-family: "JetBrains Mono", "Fira Code", "Menlo", "Consolas", monospace;
}
+
+pre {
+ padding: 1rem;
+ border-radius: 0.5rem;
+ overflow-x: auto;
+}
+
+html.dark pre {
+ background-color: #1e293b !important;
+}
+