Skip to content

Commit

Permalink
Merge pull request #420 from powercasgamer/feat/commit-footer
Browse files Browse the repository at this point in the history
feat: add current commit to footer
  • Loading branch information
kashike authored Jun 16, 2024
2 parents 442ddd0 + d93a964 commit 2119b9e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion config/footer.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import type { Footer } from "@docusaurus/theme-common";
import { execSync } from "child_process";

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

const footer: Footer = {
style: "dark",
Expand Down Expand Up @@ -47,7 +56,7 @@ const footer: Footer = {
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} PaperMC and Contributors. Built with Docusaurus.`,
copyright: `Copyright © ${new Date().getFullYear()} PaperMC and Contributors. Built with Docusaurus.<div><a href="https://github.com/PaperMC/docs/">PaperMC/docs</a> @ <a href="https://github.com/PaperMC/docs/commit/${currentCommit}">${currentCommit}</a></div>`,
};

export default footer;

0 comments on commit 2119b9e

Please sign in to comment.