diff --git a/global.d.ts b/global.d.ts index b7d29bd..712f2e0 100644 --- a/global.d.ts +++ b/global.d.ts @@ -1,4 +1,5 @@ declare global { let __BLOG_POSTS__: string[] + let __GIT_LOG_OUTPUT__: Record; } export { }; diff --git a/index.ts b/index.ts index 21d7911..df9db0b 100644 --- a/index.ts +++ b/index.ts @@ -2,10 +2,12 @@ import SSSG from "sssg"; import Variables from "sssg/src/plugins/variables"; import Dev from "sssg/src/plugins/dev"; import TSCompiler from "sssg/src/plugins/ts-compiler"; -import MarkdownMetadata from "sssg/src/plugins/markdown-metadata"; +import MarkdownMetadata, {parseMetadata} from "sssg/src/plugins/markdown-metadata"; import MarkdownCompiler from "sssg/src/plugins/markdown-compiler"; import CompileTimeJS from "sssg/src/plugins/compile-time-js"; +import {$} from "bun" + import * as path from "path"; import * as fs from "fs"; @@ -14,6 +16,10 @@ const sssg = new SSSG({ inputFolder: path.join(__dirname, "website"), }); +const gitLogShell = await $`git log --pretty=format:'commit=%H%nauthor=%aN <%aE>%ndate=%ad%nmessage=%s%n=========' -1`.quiet() +const gitLogOutput = gitLogShell.text("utf8"); +const gitLog = JSON.stringify(parseMetadata(gitLogOutput)); + await sssg.run({ plugins: [ new CompileTimeJS(), @@ -22,6 +28,7 @@ await sssg.run({ __BLOG_POSTS__: JSON.stringify( fs.readdirSync("./website/blogs").map((z) => z.replace(".md", "")) ), + __GIT_LOG_OUTPUT__: gitLog }; if (fs.existsSync("./website/templates")) { diff --git a/website/assets/style.css b/website/assets/style.css index 5b24bd6..fee9d61 100644 --- a/website/assets/style.css +++ b/website/assets/style.css @@ -18,6 +18,7 @@ a { grid-template-areas: "details skills" "details donations" + "details commit" "details lastfm" "webrings webrings" "status binkies" @@ -95,6 +96,22 @@ h6 { .skills { grid-area: skills; } +.commit { + grid-area: commit; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 0px; + padding: 5px; + margin: 5px; +} + +.commit > *, +.commit > * > * { + padding: 0; + margin: 0; +} .binkies { grid-area: binkies; display: flex; @@ -111,8 +128,9 @@ h6 { min-height: 75vh; } .logo { - max-width:80%; - max-height:80%;} + max-width: 80%; + max-height: 80%; +} webring-container { width: unset !important; height: unset !important; @@ -125,6 +143,7 @@ webring-container { "skills " "donations " "lastfm" + "commit" "webrings" "binkies" "blog " diff --git a/website/index.html b/website/index.html index 42e8c74..0e8f897 100644 --- a/website/index.html +++ b/website/index.html @@ -6,6 +6,7 @@ __TEMPLATE_HEAD__ + @@ -95,7 +96,8 @@ __TEMPLATE_HEAD__
-
+
+
@@ -112,10 +114,10 @@ __TEMPLATE_HEAD__ src="https://webring.bucketfish.me/embed.html?name=☹️☹️☹️.ovh&lightmode=true">
-
- +
+
+

Latest commit!

-
\ No newline at end of file diff --git a/website/scripts/commit.ts b/website/scripts/commit.ts new file mode 100644 index 0000000..2846325 --- /dev/null +++ b/website/scripts/commit.ts @@ -0,0 +1,28 @@ +import { timeAgo } from "./util"; + +const git = __GIT_LOG_OUTPUT__; +const date = new Date(git.date); + +const commit = document.getElementById("commit"); + +const a = document.createElement("a"); +a.href = `https://git.sad.ovh/sophie/website/commit/${git.commit}`; + +const h2 = document.createElement("h2") +h2.innerText = git.message; + +a.appendChild(h2); + +const p = document.createElement("p"); +p.innerText = `${timeAgo(date)} -- ${git.date}` + +const p2 = document.createElement("p"); +p2.innerText = `commit by ${git.author.replace(/[^ ]*@.*/, "")}` + +commit?.appendChild(a) +commit?.appendChild(p) +commit?.appendChild(p2) + + +//

More binkies + thinliquid's logo!! tysm :3

+//

20 minutes ago -- 2024-08-29 22:00:36 GMT+3