diff --git a/src/components/helper/head/Meta.astro b/src/components/helper/head/Meta.astro new file mode 100644 index 0000000..771fcb4 --- /dev/null +++ b/src/components/helper/head/Meta.astro @@ -0,0 +1,21 @@ +--- +const { title, description, ogImage = "" } = Astro.props + +const canonicalURL = new URL(Astro.url.pathname, Astro.site); +--- + + +{/* Open Graph / Facebook */} + + +{ogImage && } + + + +{/* Twitter */} + + + +{ogImage && } + + diff --git a/src/config.ts b/src/config.ts index 81372d1..8239181 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,6 +1,19 @@ export const siteConfig = { + // site meta info title: '/var/log/mercury', description: 'A blog about software development, technology, and life.', + homepageOgImage: '', + // site components + 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" }, + ], + // footer + // yes you can write html safely here + customFooter: 'I have no mouth, and I must SCREAM', comments: { type: 'fediverse', // 'artalk','giscus','fediverse','hatsu' artalk: { diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 8da33c4..cc88648 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -4,16 +4,21 @@ import Search from '../components/Search.astro'; import ThemeSwitcher from '../components/ThemeSwitcher.astro'; import BackToTop from "../components/BackToTop.astro"; import { siteConfig } from "../config"; +import Meta from "../components/helper/head/Meta.astro"; interface Props { title: string; + description: string; path?: string; } const defaultTitle = siteConfig.title const formattedPath = defaultTitle.toLowerCase().replace(/\s+/g, '-'); -const { title, path = formattedPath } = Astro.props; +const navBarItems = siteConfig.navBarItems +const customFooter = siteConfig.customFooter + +const { title, path = formattedPath, description = siteConfig.description } = Astro.props; // TODO: make the path dynamic --- @@ -24,6 +29,7 @@ const { title, path = formattedPath } = Astro.props; +