mirror of
https://github.com/Xevion/utsa-handbook.git
synced 2025-12-17 14:13:51 -06:00
overengineering: async git rev-parse execution
also converted to tailwind, removed the useless stuff
This commit is contained in:
@@ -1,38 +1,24 @@
|
|||||||
---
|
---
|
||||||
import childProcess from "child_process";
|
import { GITHUB_URL } from "@/consts";
|
||||||
const hash = childProcess
|
import { exec } from "child_process";
|
||||||
.execSync("git rev-parse --short HEAD")
|
import { promisify } from "util";
|
||||||
.toString()
|
|
||||||
.trim();
|
const execAsync = promisify(exec);
|
||||||
|
const [shortHash, longHash] = (
|
||||||
|
await Promise.all([
|
||||||
|
execAsync("git rev-parse --short HEAD"),
|
||||||
|
execAsync("git rev-parse HEAD"),
|
||||||
|
])
|
||||||
|
).map(({ stdout }) => stdout.trim());
|
||||||
|
|
||||||
import { version } from "@/../package.json";
|
import { version } from "@/../package.json";
|
||||||
---
|
---
|
||||||
|
|
||||||
<footer>
|
<footer class="dark:text-zinc-400 pt-8 px-4 pb-24 text-center">
|
||||||
<p>
|
<p>
|
||||||
<a href="https://github.com/Xevion/utsa-handbook" target="_blank"
|
<a href={GITHUB_URL} target="_blank">Handbook</a> v{version}
|
||||||
>Handbook</a
|
<a href={`${GITHUB_URL}/commit/${longHash}`} target="_blank"
|
||||||
> v{version} ({hash})
|
>({shortHash})</a
|
||||||
|
>
|
||||||
</p>
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
<style>
|
|
||||||
footer {
|
|
||||||
padding: 2em 1em 6em 1em;
|
|
||||||
background: linear-gradient(var(--gray-gradient)) no-repeat;
|
|
||||||
color: rgb(var(--gray));
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.social-links {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 1em;
|
|
||||||
margin-top: 1em;
|
|
||||||
}
|
|
||||||
.social-links a {
|
|
||||||
text-decoration: none;
|
|
||||||
color: rgb(var(--gray));
|
|
||||||
}
|
|
||||||
.social-links a:hover {
|
|
||||||
color: rgb(var(--gray-dark));
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user