feat: custom navbar items and footer

This commit is contained in:
grassblock 2025-05-13 21:28:08 +08:00
parent 41e1a4abee
commit 2c7b0edaf7
2 changed files with 14 additions and 1 deletions

View file

@ -1,6 +1,14 @@
export const siteConfig = { export const siteConfig = {
title: '/var/log/mercury', title: '/var/log/mercury',
description: 'A blog about software development, technology, and life.', description: 'A blog about software development, technology, and life.',
navBarItems: [
// additional items in the navbar
// the order of the items will be the same as the order in the array
// format is { text: string, link: string }
{ text: "RSS", link: "/rss.xml" },
{ text: "GitHub", link: "https://github.com/GrassBlock1/mercury" },
],
customFooter: '<i>I have no mouth, and I must SCREAM</i>',
comments: { comments: {
type: 'fediverse', // 'artalk','giscus','fediverse','hatsu' type: 'fediverse', // 'artalk','giscus','fediverse','hatsu'
artalk: { artalk: {

View file

@ -13,6 +13,9 @@ interface Props {
const defaultTitle = siteConfig.title const defaultTitle = siteConfig.title
const formattedPath = defaultTitle.toLowerCase().replace(/\s+/g, '-'); const formattedPath = defaultTitle.toLowerCase().replace(/\s+/g, '-');
const navBarItems = siteConfig.navBarItems
const customFooter = siteConfig.customFooter
const { title, path = formattedPath } = Astro.props; const { title, path = formattedPath } = Astro.props;
// TODO: make the path dynamic // TODO: make the path dynamic
--- ---
@ -36,6 +39,7 @@ const { title, path = formattedPath } = Astro.props;
<nav class="nav"> <nav class="nav">
<a href="/">Home</a> <a href="/">Home</a>
<a href="/blog">Blog</a> <a href="/blog">Blog</a>
{navBarItems.map((item) => <a href={item.link}>{item.text}</a>)}
</nav> </nav>
<Search /> <Search />
@ -52,7 +56,8 @@ const { title, path = formattedPath } = Astro.props;
<ThemeSwitcher/> <ThemeSwitcher/>
</div> </div>
<div class="container"> <div class="container">
Powered by <a href="https://git.gb0.dev/gb/mercury"><img src="/mercury.svg" width="16px" alt="mercury logo" /> mercury</a> <Fragment set:html={customFooter} />
<p>Powered by <a href="https://git.gb0.dev/gb/mercury"><img src="/mercury.svg" width="16px" alt="mercury logo" /> mercury</a></p>
</div> </div>
</footer> </footer>
</body> </body>