From da8ef74b38c22adc5ecb61b7b59ee851f7d3ae56 Mon Sep 17 00:00:00 2001 From: prototypa Date: Tue, 22 Aug 2023 22:22:53 -0400 Subject: [PATCH] Replace SITE_CONFIG, UI_CONFIG, METADATA_CONFIG... to SITE, UI, METADATA... --- astro.config.mjs | 10 ++++----- src/components/Logo.astro | 4 ++-- src/components/blog/GridItem.astro | 4 ++-- src/components/blog/ListItem.astro | 4 ++-- src/components/blog/Tags.astro | 4 ++-- src/components/blog/ToBlogLink.astro | 4 ++-- src/components/common/Analytics.astro | 6 ++--- src/components/common/ApplyColorMode.astro | 4 ++-- src/components/common/BasicScripts.astro | 4 ++-- src/components/common/Metadata.astro | 22 +++++++++---------- src/components/common/SiteVerification.astro | 4 ++-- src/components/common/ToggleTheme.astro | 4 ++-- .../widgets/BlogHighlightedPosts.astro | 8 +++---- src/components/widgets/BlogLatestPosts.astro | 8 +++---- src/components/widgets/Footer.astro | 4 ++-- src/layouts/Layout.astro | 4 ++-- src/pages/rss.xml.ts | 10 ++++----- src/utils/blog.ts | 22 +++++++++---------- src/utils/config.ts | 12 +++++----- src/utils/permalinks.ts | 20 ++++++++--------- src/utils/utils.ts | 4 ++-- 21 files changed, 83 insertions(+), 83 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 59d202f..c7d0608 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -13,21 +13,21 @@ import tasks from "./src/utils/tasks"; import { readingTimeRemarkPlugin } from './src/utils/frontmatter.mjs'; -import { ANALYTICS_CONFIG, SITE_CONFIG } from './src/utils/config.ts'; +import { ANALYTICS, SITE } from './src/utils/config.ts'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const whenExternalScripts = (items = []) => - ANALYTICS_CONFIG.vendors.googleAnalytics.id && ANALYTICS_CONFIG.vendors.googleAnalytics.partytown + ANALYTICS.vendors.googleAnalytics.id && ANALYTICS.vendors.googleAnalytics.partytown ? Array.isArray(items) ? items.map((item) => item()) : [items()] : []; export default defineConfig({ - site: SITE_CONFIG.site, - base: SITE_CONFIG.base, - trailingSlash: SITE_CONFIG.trailingSlash ? 'always' : 'never', + site: SITE.site, + base: SITE.base, + trailingSlash: SITE.trailingSlash ? 'always' : 'never', output: 'static', diff --git a/src/components/Logo.astro b/src/components/Logo.astro index 3675566..f196575 100644 --- a/src/components/Logo.astro +++ b/src/components/Logo.astro @@ -1,7 +1,7 @@ --- -import { SITE_CONFIG } from '~/utils/config'; +import { SITE } from '~/utils/config'; --- - 🚀 {SITE_CONFIG?.name} + 🚀 {SITE?.name} diff --git a/src/components/blog/GridItem.astro b/src/components/blog/GridItem.astro index 3f4a5f1..360de3d 100644 --- a/src/components/blog/GridItem.astro +++ b/src/components/blog/GridItem.astro @@ -1,5 +1,5 @@ --- -import { APP_BLOG_CONFIG } from '~/utils/config'; +import { APP_BLOG } from '~/utils/config'; import type { Post } from '~/types'; import Image from '~/components/common/Image.astro'; @@ -39,7 +39,7 @@ const image = (await findImage(post.image));

{ - !APP_BLOG_CONFIG?.post?.isEnabled ? ( + !APP_BLOG?.post?.isEnabled ? ( post.title ) : ( diff --git a/src/components/blog/Tags.astro b/src/components/blog/Tags.astro index 1adfa82..04e2a01 100644 --- a/src/components/blog/Tags.astro +++ b/src/components/blog/Tags.astro @@ -1,7 +1,7 @@ --- import { getPermalink } from '~/utils/permalinks'; -import { APP_BLOG_CONFIG } from '~/utils/config'; +import { APP_BLOG } from '~/utils/config'; import type { Post } from '~/types'; export interface Props { @@ -23,7 +23,7 @@ const { tags, class: className = 'text-sm', title = undefined, isCategory = fals