diff options
author | Raphael <mail@raphaelkabo.com> | 2023-10-09 11:10:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-09 11:10:51 +0100 |
commit | cc6fcb4c405d8cffacbf9b1082abf61e918482fa (patch) | |
tree | 693f324550dccedd50b6313165b88281a8ebcac8 /src/lib/config.ts | |
parent | 25fcdd1023550631f5fec6f750829fe09a311d66 (diff) | |
parent | 31022a7d323a351041b7b8508fb56c14fd699580 (diff) |
Merge pull request #114 from lowercasename/rk/static-pages
Static pages
Diffstat (limited to 'src/lib/config.ts')
-rw-r--r-- | src/lib/config.ts | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/lib/config.ts b/src/lib/config.ts index 7b35b98..6f142e5 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -2,6 +2,12 @@ import fs from "fs"; import toml from "toml"; import { exitWithError } from "./process.js"; +interface StaticPage { + title: string; + path: string; + filename: string; +} + interface GathioConfig { general: { domain: string; @@ -25,9 +31,21 @@ interface GathioConfig { sendgrid?: { api_key: string; }; + static_pages: StaticPage[]; +} + +interface FrontendConfig { + domain: string; + siteName: string; + isFederated: boolean; + emailLogoUrl: string; + showKofi: boolean; + showInstanceInformation: boolean; + staticPages: StaticPage[]; + version: string; } -export const publicConfig = () => { +export const frontendConfig = (): FrontendConfig => { const config = getConfig(); return { domain: config.general.domain, @@ -35,6 +53,9 @@ export const publicConfig = () => { isFederated: config.general.is_federated, emailLogoUrl: config.general.email_logo_url, showKofi: config.general.show_kofi, + showInstanceInformation: config.static_pages?.length > 0, + staticPages: config.static_pages, + version: process.env.npm_package_version || "unknown", }; }; |