From 19b4a25012ba9033ab9faa5ae1b6feb1f2d4cd65 Mon Sep 17 00:00:00 2001 From: prototypa Date: Sun, 28 Aug 2022 20:31:06 -0400 Subject: [PATCH] Add variables to config and minimal refactor --- src/components/core/MetaTags.astro | 6 ++++-- src/config.mjs | 7 +++++-- src/layouts/BaseLayout.astro | 5 +++-- src/layouts/PageLayout.astro | 4 +++- src/pages/404.astro | 4 +--- src/pages/blog/[...page].astro | 9 +++------ src/pages/blog/[slug].astro | 4 +--- src/pages/index.astro | 25 +++++++++++-------------- src/pages/rss.xml.js | 4 ++-- 9 files changed, 33 insertions(+), 35 deletions(-) diff --git a/src/components/core/MetaTags.astro b/src/components/core/MetaTags.astro index 6a13c49..6c58a57 100644 --- a/src/components/core/MetaTags.astro +++ b/src/components/core/MetaTags.astro @@ -2,6 +2,8 @@ import { getImage } from "@astrojs/image"; import { getRelativeUrlByFilePath } from "~/utils/getRelativeUrlByFilePath"; +import { SITE } from "~/config.mjs"; + const { src: defaultImage } = await getImage({ src: import("~/assets/images/default.png"), width: 1200, @@ -9,7 +11,7 @@ const { src: defaultImage } = await getImage({ }); const { - title = "AstroWind", + title = SITE.name, description = "", image: _image = defaultImage, canonical, @@ -60,4 +62,4 @@ const image = - \ No newline at end of file +{SITE.googleSiteVerificationId && } \ No newline at end of file diff --git a/src/config.mjs b/src/config.mjs index 8c447db..5dcea15 100644 --- a/src/config.mjs +++ b/src/config.mjs @@ -1,9 +1,12 @@ export const SITE = { name: "AstroWind", domain: "https://astrowind.vercel.app", - github: "https://github.com/onwidget/astrowind", + + title: "AstroWind — Your website with Astro + Tailwind CSS", + description: "🚀 AstroWind is a free and ready to start template to make your website using Astro and Tailwind CSS.", postsPerPage: 6, - googleAnalyticsId: false, // or "G-XXXXXXXXXX" + googleAnalyticsId: false, // or "G-XXXXXXXXXX", + googleSiteVerificationId: "orcPxI47GSa-cRvY11tUe6iGg2IO_RPvnA1q95iEM3M", }; diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index cf0f9af..788d94d 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -16,7 +16,8 @@ const { googleAnalyticsId = false } = SITE; - {googleAnalyticsId && } + {googleAnalyticsId && + } @@ -24,4 +25,4 @@ const { googleAnalyticsId = false } = SITE; - + \ No newline at end of file diff --git a/src/layouts/PageLayout.astro b/src/layouts/PageLayout.astro index 0c6c1cd..d48f490 100644 --- a/src/layouts/PageLayout.astro +++ b/src/layouts/PageLayout.astro @@ -9,6 +9,8 @@ const { meta } = Astro.props;
- +
+ +