Skip to content

Commit

Permalink
fix: tweak of metadata flow
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseKoldewijn committed Aug 24, 2023
1 parent 083a6b7 commit 54d3cdf
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
13 changes: 11 additions & 2 deletions src/config/app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
export const appConfig = {
branding: {
name: "Modernized RCC",
meta: {
title: {
branding: "Modernized RCC",
separator: " | ",
specific: {},
},
desc: {
default:
"Modernized RCC - A modernized React.js Class Components based website using Astro.js to attach all components together.",
specific: {},
},
},
};
17 changes: 15 additions & 2 deletions src/layouts/globalLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,28 @@ import "@/styles/tailwind.css";
import { appConfig } from "@/config/app";
const { title } = Astro.props;
const pageSpecificDesc = Object.entries(appConfig.meta.desc.specific).find(
(entry) => entry[0] == title,
);
---

<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<title>{title} | {appConfig.branding.name}</title>
<title>
{title ? title + appConfig.meta.title.separator : ""}{
appConfig.meta.title.branding
}
</title>
<meta
name="description"
content={pageSpecificDesc
? String(pageSpecificDesc[1])
: appConfig.meta.desc.default}
/>
</head>
<body>
<main class="inset-0 min-h-screen" data-elementID-globalRoot>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const demoMessage = {
const demoMessages = Array.from({ length: 20 }, () => demoMessage);
---

<GlobalLayout title="Home">
<GlobalLayout>
<div
class="flex h-full min-h-screen flex-col items-center justify-center gap-4 overflow-y-auto px-4 py-8"
>
Expand Down

0 comments on commit 54d3cdf

Please sign in to comment.