Skip to content

Commit

Permalink
displaying better page title
Browse files Browse the repository at this point in the history
  • Loading branch information
Daveed committed Dec 6, 2024
1 parent 867c029 commit 37b6118
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
import { LOCALE, SITE } from "@config";
import { LOCALE, SITE, markketplace } from "@config";
import "@styles/base.css";
import { ViewTransitions } from "astro:transitions";
import { getCollection } from "astro:content";
const googleSiteVerification = import.meta.env.PUBLIC_GOOGLE_SITE_VERIFICATION;
Expand All @@ -21,7 +22,7 @@ const {
title = SITE.title,
author = SITE.author,
profile = SITE.profile,
description = SITE.desc,
description = Astro.props.description ?? SITE.desc,
ogImage = SITE.ogImage,
canonicalURL = new URL(Astro.url.pathname, Astro.site).href,
pubDatetime,
Expand Down Expand Up @@ -49,6 +50,11 @@ const structuredData = {
},
],
};
const stores = await getCollection("stores");
const store = stores.find(
store => store.data.slug == markketplace.STORE_SLUG
)?.data;
---

<!doctype html>
Expand All @@ -64,17 +70,26 @@ const structuredData = {
<meta name="generator" content={Astro.generator} />

<!-- General Meta Tags -->
<title>{title}</title>
<meta name="title" content={title} />
<meta name="description" content={description} />
<title>{store?.title || title}</title>
<meta name="title" content={store?.title || title} />
<meta name="description" content={store?.Description || description} />
<meta name="author" content={author} />
<link rel="sitemap" href="/sitemap-index.xml" />

<!-- Open Graph / Facebook -->
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:url" content={canonicalURL} />
<meta property="og:image" content={socialImageURL} />
<meta
property="og:title"
content={store?.SEO?.metaTitle || store?.title || title}
/>
<meta
property="og:description"
content={store?.SEO?.metaDescription || store?.Description || description}
/>
<meta property="og:url" content={store?.SEO?.metaUrl || canonicalURL} />
<meta
property="og:image"
content={store?.SEO?.socialImage?.url || socialImageURL}
/>

<!-- Article Published/Modified time -->
{
Expand Down

0 comments on commit 37b6118

Please sign in to comment.