Commit 160293f
Changed files (4)
src
src/layouts/GlobalLayout.astro
@@ -1,11 +1,12 @@
---
import "@/styles/global.css";
+import { SITE_CONFIG } from "@/config";
interface Props {
- title: string;
+ title?: string;
}
-const { title } = Astro.props;
+const { title = SITE_CONFIG.title } = Astro.props;
---
<html lang="en">
src/pages/index.astro
@@ -1,7 +1,8 @@
---
+import { SITE_CONFIG } from "@/config";
import GlobalLayout from "@/layouts/GlobalLayout.astro";
---
-<GlobalLayout title="Astro">
- <h1>Astro</h1>
+<GlobalLayout>
+ <h1>{SITE_CONFIG.title}</h1>
</GlobalLayout>
src/types/config.d.ts
@@ -0,0 +1,6 @@
+export type SiteConfig = {
+ /**
+ * Title of your website.
+ */
+ title: string;
+};
src/config.ts
@@ -0,0 +1,5 @@
+import type { SiteConfig } from "@/types/config.d.ts";
+
+export const SITE_CONFIG: SiteConfig = {
+ title: "Tybios",
+};