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 AdBanner from './AdBanner';
|
||||
|
||||
import getConfig from 'next/config';
|
||||
|
||||
export default function Footer() {
|
||||
const git = {
|
||||
branch: 'dev/nextjs',
|
||||
commit: {
|
||||
sha: 'aa1ece3db89e03e169c0031e9319e50bd4626ffb',
|
||||
},
|
||||
};
|
||||
const { publicRuntimeConfig } = getConfig();
|
||||
|
||||
const git = publicRuntimeConfig.git;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
const path = require('path');
|
||||
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} */
|
||||
const nextConfig = {
|
||||
reactStrictMode: true,
|
||||
|
@ -29,6 +33,13 @@ const nextConfig = {
|
|||
'email',
|
||||
'openid'
|
||||
]
|
||||
},
|
||||
git: {
|
||||
branch: gitBranch,
|
||||
commit: {
|
||||
sha: gitCommit,
|
||||
created: new Date(gitCommitTime)
|
||||
}
|
||||
}
|
||||
},
|
||||
generateBuildId: async () => {
|
||||
|
|
Loading…
Reference in a new issue