Compare commits

...

3 commits

Author SHA1 Message Date
grassblock
35ef2c7a9a feat: add ./ before navbar items 2025-05-01 22:33:13 +08:00
grassblock
fac160dc35 chore: update package info 2025-05-01 21:24:52 +08:00
grassblock
4abfef69d3 feat: change title path appearance 2025-05-01 21:22:57 +08:00
7 changed files with 23 additions and 7 deletions

View file

@ -2,6 +2,7 @@ import { defineConfig } from 'astro/config';
export default defineConfig({ export default defineConfig({
site: 'https://terminal-blog.example.com', site: 'https://terminal-blog.example.com',
base: '/',
trailingSlash: 'ignore', trailingSlash: 'ignore',
build: { build: {
format: 'directory' format: 'directory'

View file

@ -14,5 +14,6 @@
"astro": "^5.2.5", "astro": "^5.2.5",
"@astrojs/rss": "^4.0.1", "@astrojs/rss": "^4.0.1",
"fuse.js": "^7.0.0" "fuse.js": "^7.0.0"
} },
"packageManager": "pnpm@10.7.1+sha512.2d92c86b7928dc8284f53494fb4201f983da65f0fb4f0d40baafa5cf628fa31dae3e5968f12466f17df7e97310e30f343a648baea1b9b350685dafafffdf5808"
} }

4
src/config.ts Normal file
View file

@ -0,0 +1,4 @@
export const siteConfig = {
title: '/var/log/mercury',
description: 'A blog about software development, technology, and life.',
}

View file

@ -2,13 +2,18 @@
import '../styles/global.css'; import '../styles/global.css';
import Search from '../components/Search.astro'; import Search from '../components/Search.astro';
import ThemeSwitcher from '../components/ThemeSwitcher.astro'; import ThemeSwitcher from '../components/ThemeSwitcher.astro';
import { siteConfig } from "../config";
interface Props { interface Props {
title: string; title: string;
path?: string; path?: string;
} }
const { title, path = "~/grassblock/micr0blog" } = Astro.props; const defaultTitle = siteConfig.title
const formattedPath = defaultTitle.toLowerCase().replace(/\s+/g, '-');
const { title, path = formattedPath } = Astro.props;
// TODO: make the path dynamic
--- ---
<!doctype html> <!doctype html>

View file

@ -6,7 +6,7 @@ const posts = await getCollection('blog');
posts.sort((a, b) => new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime()); posts.sort((a, b) => new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime());
--- ---
<Layout title="Blog | Terminal Blog" path="~/grassblock/micr0blog/blog"> <Layout title="Blog | Terminal Blog">
<h1 class="post-title">~/blog</h1> <h1 class="post-title">~/blog</h1>
<div class="post-content"> <div class="post-content">

View file

@ -2,7 +2,7 @@
import Layout from '../layouts/Layout.astro'; import Layout from '../layouts/Layout.astro';
--- ---
<Layout title="Lab | Terminal Blog" path="~/grassblock/micr0blog/lab"> <Layout title="Lab | Terminal Blog" >
<h1 class="post-title">~/lab</h1> <h1 class="post-title">~/lab</h1>
<div class="post-content"> <div class="post-content">

View file

@ -89,6 +89,11 @@ main {
font-size: 1.1rem; font-size: 1.1rem;
} }
.nav a::before {
content: "./";
opacity: 0.7;
}
.cursor { .cursor {
display: inline-block; display: inline-block;
width: 0.6em; width: 0.6em;