|
|
|
@ -374,11 +374,19 @@ func (g *HTMLGenerator) GenerateLandingPage(wikiPages []WikiPageInfo, newestBlog |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Use default OpenGraph image for all pages
|
|
|
|
|
|
|
|
ogImage := g.siteURL + g.defaultImage |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
description := "Welcome to " + g.siteName |
|
|
|
|
|
|
|
if newestBlogItem != nil || newestArticleItem != nil { |
|
|
|
|
|
|
|
description = "Latest content from " + g.siteName |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
data := PageData{ |
|
|
|
data := PageData{ |
|
|
|
Title: "Home", |
|
|
|
Title: "Home", |
|
|
|
Description: "Welcome to " + g.siteName, |
|
|
|
Description: description, |
|
|
|
CanonicalURL: g.siteURL + "/", |
|
|
|
CanonicalURL: g.siteURL + "/", |
|
|
|
OGImage: g.siteURL + g.defaultImage, |
|
|
|
OGImage: ogImage, |
|
|
|
OGType: "website", |
|
|
|
OGType: "website", |
|
|
|
SiteName: g.siteName, |
|
|
|
SiteName: g.siteName, |
|
|
|
SiteURL: g.siteURL, |
|
|
|
SiteURL: g.siteURL, |
|
|
|
@ -437,16 +445,21 @@ func (g *HTMLGenerator) GenerateWikiPage(wiki *nostr.WikiEvent, wikiPages []Wiki |
|
|
|
|
|
|
|
|
|
|
|
description := wiki.Summary |
|
|
|
description := wiki.Summary |
|
|
|
if description == "" { |
|
|
|
if description == "" { |
|
|
|
description = wiki.Title |
|
|
|
description = wiki.Title + " - Wiki article from " + g.siteName |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
description = description + " - " + g.siteName + " Wiki" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
canonicalURL := g.siteURL + "/wiki/" + wiki.DTag |
|
|
|
canonicalURL := g.siteURL + "/wiki/" + wiki.DTag |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Use default OpenGraph image for all pages
|
|
|
|
|
|
|
|
ogImage := g.siteURL + g.defaultImage |
|
|
|
|
|
|
|
|
|
|
|
data := PageData{ |
|
|
|
data := PageData{ |
|
|
|
Title: wiki.Title, |
|
|
|
Title: wiki.Title, |
|
|
|
Description: description, |
|
|
|
Description: description, |
|
|
|
CanonicalURL: canonicalURL, |
|
|
|
CanonicalURL: canonicalURL, |
|
|
|
OGImage: g.siteURL + g.defaultImage, |
|
|
|
OGImage: ogImage, |
|
|
|
OGType: "article", |
|
|
|
OGType: "article", |
|
|
|
SiteName: g.siteName, |
|
|
|
SiteName: g.siteName, |
|
|
|
SiteURL: g.siteURL, |
|
|
|
SiteURL: g.siteURL, |
|
|
|
@ -496,11 +509,20 @@ func (g *HTMLGenerator) GenerateBlogPage(blogIndex *nostr.IndexEvent, blogItems |
|
|
|
ctx := context.Background() |
|
|
|
ctx := context.Background() |
|
|
|
profiles := g.fetchProfilesBatch(ctx, pubkeys) |
|
|
|
profiles := g.fetchProfilesBatch(ctx, pubkeys) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Use default OpenGraph image for all pages
|
|
|
|
|
|
|
|
ogImage := g.siteURL + g.defaultImage |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Use blog index title if available, otherwise default to "Blog"
|
|
|
|
|
|
|
|
title := blogIndex.Title |
|
|
|
|
|
|
|
if title == "" { |
|
|
|
|
|
|
|
title = "Blog" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
data := PageData{ |
|
|
|
data := PageData{ |
|
|
|
Title: "Blog", |
|
|
|
Title: title, |
|
|
|
Description: description, |
|
|
|
Description: description, |
|
|
|
CanonicalURL: canonicalURL, |
|
|
|
CanonicalURL: canonicalURL, |
|
|
|
OGImage: g.siteURL + g.defaultImage, |
|
|
|
OGImage: ogImage, |
|
|
|
OGType: "website", |
|
|
|
OGType: "website", |
|
|
|
SiteName: g.siteName, |
|
|
|
SiteName: g.siteName, |
|
|
|
SiteURL: g.siteURL, |
|
|
|
SiteURL: g.siteURL, |
|
|
|
@ -575,11 +597,14 @@ func (g *HTMLGenerator) GenerateArticlesPage(articleItems []ArticleItemInfo, fee |
|
|
|
ctx := context.Background() |
|
|
|
ctx := context.Background() |
|
|
|
profiles := g.fetchProfilesBatch(ctx, pubkeys) |
|
|
|
profiles := g.fetchProfilesBatch(ctx, pubkeys) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Use default OpenGraph image for all pages
|
|
|
|
|
|
|
|
ogImage := g.siteURL + g.defaultImage |
|
|
|
|
|
|
|
|
|
|
|
data := PageData{ |
|
|
|
data := PageData{ |
|
|
|
Title: "Articles", |
|
|
|
Title: "Articles", |
|
|
|
Description: description, |
|
|
|
Description: description, |
|
|
|
CanonicalURL: canonicalURL, |
|
|
|
CanonicalURL: canonicalURL, |
|
|
|
OGImage: g.siteURL + g.defaultImage, |
|
|
|
OGImage: ogImage, |
|
|
|
OGType: "website", |
|
|
|
OGType: "website", |
|
|
|
SiteName: g.siteName, |
|
|
|
SiteName: g.siteName, |
|
|
|
SiteURL: g.siteURL, |
|
|
|
SiteURL: g.siteURL, |
|
|
|
@ -626,6 +651,11 @@ func (g *HTMLGenerator) GenerateWikiIndexPage(wikiIndex *nostr.IndexEvent, wikiP |
|
|
|
|
|
|
|
|
|
|
|
canonicalURL := g.siteURL + "/wiki" |
|
|
|
canonicalURL := g.siteURL + "/wiki" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Enhanced description for wiki index
|
|
|
|
|
|
|
|
if description == "" { |
|
|
|
|
|
|
|
description = "Browse wiki documentation and articles from " + g.siteName |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
data := PageData{ |
|
|
|
data := PageData{ |
|
|
|
Title: "Wiki", |
|
|
|
Title: "Wiki", |
|
|
|
Description: description, |
|
|
|
Description: description, |
|
|
|
@ -664,11 +694,19 @@ func (g *HTMLGenerator) GenerateEBooksPage(ebooks []EBookInfo, feedItems []FeedI |
|
|
|
ctx := context.Background() |
|
|
|
ctx := context.Background() |
|
|
|
profiles := g.fetchProfilesBatch(ctx, pubkeys) |
|
|
|
profiles := g.fetchProfilesBatch(ctx, pubkeys) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Use default OpenGraph image for all pages
|
|
|
|
|
|
|
|
ogImage := g.siteURL + g.defaultImage |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
description := "Browse top-level publications (index events) from Nostr" |
|
|
|
|
|
|
|
if len(formattedEBooks) > 0 { |
|
|
|
|
|
|
|
description = fmt.Sprintf("Browse %d e-books and publications from Nostr", len(formattedEBooks)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
data := PageData{ |
|
|
|
data := PageData{ |
|
|
|
Title: "E-Books", |
|
|
|
Title: "E-Books", |
|
|
|
Description: "Browse top-level publications (index events) from Nostr", |
|
|
|
Description: description, |
|
|
|
CanonicalURL: canonicalURL, |
|
|
|
CanonicalURL: canonicalURL, |
|
|
|
OGImage: g.siteURL + g.defaultImage, |
|
|
|
OGImage: ogImage, |
|
|
|
OGType: "website", |
|
|
|
OGType: "website", |
|
|
|
SiteName: g.siteName, |
|
|
|
SiteName: g.siteName, |
|
|
|
SiteURL: g.siteURL, |
|
|
|
SiteURL: g.siteURL, |
|
|
|
@ -710,10 +748,15 @@ func (g *HTMLGenerator) GenerateContactPage(success bool, errorMsg string, event |
|
|
|
FormData ContactFormData |
|
|
|
FormData ContactFormData |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
description := "Get in touch with " + g.siteName |
|
|
|
|
|
|
|
if repoAnnouncement != nil && repoAnnouncement.DTag != "" { |
|
|
|
|
|
|
|
description = "Contact " + g.siteName + " - Submit issues, feedback, or questions" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
data := ContactPageData{ |
|
|
|
data := ContactPageData{ |
|
|
|
PageData: PageData{ |
|
|
|
PageData: PageData{ |
|
|
|
Title: "Contact", |
|
|
|
Title: "Contact", |
|
|
|
Description: "Contact " + g.siteName, |
|
|
|
Description: description, |
|
|
|
CanonicalURL: g.siteURL + "/contact", |
|
|
|
CanonicalURL: g.siteURL + "/contact", |
|
|
|
OGImage: g.siteURL + g.defaultImage, |
|
|
|
OGImage: g.siteURL + g.defaultImage, |
|
|
|
OGType: "website", |
|
|
|
OGType: "website", |
|
|
|
@ -863,9 +906,14 @@ func (g *HTMLGenerator) GenerateFeedPage(feedItems []FeedItemInfo) (string, erro |
|
|
|
ctx := context.Background() |
|
|
|
ctx := context.Background() |
|
|
|
profiles := g.fetchProfilesBatch(ctx, pubkeys) |
|
|
|
profiles := g.fetchProfilesBatch(ctx, pubkeys) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
description := "Recent notes from TheForest relay" |
|
|
|
|
|
|
|
if len(feedItems) > 0 { |
|
|
|
|
|
|
|
description = fmt.Sprintf("Browse %d recent notes from TheForest relay", len(feedItems)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
data := PageData{ |
|
|
|
data := PageData{ |
|
|
|
Title: "TheForest Feed", |
|
|
|
Title: "TheForest Feed", |
|
|
|
Description: "Recent notes from TheForest relay", |
|
|
|
Description: description, |
|
|
|
CanonicalURL: canonicalURL, |
|
|
|
CanonicalURL: canonicalURL, |
|
|
|
OGImage: g.siteURL + g.defaultImage, |
|
|
|
OGImage: g.siteURL + g.defaultImage, |
|
|
|
OGType: "website", |
|
|
|
OGType: "website", |
|
|
|
|