1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-06-02 07:20:47 +00:00

Add modified date to web docs

This commit is contained in:
Brenden Matthews 2024-04-11 11:02:27 -04:00
parent d45836f14e
commit 2ffc5d67a6
4 changed files with 33 additions and 3 deletions

View File

@ -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 (
<div className="flex py-4 justify-center items-center">
<div className="px-1">
<CopyleftIcon width={20} height={20} />
</div>
<div className="px-1 font-sans text-sm">
<p>{new Date().getFullYear()} Conky developers</p>
<div className="px-1 font-sans text-xs">
<p>
{modifiedYear} Conky developers, updated <code>{modifiedDate}</code>
</p>
</div>
</div>
)

12
web/global.d.ts vendored Normal file
View File

@ -0,0 +1,12 @@
declare module 'next/config' {
type ConfigTypes = () => {
publicRuntimeConfig: {
modifiedDate: string
modifiedYear: string
}
}
declare const getConfig: ConfigTypes
export default getConfig
}

13
web/next.config.mjs Normal file
View File

@ -0,0 +1,13 @@
// @ts-check
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
publicRuntimeConfig: {
modifiedDate: new Date().toISOString(),
modifiedYear: new Date().getFullYear(),
},
}
export default nextConfig

View File

@ -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"]
}