Skip to content

Commit

Permalink
add git info in footer
Browse files Browse the repository at this point in the history
  • Loading branch information
skovati committed Sep 1, 2023
1 parent a41667c commit 695cd6d
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
---
import { execSync } from "child_process";
import FormattedDate from "./FormattedDate.astro";
const cmd = `git log -1 --pretty="%cn&&%cd&&%s&&%h" --date=iso`;
const git_info = execSync(cmd).toString().trim().split("&&");
const [ author, date, message, hash ] = git_info;
const links = [
{name: "git", url: "https://github.com/skovati"},
{name: "mail", url: "mailto:[email protected]"},
{name: "pgp", url: "/pgp"}
{ name: "git", url: "https://github.com/skovati" },
{ name: "mail", url: "mailto:[email protected]" },
{ name: "pgp", url: "/pgp" }
]
---

<hr>

<p>
the content for this site is <a href="/LICENSE.txt"><b>CC-BY-NC-ND</b></a>
last modified: {`(${hash}) ${author} - ${message} - `}
<FormattedDate date={new Date(date)}>
</p>

<p>
the content for this site is <a href="/LICENSE.txt"><b>CC-BY-NC-ND</b></a>
</p>

<p>
the <a href="https://git.sr.ht/~skovati/website"><b>source code</b></a> is <a href="https://git.sr.ht/~skovati/website/tree/master/item/LICENSE"><b>MIT</b></a>
the <a href="https://git.sr.ht/~skovati/website"><b>source code</b></a> is <a href="https://git.sr.ht/~skovati/website/tree/master/item/LICENSE"><b>MIT</b></a>
</p>

<p>
{
links.map(e =>
<a href={e.url}><b>{e.name} </b></a>
)
}
{links.map(e =>
<a href={e.url}><b>{`${e.name} `}</b></a>
)}
</p>

0 comments on commit 695cd6d

Please sign in to comment.