Browse Source

Merge branch 'master' into branch 'Issue#162'

master
silberengel 11 months ago
parent
commit
5cebaf69da
No known key found for this signature in database
GPG Key ID: 962BEC8725790894
  1. 2
      src/lib/components/Login.svelte
  2. 18
      src/lib/components/util/CardActions.svelte
  3. 4
      src/lib/components/util/CopyToClipboard.svelte
  4. 10
      src/lib/components/util/Profile.svelte
  5. 8
      src/routes/about/+page.svelte
  6. 17
      vite.config.ts

2
src/lib/components/Login.svelte

@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
<Popover
class='popover-leather w-fit'
placement='bottom'
target='avatar'
triggeredBy='#avatar'
>
<div class='w-full flex space-x-2'>
<Button

18
src/lib/components/util/CardActions.svelte

@ -114,32 +114,32 @@ @@ -114,32 +114,32 @@
<div class='flex flex-col text-nowrap'>
<ul class="space-y-2">
<li>
<a href="" role="button" class='btn-leather' onclick={viewDetails}>
<button type="button" class='btn-leather' onclick={viewDetails}>
<EyeOutline class="inline mr-2" /> View details
</a>
</button>
</li>
<li>
<a role="button" class='btn-leather' onclick={shareNjump}>
<button type="button" class='btn-leather' onclick={shareNjump}>
{#if shareLinkCopied}
<ClipboardCheckOutline class="inline mr-2" /> Copied!
{:else}
<ShareNodesOutline class="inline mr-2" /> Share via NJump
{/if}
</a>
</button>
</li>
<li>
<a role="button" class='btn-leather' onclick={copyEventId}>
<button type="button" class='btn-leather' onclick={copyEventId}>
{#if eventIdCopied}
<ClipboardCheckOutline class="inline mr-2" /> Copied!
{:else}
<ClipboardCleanOutline class="inline mr-2" /> Copy event ID
{/if}
</a>
</button>
</li>
<li>
<a href="" role="button" class='btn-leather' onclick={viewJson}>
<button type="button" class='btn-leather' onclick={viewJson}>
<CodeOutline class="inline mr-2" /> View JSON
</a>
</button>
</li>
</ul>
</div>
@ -157,7 +157,7 @@ @@ -157,7 +157,7 @@
<div class="flex flex-row space-x-4">
{#if image}
<div class="flex col">
<img class="max-w-48" src={image} />
<img class="max-w-48" src={image} alt="Publication cover image for {title}" />
</div>
{/if}
<div class="flex flex-col col space-y-5 justify-center align-middle">

4
src/lib/components/util/CopyToClipboard.svelte

@ -18,10 +18,10 @@ @@ -18,10 +18,10 @@
}
</script>
<a role="button" class='btn-leather text-nowrap' onclick={copyToClipboard}>
<button type="button" class='btn-leather text-nowrap' onclick={copyToClipboard}>
{#if copied}
<ClipboardCheckOutline class="!fill-none dark:!fill-none inline mr-1" /> Copied!
{:else}
<ClipboardCleanOutline class="!fill-none dark:!fill-none inline mr-1" /> {displayText}
{/if}
</a>
</button>

10
src/lib/components/util/Profile.svelte

@ -46,10 +46,12 @@ function shortenNpub(long: string|undefined) { @@ -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}
<Popover
target="avatar"
placement="bottom"
triggeredBy="#profile-avatar"
class='popover-leather w-[180px]'
trigger='hover'
>
@ -70,15 +72,13 @@ function shortenNpub(long: string|undefined) { @@ -70,15 +72,13 @@ function shortenNpub(long: string|undefined) {
</li>
{#if isNav}
<li>
<a
href=""
<button
id='sign-out-button'
class='btn-leather text-nowrap mt-3 flex self-stretch align-middle hover:text-primary-400 dark:hover:text-primary-500'
onclick={handleSignOutClick}
role="button"
>
<ArrowRightToBracketOutline class='mr-1 !h-6 !w-6 inline !fill-none dark:!fill-none' /> Sign out
</a>
</button>
</li>
{:else}
<!-- li>

8
src/routes/about/+page.svelte

@ -1,10 +1,16 @@ @@ -1,10 +1,16 @@
<script lang='ts'>
import { Heading } from "flowbite-svelte";
// Get the git tag version from environment variables
const gitTagVersion = import.meta.env.GIT_TAG || 'development';
</script>
<div class='w-full flex justify-center'>
<main class='main-leather flex flex-col space-y-4 max-w-2xl w-full mt-4 mb-4'>
<Heading tag='h1' class='h-leather mb-2'>About</Heading>
<div class="flex justify-between items-center">
<Heading tag='h1' class='h-leather mb-2'>About</Heading>
<span class="text-sm bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded">Version: {gitTagVersion}</span>
</div>
<p>Alexandria is a reader and writer for <a href="https://github.com/nostr-protocol/nips/pull/1600" class='underline' target="_blank">curated publications</a> (in Asciidoc), and will eventually also support long-form articles (Markdown) and wiki pages (Asciidoc). It is produced by the <a href="https://wikistr.com/gitcitadel-project" class='underline' target="_blank">GitCitadel project team</a>.</p>
<p>Please submit support issues on the <a href="https://gitcitadel.com/r/naddr1qvzqqqrhnypzplfq3m5v3u5r0q9f255fdeyz8nyac6lagssx8zy4wugxjs8ajf7pqy88wumn8ghj7mn0wvhxcmmv9uqq5emfw33kjarpv3jkcs83wav" class='underline' target="_blank">project repo page</a> and follow us on <a href="https://github.com/ShadowySupercode/gitcitadel" class='underline' target="_blank">GitHub</a> and <a href="https://geyser.fund/project/gitcitadel" class='underline' target="_blank">Geyserfund</a>.</p>

17
vite.config.ts

@ -1,9 +1,26 @@ @@ -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())
}
});

Loading…
Cancel
Save