From 56b61b2c1e1057c5567b8e9090df3e397d9f5d10 Mon Sep 17 00:00:00 2001 From: Korbs Date: Tue, 12 Nov 2024 14:20:33 -0500 Subject: [PATCH] Convert `.env` to `config.json`. Settle changes. --- astro.config.mjs | 25 ++++++++----------- config.json | 10 ++++++++ package.json | 5 ++-- src/components/Sidebar.astro | 6 ++--- src/components/global/Header.astro | 11 +++----- src/content/docs/components.mdx | 8 +++--- src/layouts/Document.astro | 40 +++++++++++------------------- src/layouts/Splash.astro | 20 +++++++-------- src/pages/[slug].astro | 4 +-- src/styles/index.scss | 4 +++ src/utils/GetConfig.js | 33 ------------------------ tsconfig.json | 2 +- 12 files changed, 64 insertions(+), 104 deletions(-) delete mode 100755 src/utils/GetConfig.js diff --git a/astro.config.mjs b/astro.config.mjs index e3d8a5f..19bba3e 100755 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,27 +1,22 @@ -import { defineConfig } from 'astro/config'; -import vue from '@astrojs/vue'; +import { defineConfig } from 'astro/config' -// Environment Variables -import { - SITE_PROTOCOL, - SITE_DOMAIN, - SITE_BASE -} from './src/utils/GetConfig' +// Settings +import { SiteSettings } from './config.json' // Adapters -import bun from 'astro-bun-adapter'; +import bun from 'astro-bun-adapter' // Integrations -import mdx from '@astrojs/mdx'; +import mdx from '@astrojs/mdx' +// Astro Configuration export default defineConfig({ // Information - site: SITE_PROTOCOL + '://' + SITE_DOMAIN, - base: SITE_BASE, + site: SiteSettings.SiteProtocol + '://' + SiteSettings.SiteDomain, + base: SiteSettings.SiteBase, // Integrations integrations: [ - mdx(), - vue() + mdx() ], // Server Output output: "server", @@ -35,4 +30,4 @@ export default defineConfig({ devToolbar: { enabled: false } -}); \ No newline at end of file +}) \ No newline at end of file diff --git a/config.json b/config.json index dbca5bd..54a8f83 100755 --- a/config.json +++ b/config.json @@ -1,4 +1,14 @@ { + "SiteSettings": { + "OrgName": "SudoVanilla", + "SiteName": "ButterflyVu Demo", + "SiteProtocol": "http", + "SiteDomain": "localhost:2014", + "SiteBase": "", + "MetaColor": "", + "WhiteLabel": "true", + "FooterVersion": "true" + }, "HeaderItems": [ { "text": "Syntax", diff --git a/package.json b/package.json index 2397723..5e3718b 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "butterflyvu", "type": "module", - "version": "0.1.1", + "version": "0.1.2", "license": "GPL-3.0-only", "author": { "name": "SudoVanilla" @@ -34,8 +34,7 @@ "dependencies": { "@astrojs/mdx": "4.0.0-beta.2", "@astrojs/prism": "3.0.0-beta.0", - "@astrojs/vue": "5.0.0-beta.0", - "@minpluto/zorn": "^0.4.51", + "@minpluto/zorn": "^0.4.64", "astro": "5.0.0-beta.5", "astro-analytics": "^2.7.0", "astro-breadcrumbs": "^3.2.0", diff --git a/src/components/Sidebar.astro b/src/components/Sidebar.astro index f4bb480..5fa6994 100755 --- a/src/components/Sidebar.astro +++ b/src/components/Sidebar.astro @@ -1,10 +1,10 @@ --- -import { SidebarItems } from '../../config.json' -import { SITE_BASE, SITE_PROTOCOL, SITE_DOMAIN } from '@utils/GetConfig' +// Settings +import { SiteSettings, SidebarItems } from '@config' --- \ No newline at end of file diff --git a/src/components/global/Header.astro b/src/components/global/Header.astro index fe5d5e7..42bfba1 100755 --- a/src/components/global/Header.astro +++ b/src/components/global/Header.astro @@ -1,17 +1,12 @@ --- -// Environment Variables -import { - SITE_NAME -} from '@utils/GetConfig' - -// Configuration -import { HeaderItems } from '../../../config.json' +// Settings +import { SiteSettings, HeaderItems } from '@config' ---
{HeaderItems.map((item) => ( diff --git a/src/content/docs/components.mdx b/src/content/docs/components.mdx index e6e8905..4e3f9aa 100755 --- a/src/content/docs/components.mdx +++ b/src/content/docs/components.mdx @@ -54,9 +54,11 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i ## Zorn Player A custom video player tailored for MinPluto. diff --git a/src/layouts/Document.astro b/src/layouts/Document.astro index f3e1014..bf313be 100755 --- a/src/layouts/Document.astro +++ b/src/layouts/Document.astro @@ -1,12 +1,7 @@ --- -// Environment Variables -import { - ORG_NAME, - FEEDBACK_ENABLED, - FEELBACK_ENABLED, - REVERT_LAYOUT, - WHITELABEL -} from '@utils/GetConfig' +// Settings +import { SiteSettings } from '@config' +import {version} from '../../package.json' // Properties const { frontmatter, Title, Feedback, Feelback } = Astro.props @@ -18,8 +13,8 @@ import Sidebar from '@components/Sidebar.astro' import FeelbackYesNo from "astro-feelback/components/FeelbackYesNo.astro" // Styles -import "@styles/index.scss"; -import "@styles/feelback.css"; +import "@styles/index.scss" +import "@styles/feelback.css" import "@styles/prism.css" --- @@ -33,7 +28,7 @@ import "@styles/prism.css" - { +
- - -{REVERT_LAYOUT ? - - : - null -} \ No newline at end of file + \ No newline at end of file diff --git a/src/layouts/Splash.astro b/src/layouts/Splash.astro index 0801707..fed8b9c 100755 --- a/src/layouts/Splash.astro +++ b/src/layouts/Splash.astro @@ -1,12 +1,7 @@ --- -// Environment Variables -import { - ORG_NAME, - FEEDBACK_ENABLED, - FEELBACK_ENABLED, - REVERT_LAYOUT, - WHITELABEL -} from '@utils/GetConfig' +// Settings +import { SiteSettings } from '@config' +import {version} from '../../package.json' // Properties const { frontmatter } = Astro.props @@ -43,14 +38,19 @@ import "@styles/feelback.css"; \ No newline at end of file diff --git a/src/pages/[slug].astro b/src/pages/[slug].astro index ad3aa86..16d0579 100755 --- a/src/pages/[slug].astro +++ b/src/pages/[slug].astro @@ -48,6 +48,4 @@ export const prerender = true; } } -} - - \ No newline at end of file +} \ No newline at end of file diff --git a/src/styles/index.scss b/src/styles/index.scss index 710862f..07e4213 100755 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -118,5 +118,9 @@ header { height: 2.5rem; display: flex; justify-content: space-between; + .footer-end { + display: flex; + gap: 4px; + } } } diff --git a/src/utils/GetConfig.js b/src/utils/GetConfig.js deleted file mode 100755 index f782a37..0000000 --- a/src/utils/GetConfig.js +++ /dev/null @@ -1,33 +0,0 @@ -export var ORG_NAME = import.meta.env.ORG_NAME; -export var SITE_NAME = import.meta.env.SITE_NAME; -export var SITE_PROTOCOL = import.meta.env.SITE_PROTOCOL; -export var SITE_DOMAIN = import.meta.env.SITE_DOMAIN; -export var SITE_BASE = import.meta.env.SITE_BASE; -export var META_COLOR = import.meta.env.META_COLOR; -export var COLOR = import.meta.env.COLOR; -export var THEME = import.meta.env.THEME; -export var SIDEBAR_SIZE = import.meta.env.SIDEBAR_SIZE; -export var SIDEBAR_ICONS = import.meta.env.SIDEBAR_ICONS; -export var THEME_TOGGLE_ENABLED = import.meta.env.THEME_TOGGLE_ENABLED; -export var THEME_TOGGLE_STYLE = import.meta.env.THEME_TOGGLE_STYLE; -export var WHITELABEL = import.meta.env.WHITELABEL; -export var FOOTER_VERSION = import.meta.env.FOOTER_VERSION; -export var REVERT_LAYOUT = import.meta.env.REVERT_LAYOUT; -export var FEEDBACK_ENABLED = import.meta.env.FEEDBACK_ENABLED; -export var FEELBACK_ENABLED = import.meta.env.FEELBACK_ENABLED; -export var ANALYTICS = import.meta.env.ANALYTICS; -export var MATOMO_ID = import.meta.env.MATOMO_ID; -export var MATOMO_SRC = import.meta.env.MATOMO_SRC; -export var PLAUSIBLE_DOMAIN = import.meta.env.PLAUSIBLE_DOMAIN; -export var PLAUSIBLE_SRC = import.meta.env.PLAUSIBLE_SRC; -export var UMAMI_ID = import.meta.env.UMAMI_ID; -export var UMAMI_SRC = import.meta.env.UMAMI_SRC; -export var AMPLITUDE_APIKEY = import.meta.env.AMPLITUDE_APIKEY; -export var METRICAL_APP = import.meta.env.METRICAL_APP; -export var FATHOM_SITE = import.meta.env.FATHOM_SITE; -export var FATHOM_SRC = import.meta.env.FATHOM_SRC; -export var MINIAML_ID = import.meta.env.MINIAML_ID; -export var SWETRIX_SRC = import.meta.env.SWETRIX_SRC; -export var SWETRIX_API = import.meta.env.SWETRIX_API; -export var SWETRIX_PROJECT_ID = import.meta.env.SWETRIX_PROJECT_ID; -export var SIMPLEANALYTICS_DOMAIN = import.meta.env.SIMPLEANALYTICS_DOMAIN; \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 676682a..f69f506 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,7 @@ "@components/*": ["src/components/*"], "@layouts/*": ["src/layouts/*"], "@styles/*": ["src/styles/*"], - "@utils/*": ["src/utils/*"] + "@config": ["./config.json"] } } } \ No newline at end of file