From 0af094770c4ebabc56ff761a8bd215bc397c0f7e Mon Sep 17 00:00:00 2001 From: João Augusto Costa Branco Marado Torres Date: Tue, 5 Aug 2025 18:50:37 +0100 Subject: refactor: reading page review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Augusto Costa Branco Marado Torres --- src/components/templates/signature/Commit.astro | 86 +++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 src/components/templates/signature/Commit.astro (limited to 'src/components/templates/signature/Commit.astro') diff --git a/src/components/templates/signature/Commit.astro b/src/components/templates/signature/Commit.astro new file mode 100644 index 0000000..328a8f9 --- /dev/null +++ b/src/components/templates/signature/Commit.astro @@ -0,0 +1,86 @@ +--- +import { gitDir } from "@lib/git"; +import type { Commit } from "@lib/git/types"; +import { toIso8601Full } from "@utils/datetime"; + +type Props = { commit: Commit; lang: string }; + +const dir = await gitDir(); +const { hash, files, author, committer, signature } = Astro.props.commit; + +const formatter = new Intl.DateTimeFormat([Astro.props.lang], { + dateStyle: "short", + timeStyle: "short", +}); +--- + +
+
+ + Informações sobre o último commit que modificou ficheiros relacionados a + este blog post: + +
+
Hash
+
0x{hash.short.toUpperCase()}
+
Ficheiros modificados
+ { + files.length > 0 + ? files.map((file) => ( +
{file.path.pathname.replace(dir.pathname, "")}
+ )) + :
Nenhum ficheiro modificado
+ } +
+ Autor () +
+
+ {author.name} <{ + author.email + }> +
+
+ Commiter () +
+
+ {committer.name} <{ + committer.email + }> +
+ { + signature && + ( +
Assinatura do commit
+
+
+
Tipo
+
{signature.type}
+
Assinante
+
{signature.signer}
+
Fingerprint da chave
+
0x{signature.key.short}
+
+
+ ) + } +
+
+
+ + -- cgit v1.2.3