From aa64a9d413283a5ea90ecd4bdcb665b55821aa59 Mon Sep 17 00:00:00 2001 From: Silberengel Date: Mon, 16 Feb 2026 10:49:28 +0100 Subject: [PATCH] bug-fixes --- internal/nostr/wiki.go | 24 ++- static/css/main.css | 301 ++++++++++++++++++++++++++++++++++++-- templates/base.html | 17 +-- templates/blog.html | 2 +- templates/components.html | 4 +- templates/contact.html | 36 ++--- templates/ebooks.html | 18 +-- templates/landing.html | 34 ++++- 8 files changed, 363 insertions(+), 73 deletions(-) diff --git a/internal/nostr/wiki.go b/internal/nostr/wiki.go index 2fc53e7..d8c1145 100644 --- a/internal/nostr/wiki.go +++ b/internal/nostr/wiki.go @@ -137,9 +137,17 @@ func (ws *WikiService) FetchWikiEvents(ctx context.Context, index *IndexEvent) ( } } - // Convert matched events to wiki events + // Convert matched events to wiki events, preserving order from index.Items var wikiEvents []*WikiEvent - for key, event := range eventMap { + for _, item := range index.Items { + if item.Kind != ws.wikiKind { + continue + } + key := fmt.Sprintf("%d:%s:%s", item.Kind, item.Pubkey, item.DTag) + event, exists := eventMap[key] + if !exists { + continue + } wiki, err := ParseWikiEvent(event, ws.wikiKind) if err != nil { logger.WithFields(map[string]interface{}{ @@ -292,9 +300,17 @@ func (ws *WikiService) FetchIndexEvents(ctx context.Context, index *IndexEvent, } } - // Convert to result slice + // Convert to result slice, preserving order from index.Items events := make([]*nostr.Event, 0, len(eventMap)) - for _, event := range eventMap { + for _, item := range index.Items { + if item.Kind != targetKind { + continue + } + key := fmt.Sprintf("%d:%s:%s", item.Kind, item.Pubkey, item.DTag) + event, exists := eventMap[key] + if !exists { + continue + } events = append(events, event) } diff --git a/static/css/main.css b/static/css/main.css index b1c8ebc..b2d16e6 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -45,19 +45,18 @@ body { flex-direction: column; margin: 0; padding: 0; - padding-top: 80px; /* Space for fixed header */ } /* Skip link for accessibility */ .skip-link { - position: fixed; + position: absolute; top: -40px; left: 0; background: var(--accent-color); color: var(--bg-primary); padding: 8px; text-decoration: none; - z-index: 1001; /* Above fixed header */ + z-index: 1001; } .skip-link:focus { @@ -68,16 +67,10 @@ body { header { background-color: var(--bg-secondary); border-bottom: 1px solid var(--border-color); - position: fixed; - top: 0; - left: 0; - right: 0; width: 100%; - z-index: 1000; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); margin: 0; padding: 0; - will-change: transform; /* Optimize for fixed positioning */ } .navbar { @@ -130,6 +123,8 @@ header { margin: 0; padding: 0; list-style: none; + display: flex; + align-items: center; } .nav-menu a { @@ -140,6 +135,7 @@ header { align-items: center; gap: 0.5rem; padding: 0.5rem 0; + line-height: 1.2; } .nav-menu a:hover { @@ -357,12 +353,12 @@ a:focus { display: inline-block; padding: 0.75rem 1.5rem; background: var(--accent-color); - color: var(--bg-primary); + color: #ffffff; border: none; border-radius: 4px; cursor: pointer; text-decoration: none; - font-weight: 500; + font-weight: 600; transition: background 0.2s; } @@ -384,6 +380,144 @@ a:focus { outline-offset: var(--focus-offset); } +/* Landing Page Styles */ +.landing-page { + max-width: 1200px; + margin: 0 auto; + padding: 2rem; +} + +.landing-page .hero { + text-align: center; + margin-bottom: 3rem; + padding: 2rem 0; +} + +.landing-page .hero h1 { + font-size: 2.5rem; + margin-bottom: 1rem; +} + +.landing-page .hero .lead { + font-size: 1.25rem; + color: var(--text-secondary); + max-width: 600px; + margin: 0 auto; +} + +.landing-page .feed-section { + margin: 2rem 0; + max-width: 100%; +} + +.landing-page .feed-section .feed-container { + max-width: 100%; + margin: 0 auto; +} + +.landing-page .features { + margin-top: 3rem; +} + +.landing-page .features h2 { + text-align: center; + margin-bottom: 2rem; + font-size: 2rem; +} + +.feature-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + gap: 2rem; + margin-top: 2rem; +} + +.feature-card { + background: var(--bg-secondary); + padding: 2rem; + border-radius: 8px; + border: 1px solid var(--border-color); + display: flex; + flex-direction: column; +} + +.feature-card h3 { + margin-bottom: 1rem; + font-size: 1.25rem; + display: flex; + align-items: center; + gap: 0.5rem; +} + +.feature-card p { + margin-bottom: 1.5rem; + color: var(--text-secondary); + flex-grow: 1; +} + +.feature-card ul { + list-style: none; + margin: 0; + padding: 0; + margin-bottom: 1.5rem; +} + +.feature-card ul li { + margin-bottom: 0.5rem; +} + +.feature-card ul li a { + display: flex; + align-items: center; + gap: 0.5rem; + color: var(--link-color); + text-decoration: none; +} + +.feature-card ul li a:hover { + color: var(--link-hover); + text-decoration: underline; +} + +/* Wiki Links Grid */ +.feature-card .wiki-links { + display: flex; + flex-wrap: wrap; + gap: 0.75rem; + margin-bottom: 1.5rem; +} + +.feature-card .wiki-link { + display: inline-block; + padding: 0.5rem 1rem; + background: var(--bg-primary); + color: var(--text-primary); + text-decoration: none; + border-radius: 6px; + border: 1px solid var(--border-color); + font-size: 0.9rem; + transition: all 0.2s; + white-space: nowrap; +} + +.feature-card .wiki-link:hover { + background: var(--accent-color); + color: #ffffff; + border-color: var(--accent-color); + transform: translateY(-1px); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); +} + +.feature-card .wiki-link:focus-visible { + outline: var(--focus-outline); + outline-offset: var(--focus-offset); +} + +.feature-card .btn { + margin-top: auto; + align-self: flex-start; +} + /* Articles and Pages */ article { background: var(--bg-secondary); @@ -818,6 +952,136 @@ textarea:focus-visible { padding: 2rem; } +.contact-links { + margin-bottom: 2rem; + padding: 1rem; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 8px; +} + +.contact-links h2 { + margin-top: 0; + margin-bottom: 1rem; + font-size: 1.2rem; + color: var(--text-primary); +} + +.contact-links ul { + list-style: none; + padding: 0; + margin: 0; +} + +.contact-links li { + margin-bottom: 0.5rem; +} + +.contact-links a { + color: var(--link-color); + text-decoration: none; + display: inline-flex; + align-items: center; + gap: 0.5rem; + transition: color 0.2s; +} + +.contact-links a:hover { + color: var(--link-hover); + text-decoration: underline; +} + +.contact-links a:focus-visible { + outline: var(--focus-outline); + outline-offset: var(--focus-offset); + border-radius: 2px; +} + +.nostr-profile { + margin-bottom: 2rem; + padding: 1rem; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 8px; +} + +.nostr-profile h2 { + margin-top: 0; + margin-bottom: 1rem; + font-size: 1.2rem; + color: var(--text-primary); +} + +.nostr-profile-content { + display: flex; + gap: 1rem; + align-items: flex-start; +} + +.nostr-profile-picture { + width: 80px; + height: 80px; + border-radius: 50%; + object-fit: cover; + border: 2px solid var(--border-color); +} + +.nostr-profile-info { + flex: 1; +} + +.nostr-profile-info h3 { + margin: 0 0 0.5rem 0; + font-size: 1.1rem; + color: var(--text-primary); +} + +.nostr-profile-name { + margin: 0 0 0.5rem 0; + color: var(--text-secondary); + font-size: 0.9rem; +} + +.nostr-profile-about { + margin: 0 0 0.5rem 0; + color: var(--text-primary); + white-space: pre-wrap; + line-height: 1.6; +} + +.nostr-profile-website { + margin: 0.5rem 0 0 0; +} + +.nostr-profile-website a { + color: var(--link-color); + text-decoration: none; + display: inline-flex; + align-items: center; + gap: 0.5rem; + transition: color 0.2s; +} + +.nostr-profile-website a:hover { + color: var(--link-hover); + text-decoration: underline; +} + +.nostr-profile-website a:focus-visible { + outline: var(--focus-outline); + outline-offset: var(--focus-offset); + border-radius: 2px; +} + +.nostr-profile-nip05 { + margin: 0.5rem 0 0 0; + color: var(--text-secondary); + font-size: 0.9rem; + display: flex; + align-items: center; + gap: 0.5rem; +} + .contact-form { margin-top: 2rem; } @@ -896,7 +1160,7 @@ textarea:focus-visible { .btn-primary { background: var(--accent-color); - color: var(--bg-primary); + color: #ffffff; } .btn-primary:hover { @@ -1034,7 +1298,9 @@ textarea:focus-visible { /* Icon styles for Lucide icons */ .icon-inline { - display: inline-block; + display: inline-flex; + align-items: center; + justify-content: center; width: 1em; height: 1em; vertical-align: middle; @@ -1042,6 +1308,12 @@ textarea:focus-visible { flex-shrink: 0; } +.nav-menu .icon-inline { + margin-right: 0; + width: 1.2em; + height: 1.2em; +} + /* User Badge Styles */ .user-badge { display: inline-flex; @@ -1106,8 +1378,9 @@ p.icon-inline, h1.icon-inline, h2.icon-inline, h3.icon-inline, h4.icon-inline, h display: inline-flex; } -/* Navigation links should be flex */ +/* Navigation links should be flex with proper alignment */ .nav-menu a, .dropdown-menu a, .wiki-menu a { + align-items: center; display: inline-flex; align-items: center; gap: 0.5rem; diff --git a/templates/base.html b/templates/base.html index 5730374..bcb3ffd 100644 --- a/templates/base.html +++ b/templates/base.html @@ -48,18 +48,11 @@ diff --git a/templates/blog.html b/templates/blog.html index 5575687..5fa7bf8 100644 --- a/templates/blog.html +++ b/templates/blog.html @@ -13,7 +13,7 @@ {{end}}

{{if .BlogIndexTitle}}{{.BlogIndexTitle}}{{else}}Blog{{end}}

{{if .BlogIndexAuthor}} -

by {{.BlogIndexAuthor}}

+

by {{template "user-badge-simple" (dict "Pubkey" .BlogIndexAuthor "Profiles" $.Profiles)}}

{{end}} {{if .BlogIndexSummary}}

{{.BlogIndexSummary}}

diff --git a/templates/components.html b/templates/components.html index e0a31d0..8c25bdc 100644 --- a/templates/components.html +++ b/templates/components.html @@ -37,9 +37,9 @@ {{/* Wiki Sidebar Component - Reusable wiki navigation */}} {{define "wiki-sidebar"}} -