From 4a2640e0b42e86ae6d815dfc7273ad696b57edff Mon Sep 17 00:00:00 2001 From: Silberengel Date: Sat, 5 Apr 2025 10:40:27 +0200 Subject: [PATCH 1/8] Pull the latest tag from git, on build, and display it top-right on the About page. --- src/routes/about/+page.svelte | 10 ++++++++-- vite.config.ts | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte index 9e4ee80..00a14c8 100644 --- a/src/routes/about/+page.svelte +++ b/src/routes/about/+page.svelte @@ -1,10 +1,16 @@
- About +
+ About + Version: {gitTagVersion} +

Alexandria is a reader and writer for curated publications (in Asciidoc), and will eventually also support long-form articles (Markdown) and wiki pages (Asciidoc). It is produced by the GitCitadel project team.

Please submit support issues on the project repo page and follow us on GitHub and Geyserfund.

@@ -53,4 +59,4 @@

Documentation

-
\ No newline at end of file + diff --git a/vite.config.ts b/vite.config.ts index b9ba52c..7a6e207 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,9 +1,26 @@ import { sveltekit } from "@sveltejs/kit/vite"; import { defineConfig } from "vite"; +import { execSync } from "child_process"; + +// Function to get the latest git tag +function getLatestGitTag() { + try { + // Get the latest git tag + const tag = execSync('git describe --tags --abbrev=0').toString().trim(); + return tag; + } catch (error) { + console.error("Failed to get git tag:", error); + return "unknown"; + } +} export default defineConfig({ plugins: [sveltekit()], test: { include: ['./tests/unit/**/*.unit-test.js'] + }, + define: { + // Expose the git tag as a global variable + 'import.meta.env.GIT_TAG': JSON.stringify(getLatestGitTag()) } }); From b763ecd99f09373c69770717025e84e739a8df3b Mon Sep 17 00:00:00 2001 From: Silberengel Date: Sat, 5 Apr 2025 11:47:23 +0200 Subject: [PATCH 2/8] Refactored a bit. Changed a tags to buttons that look like hyperlinks, to preserve normal button functionality. --- src/lib/components/Login.svelte | 2 +- src/lib/components/util/CardActions.svelte | 18 +++++++++--------- src/lib/components/util/CopyToClipboard.svelte | 4 ++-- src/lib/components/util/Profile.svelte | 10 +++++----- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/lib/components/Login.svelte b/src/lib/components/Login.svelte index 2d77763..1456149 100644 --- a/src/lib/components/Login.svelte +++ b/src/lib/components/Login.svelte @@ -50,7 +50,7 @@ @@ -157,7 +157,7 @@
{#if image}
- + Publication cover image for {title}
{/if}
diff --git a/src/lib/components/util/CopyToClipboard.svelte b/src/lib/components/util/CopyToClipboard.svelte index 9e72c79..63f1aa7 100644 --- a/src/lib/components/util/CopyToClipboard.svelte +++ b/src/lib/components/util/CopyToClipboard.svelte @@ -18,10 +18,10 @@ } - + diff --git a/src/lib/components/util/Profile.svelte b/src/lib/components/util/Profile.svelte index fd23c9f..a44cba1 100644 --- a/src/lib/components/util/Profile.svelte +++ b/src/lib/components/util/Profile.svelte @@ -46,10 +46,12 @@ function shortenNpub(long: string|undefined) { class='h-6 w-6 cursor-pointer' src={pfp} alt={username} + id="profile-avatar" /> {#key username || tag} @@ -70,15 +72,13 @@ function shortenNpub(long: string|undefined) { {#if isNav}
  • - Sign out - +
  • {:else}