feat: git data
This commit is contained in:
parent
305e507407
commit
7991ce7ee0
|
@ -10,13 +10,12 @@ import Link from 'next/link';
|
||||||
import styles from '@/styles/Footer.module.scss';
|
import styles from '@/styles/Footer.module.scss';
|
||||||
import AdBanner from './AdBanner';
|
import AdBanner from './AdBanner';
|
||||||
|
|
||||||
|
import getConfig from 'next/config';
|
||||||
|
|
||||||
export default function Footer() {
|
export default function Footer() {
|
||||||
const git = {
|
const { publicRuntimeConfig } = getConfig();
|
||||||
branch: 'dev/nextjs',
|
|
||||||
commit: {
|
const git = publicRuntimeConfig.git;
|
||||||
sha: 'aa1ece3db89e03e169c0031e9319e50bd4626ffb',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const childProcess = require('child_process');
|
const childProcess = require('child_process');
|
||||||
|
|
||||||
|
const gitBranch = childProcess.execSync('git rev-parse --abbrev-ref HEAD').toString().trim();
|
||||||
|
const gitCommit = childProcess.execSync('git rev-parse HEAD').toString().trim();
|
||||||
|
const gitCommitTime = childProcess.execSync('git show -s --format=%cI').toString().trim();
|
||||||
|
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
|
@ -29,6 +33,13 @@ const nextConfig = {
|
||||||
'email',
|
'email',
|
||||||
'openid'
|
'openid'
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
git: {
|
||||||
|
branch: gitBranch,
|
||||||
|
commit: {
|
||||||
|
sha: gitCommit,
|
||||||
|
created: new Date(gitCommitTime)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
generateBuildId: async () => {
|
generateBuildId: async () => {
|
||||||
|
|
Loading…
Reference in a new issue