\ No newline at end of file
diff --git a/src/lib/utils/markup/MarkupInfo.md b/src/lib/utils/markup/MarkupInfo.md
index daa213a..70eb7fe 100644
--- a/src/lib/utils/markup/MarkupInfo.md
+++ b/src/lib/utils/markup/MarkupInfo.md
@@ -30,7 +30,7 @@ The **advanced markup parser** includes all features of the basic parser, plus:
- **Tables:** Pipe-delimited tables with or without headers
- **Footnotes:** `[^1]` or `[^Smith]`, which should appear where the footnote shall be placed, and will be displayed as unique, consecutive numbers
- **Footnote References:** `[^1]: footnote text` or `[^Smith]: Smith, Adam. 1984 "The Wiggle Mysteries`, which will be listed in order, at the bottom of the event, with back-reference links to the footnote, and text footnote labels appended
-- **Wikilinks:** `[[NIP-54]]` will render as a hyperlink and goes to [NIP-54](./wiki?d=nip-54)
+- **Wikilinks:** `[[NIP-54]]` will render as a hyperlink and goes to [NIP-54](./events?d=nip-54)
## Publications and Wikis
diff --git a/src/lib/utils/markup/basicMarkupParser.ts b/src/lib/utils/markup/basicMarkupParser.ts
index d0d6ff1..a79833b 100644
--- a/src/lib/utils/markup/basicMarkupParser.ts
+++ b/src/lib/utils/markup/basicMarkupParser.ts
@@ -142,7 +142,7 @@ function replaceWikilinks(text: string): string {
return text.replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g, (_match, target, label) => {
const normalized = normalizeDTag(target.trim());
const display = (label || target).trim();
- const url = `./wiki?d=${normalized}`;
+ const url = `./events?d=${normalized}`;
// Output as a clickable with the [[display]] format and matching link colors
return `${display}`;
});
diff --git a/src/routes/events/+page.svelte b/src/routes/events/+page.svelte
index 9b575ca..20f8cf5 100644
--- a/src/routes/events/+page.svelte
+++ b/src/routes/events/+page.svelte
@@ -7,11 +7,15 @@
import EventDetails from '$lib/components/EventDetails.svelte';
import RelayActions from '$lib/components/RelayActions.svelte';
import CommentBox from '$lib/components/CommentBox.svelte';
+ import { userBadge } from '$lib/snippets/UserSnippets.svelte';
+ import { getMatchingTags, toNpub } from '$lib/utils/nostrUtils';
let loading = $state(false);
let error = $state(null);
let searchValue = $state(null);
+ let dTagValue = $state(null);
let event = $state(null);
+ let searchResults = $state([]);
let profile = $state<{
name?: string;
display_name?: string;
@@ -27,6 +31,7 @@
function handleEventFound(newEvent: NDKEvent) {
event = newEvent;
+ searchResults = [];
if (newEvent.kind === 0) {
try {
profile = JSON.parse(newEvent.content);
@@ -38,10 +43,33 @@
}
}
+ function handleSearchResults(results: NDKEvent[]) {
+ searchResults = results;
+ event = null;
+ profile = null;
+ }
+
+ function getSummary(event: NDKEvent): string | undefined {
+ return getMatchingTags(event, 'summary')[0]?.[1];
+ }
+
+ function getDeferrelNaddr(event: NDKEvent): string | undefined {
+ // Look for a 'deferrel' tag, e.g. ['deferrel', 'naddr1...']
+ return getMatchingTags(event, 'deferrel')[0]?.[1];
+ }
+
$effect(() => {
const id = $page.url.searchParams.get('id');
+ const dTag = $page.url.searchParams.get('d');
+
if (id !== searchValue) {
searchValue = id;
+ dTagValue = null;
+ }
+
+ if (dTag !== dTagValue) {
+ dTagValue = dTag;
+ searchValue = null;
}
});
@@ -60,9 +88,19 @@
Use this page to view any event (npub, nprofile, nevent, naddr, note, pubkey, or eventID).
+ You can also search for events by d-tag using the format "d:tag-name".