Convert .env to config.json. Settle changes.

This commit is contained in:
Korbs 2024-11-12 14:20:33 -05:00
parent a16dc64155
commit 56b61b2c1e
12 changed files with 64 additions and 104 deletions

View file

@ -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
}
});
})

View file

@ -1,4 +1,14 @@
{
"SiteSettings": {
"OrgName": "SudoVanilla",
"SiteName": "ButterflyVu Demo",
"SiteProtocol": "http",
"SiteDomain": "localhost:2014",
"SiteBase": "",
"MetaColor": "",
"WhiteLabel": "true",
"FooterVersion": "true"
},
"HeaderItems": [
{
"text": "Syntax",

View file

@ -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",

View file

@ -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'
---
<div class="sidebar">
{SidebarItems.map((item) => (
item.heading ? <h2>{item.heading}</h2> : <a href={SITE_PROTOCOL + '://' + SITE_DOMAIN + SITE_BASE + item.link}>{item.text}</a>
item.heading ? <h2>{item.heading}</h2> : <a href={SiteSettings.SiteProtocol + '://' + SiteSettings.SiteDomain + SiteSettings.SiteBase + item.link}>{item.text}</a>
))}
</div>

View file

@ -1,17 +1,12 @@
---
// Environment Variables
import {
SITE_NAME
} from '@utils/GetConfig'
// Configuration
import { HeaderItems } from '../../../config.json'
// Settings
import { SiteSettings, HeaderItems } from '@config'
---
<header>
<div class="header-content">
<div class="start">
<h2><a style="text-decoration: none;" href="/">{SITE_NAME}</a></h2>
<h2><a style="text-decoration: none;" href="/">{SiteSettings.SiteName}</a></h2>
</div>
<div class="end">
{HeaderItems.map((item) => (

View file

@ -54,9 +54,11 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i
## Zorn Player
<Zorn
Poster="https://md.sudovanilla.org/images/wote-p-v.jpeg"
Video="https://ocean.sudovanilla.org/media/videos/The%20Mark%20On%20The%20Wall/1080.mp4"
Audio="https://ocean.sudovanilla.org/media/videos/The%20Mark%20On%20The%20Wall/audio.mp4"
PlayerName="nameit_whatever_you_want"
Poster="https://md.sudovanilla.org/images/eay-p-v.jpg"
Video="https://ocean.sudovanilla.org/media/videos/Ennie%20and%20Yoyki/Ennie%20and%20Yoyki%3A%20Non-Girly%20Games.mp4"
CustomControls
Milieu
/>
A custom video player tailored for MinPluto.

View file

@ -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"
<slot/>
<!-- <hr/>
<p>Last Updated: null</p> -->
{
<!-- {
FEEDBACK_ENABLED ?
// Feelback
FEELBACK_ENABLED ?
@ -47,29 +42,24 @@ import "@styles/prism.css"
null
:
null
}
} -->
</div>
</div>
<div class="footer">
<div class="footer-start">
<p>© {ORG_NAME}. All right reserved.</p>
<p>© {SiteSettings.OrgName}. All right reserved.</p>
</div>
<div class="footer-end">
{WHITELABEL ?
{SiteSettings.WhiteLabel ?
<p>Built with <a href="#">ButterflyVu</a></p>
:
null
}
{SiteSettings.FooterVersion ?
<p style="opacity: 0.5;">v{version}</p>
:
null
}
</div>
</div>
</div>
{REVERT_LAYOUT ?
<style>
.content {
flex-direction: row-reverse;
}
</style>
:
null
}
</div>

View file

@ -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";
</div>
<div class="footer">
<div class="footer-start">
<p>© {ORG_NAME}. All right reserved.</p>
<p>© {SiteSettings.OrgName}. All right reserved.</p>
</div>
<div class="footer-end">
{WHITELABEL ?
{SiteSettings.WhiteLabel ?
<p>Built with <a href="#">ButterflyVu</a></p>
:
null
}
{SiteSettings.FooterVersion ?
<p style="opacity: 0.5;">v{version}</p>
:
null
}
</div>
</div>
</div>

View file

@ -48,6 +48,4 @@ export const prerender = true;
</Document>
}
}
}
<style is:global>.content {flex-direction: column !important;}</style>
}

View file

@ -118,5 +118,9 @@ header {
height: 2.5rem;
display: flex;
justify-content: space-between;
.footer-end {
display: flex;
gap: 4px;
}
}
}

View file

@ -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;

View file

@ -9,7 +9,7 @@
"@components/*": ["src/components/*"],
"@layouts/*": ["src/layouts/*"],
"@styles/*": ["src/styles/*"],
"@utils/*": ["src/utils/*"]
"@config": ["./config.json"]
}
}
}