diff --git a/web/components/Footer.tsx b/web/components/Footer.tsx index 7b11493f..4f3dd425 100644 --- a/web/components/Footer.tsx +++ b/web/components/Footer.tsx @@ -1,13 +1,18 @@ +import getConfig from 'next/config' import CopyleftIcon from './CopyleftIcon' const Footer: React.FunctionComponent = () => { + const { publicRuntimeConfig } = getConfig() + const { modifiedDate, modifiedYear } = publicRuntimeConfig return (
-
-

{new Date().getFullYear()} Conky developers

+
+

+ {modifiedYear} Conky developers, updated {modifiedDate} +

) diff --git a/web/global.d.ts b/web/global.d.ts new file mode 100644 index 00000000..5599f1f5 --- /dev/null +++ b/web/global.d.ts @@ -0,0 +1,12 @@ +declare module 'next/config' { + type ConfigTypes = () => { + publicRuntimeConfig: { + modifiedDate: string + modifiedYear: string + } + } + + declare const getConfig: ConfigTypes + + export default getConfig +} diff --git a/web/next.config.mjs b/web/next.config.mjs new file mode 100644 index 00000000..8febd58a --- /dev/null +++ b/web/next.config.mjs @@ -0,0 +1,13 @@ +// @ts-check + +/** + * @type {import('next').NextConfig} + */ +const nextConfig = { + publicRuntimeConfig: { + modifiedDate: new Date().toISOString(), + modifiedYear: new Date().getFullYear(), + }, +} + +export default nextConfig diff --git a/web/tsconfig.json b/web/tsconfig.json index 50bcb22f..724fc1dd 100644 --- a/web/tsconfig.json +++ b/web/tsconfig.json @@ -15,6 +15,6 @@ "isolatedModules": true, "jsx": "preserve" }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "include": ["next-env.d.ts", "global.d.ts", "**/*.ts", "**/*.tsx"], "exclude": ["node_modules"] }