migrate to yml config (so I can comment the config)
Some checks failed
Publish Docker Image / docker (push) Failing after 33s

This commit is contained in:
Lee
2023-07-13 10:12:07 +01:00
parent c0e1bec350
commit b9093d75fe
13 changed files with 3075 additions and 180 deletions

View File

@ -4,7 +4,7 @@ import Image from "next/image";
import { Fragment } from "react";
import { useLanyardWS } from "use-lanyard";
import Config from "../../../config.json";
import Config from "../../../config.yml";
function LanyardWrapper(props: { children: any }) {
return <Fragment>{props.children}</Fragment>;

View File

@ -3,7 +3,7 @@ import "@fortawesome/fontawesome-svg-core/styles.css";
import { Inter } from "next/font/google";
import "./globals.css";
import Config from "../../config.json";
import Config from "../../config.yml";
config.autoAddCss = false;
const inter = Inter({ subsets: ["latin"] });

View File

@ -4,7 +4,7 @@ import { far } from "@fortawesome/free-regular-svg-icons";
import { fas } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import Image from "next/image";
import Config from "../../config.json";
import Config from "../../config.yml";
import Avatar from "./components/Avatar";
library.add(fab, far, fas); // Loading in the icons from FontAwesome

57
src/types/config.d.ts vendored Normal file
View File

@ -0,0 +1,57 @@
import { YAMLMap } from "js-yaml";
export interface Config {
configVersion: string;
name: string;
description: string;
avatar: string;
background: {
showBackground: boolean;
blur: boolean;
darken: {
enabled: boolean;
amount: number;
};
backgroundImage: string;
};
theme: string;
infoCard: {
transparency: number;
};
discord: {
id: string;
};
options: {
showSourceLink: boolean;
};
metadata: {
title: string;
description: string;
themeColor: string;
authors: {
name: string;
url: string;
}[];
};
links: {
title: string;
url: string;
icon: string;
color:
| {
normal: string;
}
| string;
}[];
socialLinks: {
icon: string;
color: string;
url: string;
}[];
}
// Parse the YAML content and convert it to the defined type
declare module "*.yml" {
const content: YAMLMap & Config;
export default content;
}