Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add commit footer #107

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
const WindiCSSWebpackPlugin = require("windicss-webpack-plugin");
const childProcess = require("child_process");

let currentCommit;
try {
currentCommit = childProcess.execSync("git rev-parse HEAD").toString().slice(0, 7).trim();
} catch (error) {
console.error("Failed to get the current commit:", error);
currentCommit = "unknown";
}

/** @type {import('next').NextConfig} */
const nextConfig = {
env: {
CURRENT_COMMIT: currentCommit
},
reactStrictMode: true,
webpack: (config) => {
config.plugins.push(new WindiCSSWebpackPlugin());
Expand All @@ -19,4 +31,4 @@ const nextConfig = {
},
};

module.exports = nextConfig;
module.exports = nextConfig;
23 changes: 20 additions & 3 deletions src/components/layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,26 @@ const Footer = () => (
<div className="flex flex-row items-center gap-2 border-t border-gray-600/50 mt-8 pt-10">
<LogoMarkerDark className="h-12 cursor-pointer" alt="PaperMC" />
<div className="flex-1" />
<span className="text-gray-300 text-sm">
© {new Date().getFullYear()} The PaperMC Team
</span>
<div className={"flex flex-col"}>
<span className="text-gray-300 text-sm">
© {new Date().getFullYear()} The PaperMC Team
</span>
<span className="text-gray-300 text-sm">
<Link
className={"text-blue-800 dark:text-blue-300 text-sm font-medium"}
href="https://github.com/PaperMC/website/"
>
PaperMC/website
</Link>
{" @ "}
<Link
className={"text-blue-800 dark:text-blue-300 text-sm font-medium"}
href={`https://github.com/PaperMC/website/commit/${process.env.CURRENT_COMMIT}`}
>
{process.env.CURRENT_COMMIT}
</Link>
</span>
</div>
</div>
</div>
</footer>
Expand Down