feat(frontend): show latest tag in footer

This commit is contained in:
Sam 2023-03-14 22:39:56 +01:00
parent 6c863bea96
commit 52606e850d
No known key found for this signature in database
GPG Key ID: B4EF20DDE721CAA1
2 changed files with 7 additions and 3 deletions

View File

@ -8,7 +8,11 @@
export let data: LayoutData;
const versionMismatch = data.git_commit !== version && data.git_commit !== "[unknown]";
const versionParts = version.split("-");
let commit = "[unknown]";
if (versionParts.length >= 3) commit = versionParts[2];
const versionMismatch = data.git_commit !== commit && data.git_commit !== "[unknown]";
</script>
<svelte:head>
@ -23,7 +27,7 @@
<footer>
<hr />
<p>
pronouns.cc <a href="https://codeberg.org/u1f320/pronouns.cc/commit/{version}">{version}</a>
pronouns.cc <a href="https://codeberg.org/u1f320/pronouns.cc/commit/{commit}">{version}</a>
{#if versionMismatch}
(backend: <a href="https://codeberg.org/u1f320/pronouns.cc/commit/{data.git_commit}">
{data.git_commit}

View File

@ -11,7 +11,7 @@ const config = {
kit: {
adapter: adapter(),
version: {
name: child_process.execSync("git rev-parse --short HEAD").toString().trim(),
name: child_process.execSync("git describe --tags --long").toString().trim(),
},
},
};