Skip to content

Commit

Permalink
add commit footer
Browse files Browse the repository at this point in the history
  • Loading branch information
powercasgamer committed Jun 16, 2024
1 parent be4dc53 commit d212292
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
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;
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
"windicss": "3.5.6",
"windicss-webpack-plugin": "1.8.0"
},
"sideEffects": false
"sideEffects": false,
"packageManager": "[email protected]+sha512.98a80fd11c2e7096747762304106432b3ddc67dcf54b5a8c01c93f68a2cd5e05e6821849522a06fb76284d41a2660d5e334f2ee3bbf29183bf2e739b1dafa771"
}
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

0 comments on commit d212292

Please sign in to comment.