Skeleton for a yaml config.

This commit is contained in:
2023-08-11 09:51:33 +02:00
parent 052f3b71bf
commit 931783245c
8 changed files with 117 additions and 6 deletions

36
src/config.ts Normal file
View File

@@ -0,0 +1,36 @@
import configData from './config.yml';
export type Brand = {
logo?: string;
icon?: string;
usemask?: boolean;
};
export type Section = {
title: string;
subtitle?: string;
} & Brand;
export type Service = {
url: string;
target?: string;
type?: string;
[x: string]: unknown;
} & Section;
export type ServiceGroup = {
items: Service[];
} & Section;
export type Config = {
services: ServiceGroup[];
} & Section;
export const config: Config = {
...{
title: 'Flanders',
services: []
},
...configData
};

14
src/config.yml Normal file
View File

@@ -0,0 +1,14 @@
title: 'Hello World !!'
subtitle: 'I am a new pilot.'
services:
- title: '/Cloud'
subtitle: 'Private Cloud Utilities'
icon: 'fas fa-cloud'
items:
- title: 'NAS'
subtitle: 'Network Attached Storage'
icon: 'fas fa-hard-drive'
target: '_blank'
url: '/NAS'
keywords: 'cloud storage files'

View File

@@ -1,2 +1,8 @@
<h1>Welcome to SvelteKit</h1>
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
<script lang="ts">
import { config } from '../config';
</script>
<h1>{config.title}</h1>
{#if config.subtitle}
<h2>{config.subtitle}</h2>
{/if}