Skip to content

Commit

Permalink
Add blogroll header
Browse files Browse the repository at this point in the history
  • Loading branch information
jlelse committed May 21, 2024
1 parent e14104c commit 7da7cd3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 1 addition & 4 deletions ntfy.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import (
)

func (ntfy *configNtfy) enabled() bool {
if ntfy == nil || !ntfy.Enabled || ntfy.Topic == "" {
return false
}
return true
return ntfy != nil && ntfy.Enabled && ntfy.Topic != ""
}

func (a *goBlog) sendNtfy(cfg *configNtfy, msg string) error {
Expand Down
5 changes: 5 additions & 0 deletions ui.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"cmp"
"fmt"
"time"

Expand Down Expand Up @@ -45,6 +46,10 @@ func (a *goBlog) renderBase(hb *htmlbuilder.HtmlBuilder, rd *renderData, title,
hb.WriteElementOpen("link", "rel", "alternate", "type", "application/rss+xml", "title", fmt.Sprintf("RSS (%s)", renderedBlogTitle), "href", a.getFullAddress(rd.Blog.Path+".rss"))
hb.WriteElementOpen("link", "rel", "alternate", "type", "application/atom+xml", "title", fmt.Sprintf("ATOM (%s)", renderedBlogTitle), "href", a.getFullAddress(rd.Blog.Path+".atom"))
hb.WriteElementOpen("link", "rel", "alternate", "type", "application/feed+json", "title", fmt.Sprintf("JSON Feed (%s)", renderedBlogTitle), "href", a.getFullAddress(rd.Blog.Path+".json"))
// Blogroll
if brConf := rd.Blog.Blogroll; brConf != nil && brConf.Enabled {
hb.WriteElementOpen("link", "rel", "blogroll", "type", "text/xml", "href", rd.Blog.getRelativePath(cmp.Or(brConf.Path, defaultBlogrollPath)+".opml"))
}
// Webmentions
hb.WriteElementOpen("link", "rel", "webmention", "href", a.getFullAddress("/webmention"))
// Micropub
Expand Down

0 comments on commit 7da7cd3

Please sign in to comment.