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 { defineConfig } from 'astro/config'
import vue from '@astrojs/vue';
// Environment Variables // Settings
import { import { SiteSettings } from './config.json'
SITE_PROTOCOL,
SITE_DOMAIN,
SITE_BASE
} from './src/utils/GetConfig'
// Adapters // Adapters
import bun from 'astro-bun-adapter'; import bun from 'astro-bun-adapter'
// Integrations // Integrations
import mdx from '@astrojs/mdx'; import mdx from '@astrojs/mdx'
// Astro Configuration
export default defineConfig({ export default defineConfig({
// Information // Information
site: SITE_PROTOCOL + '://' + SITE_DOMAIN, site: SiteSettings.SiteProtocol + '://' + SiteSettings.SiteDomain,
base: SITE_BASE, base: SiteSettings.SiteBase,
// Integrations // Integrations
integrations: [ integrations: [
mdx(), mdx()
vue()
], ],
// Server Output // Server Output
output: "server", output: "server",
@ -35,4 +30,4 @@ export default defineConfig({
devToolbar: { devToolbar: {
enabled: false 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": [ "HeaderItems": [
{ {
"text": "Syntax", "text": "Syntax",

View file

@ -1,7 +1,7 @@
{ {
"name": "butterflyvu", "name": "butterflyvu",
"type": "module", "type": "module",
"version": "0.1.1", "version": "0.1.2",
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
"author": { "author": {
"name": "SudoVanilla" "name": "SudoVanilla"
@ -34,8 +34,7 @@
"dependencies": { "dependencies": {
"@astrojs/mdx": "4.0.0-beta.2", "@astrojs/mdx": "4.0.0-beta.2",
"@astrojs/prism": "3.0.0-beta.0", "@astrojs/prism": "3.0.0-beta.0",
"@astrojs/vue": "5.0.0-beta.0", "@minpluto/zorn": "^0.4.64",
"@minpluto/zorn": "^0.4.51",
"astro": "5.0.0-beta.5", "astro": "5.0.0-beta.5",
"astro-analytics": "^2.7.0", "astro-analytics": "^2.7.0",
"astro-breadcrumbs": "^3.2.0", "astro-breadcrumbs": "^3.2.0",

View file

@ -1,10 +1,10 @@
--- ---
import { SidebarItems } from '../../config.json' // Settings
import { SITE_BASE, SITE_PROTOCOL, SITE_DOMAIN } from '@utils/GetConfig' import { SiteSettings, SidebarItems } from '@config'
--- ---
<div class="sidebar"> <div class="sidebar">
{SidebarItems.map((item) => ( {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> </div>

View file

@ -1,17 +1,12 @@
--- ---
// Environment Variables // Settings
import { import { SiteSettings, HeaderItems } from '@config'
SITE_NAME
} from '@utils/GetConfig'
// Configuration
import { HeaderItems } from '../../../config.json'
--- ---
<header> <header>
<div class="header-content"> <div class="header-content">
<div class="start"> <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>
<div class="end"> <div class="end">
{HeaderItems.map((item) => ( {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 Player
<Zorn <Zorn
Poster="https://md.sudovanilla.org/images/wote-p-v.jpeg" PlayerName="nameit_whatever_you_want"
Video="https://ocean.sudovanilla.org/media/videos/The%20Mark%20On%20The%20Wall/1080.mp4" Poster="https://md.sudovanilla.org/images/eay-p-v.jpg"
Audio="https://ocean.sudovanilla.org/media/videos/The%20Mark%20On%20The%20Wall/audio.mp4" 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. A custom video player tailored for MinPluto.

View file

@ -1,12 +1,7 @@
--- ---
// Environment Variables // Settings
import { import { SiteSettings } from '@config'
ORG_NAME, import {version} from '../../package.json'
FEEDBACK_ENABLED,
FEELBACK_ENABLED,
REVERT_LAYOUT,
WHITELABEL
} from '@utils/GetConfig'
// Properties // Properties
const { frontmatter, Title, Feedback, Feelback } = Astro.props 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" import FeelbackYesNo from "astro-feelback/components/FeelbackYesNo.astro"
// Styles // Styles
import "@styles/index.scss"; import "@styles/index.scss"
import "@styles/feelback.css"; import "@styles/feelback.css"
import "@styles/prism.css" import "@styles/prism.css"
--- ---
@ -33,7 +28,7 @@ import "@styles/prism.css"
<slot/> <slot/>
<!-- <hr/> <!-- <hr/>
<p>Last Updated: null</p> --> <p>Last Updated: null</p> -->
{ <!-- {
FEEDBACK_ENABLED ? FEEDBACK_ENABLED ?
// Feelback // Feelback
FEELBACK_ENABLED ? FEELBACK_ENABLED ?
@ -47,29 +42,24 @@ import "@styles/prism.css"
null null
: :
null null
} } -->
</div> </div>
</div> </div>
<div class="footer"> <div class="footer">
<div class="footer-start"> <div class="footer-start">
<p>© {ORG_NAME}. All right reserved.</p> <p>© {SiteSettings.OrgName}. All right reserved.</p>
</div> </div>
<div class="footer-end"> <div class="footer-end">
{WHITELABEL ? {SiteSettings.WhiteLabel ?
<p>Built with <a href="#">ButterflyVu</a></p> <p>Built with <a href="#">ButterflyVu</a></p>
: :
null null
} }
{SiteSettings.FooterVersion ?
<p style="opacity: 0.5;">v{version}</p>
:
null
}
</div> </div>
</div> </div>
</div> </div>
{REVERT_LAYOUT ?
<style>
.content {
flex-direction: row-reverse;
}
</style>
:
null
}

View file

@ -1,12 +1,7 @@
--- ---
// Environment Variables // Settings
import { import { SiteSettings } from '@config'
ORG_NAME, import {version} from '../../package.json'
FEEDBACK_ENABLED,
FEELBACK_ENABLED,
REVERT_LAYOUT,
WHITELABEL
} from '@utils/GetConfig'
// Properties // Properties
const { frontmatter } = Astro.props const { frontmatter } = Astro.props
@ -43,14 +38,19 @@ import "@styles/feelback.css";
</div> </div>
<div class="footer"> <div class="footer">
<div class="footer-start"> <div class="footer-start">
<p>© {ORG_NAME}. All right reserved.</p> <p>© {SiteSettings.OrgName}. All right reserved.</p>
</div> </div>
<div class="footer-end"> <div class="footer-end">
{WHITELABEL ? {SiteSettings.WhiteLabel ?
<p>Built with <a href="#">ButterflyVu</a></p> <p>Built with <a href="#">ButterflyVu</a></p>
: :
null null
} }
{SiteSettings.FooterVersion ?
<p style="opacity: 0.5;">v{version}</p>
:
null
}
</div> </div>
</div> </div>
</div> </div>

View file

@ -49,5 +49,3 @@ export const prerender = true;
} }
} }
} }
<style is:global>.content {flex-direction: column !important;}</style>

View file

@ -118,5 +118,9 @@ header {
height: 2.5rem; height: 2.5rem;
display: flex; display: flex;
justify-content: space-between; 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/*"], "@components/*": ["src/components/*"],
"@layouts/*": ["src/layouts/*"], "@layouts/*": ["src/layouts/*"],
"@styles/*": ["src/styles/*"], "@styles/*": ["src/styles/*"],
"@utils/*": ["src/utils/*"] "@config": ["./config.json"]
} }
} }
} }