From d4876f42f6e1dd4608c93cbd66ab4e5ed746699a Mon Sep 17 00:00:00 2001 From: Allan Lasser Date: Tue, 10 Dec 2024 14:09:47 -0500 Subject: [PATCH] Add published URL and source to document metadata --- src/lib/components/documents/Metadata.svelte | 20 ++++++++++++ .../documents/stories/Metadata.stories.svelte | 31 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 src/lib/components/documents/stories/Metadata.stories.svelte diff --git a/src/lib/components/documents/Metadata.svelte b/src/lib/components/documents/Metadata.svelte index 69983a0f9..1d2f357ea 100644 --- a/src/lib/components/documents/Metadata.svelte +++ b/src/lib/components/documents/Metadata.svelte @@ -15,6 +15,7 @@ import { LANGUAGE_MAP } from "@/config/config.js"; import { userOrgString } from "$lib/api/documents"; import Metadata from "../common/Metadata.svelte"; + import { LinkExternal16 } from "svelte-octicons"; export let document: Document; export let text: Maybe; @@ -44,6 +45,19 @@
+ {#if document.published_url} + + + {new URL(document.published_url).hostname} + + + + {/if} + {#if document.source} + + {document.source} + + {/if} {userOrgString(document)} @@ -70,4 +84,10 @@ gap: 1rem; padding: 0 0.5rem 1rem 0; } + .publishedUrl { + display: flex; + align-items: center; + fill: var(--blue-3); + gap: 0.25rem; + } diff --git a/src/lib/components/documents/stories/Metadata.stories.svelte b/src/lib/components/documents/stories/Metadata.stories.svelte new file mode 100644 index 000000000..2eee9eebc --- /dev/null +++ b/src/lib/components/documents/stories/Metadata.stories.svelte @@ -0,0 +1,31 @@ + + + + +