Add auto linking to current git commit

This commit is contained in:
Aria 2025-03-10 20:43:23 +11:00
parent ed2eafd664
commit 599a07e6c0
Signed by untrusted user who does not match committer: aria
GPG key ID: 19AB7AA462B8AB3B
3 changed files with 15 additions and 5 deletions

1
.env.example Normal file
View file

@ -0,0 +1 @@
PUBLIC_REPOURL=https://github.com/BuyMyMojo/aria.coffee/

View file

@ -1,5 +1,11 @@
# Wowie what a gay little website for my gay little self
## Setup
You must create a `.env` file with the contents of `.env.example` and set the URL of your repo for the commit footer.
Example URL: `https://github.com/BuyMyMojo/aria.coffee/` - Notice the trailing `/`, this is required
## Deploy steps (Pre-rendered website)
On dev machine:

View file

@ -2,17 +2,20 @@
const buttonFormat = "gif";
import { Icon } from "astro-icon/components";
import { execSync } from "node:child_process";
const commitURL = `${import.meta.env.PUBLIC_REPOURL}commit/${execSync(`git log -1 --pretty="format:%H"`)}`;
---
<hr class="h-1" style="" />
<footer class="flexcol">
<div class="flexrow">
<p>
<a href="https://github.com/BuyMyMojo/aria.coffee" target="_blank"
><Icon name="mdi:source-branch" class={"svg-inline"}/> Source Code</a
> | <a href="https://aria.coffee/rss.xml" target="_blank"
><Icon name="mdi:rss" class={"svg-inline"}/> RSS Feed</a
>
| <a href="https://github.com/BuyMyMojo/aria.coffee" target="_blank"
> <Icon name="mdi:source-branch" class={"svg-inline"}/>Source Code</a
> - Commit:<a href={commitURL}>{execSync(`git log -1 --pretty="format:%h"`)}</a> | <a href="https://aria.coffee/rss.xml" target="_blank"
> <Icon name="mdi:rss" class={"svg-inline"}/>RSS Feed</a
> |
</p>
</div>
<div class="flex">