fast and minimal static site generator
ssg
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix newAtomLink behavior

Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.sh>

+2 -10
+2 -10
atom/feed.go
··· 114 return []byte(xml.Header + string(feedXML)), nil 115 } 116 117 - // Creates a new Atom link. 118 - // 119 - // Example: 120 - // 121 - // newAtomLink("https://example.com", "blog", "some-post") 122 - // // → <link href="https://blog.example.com/some-post"></link> 123 - func newAtomLink(base string, subdomain string, slug string) *AtomLink { 124 baseURL, err := url.Parse(base) 125 if err != nil { 126 return nil 127 } 128 129 - baseURL.Host = subdomain + "." + baseURL.Host 130 - baseURL.Path = slug 131 - 132 return &AtomLink{Href: baseURL.String()} 133 }
··· 114 return []byte(xml.Header + string(feedXML)), nil 115 } 116 117 + func newAtomLink(base, subDir, slug string) *AtomLink { 118 baseURL, err := url.Parse(base) 119 if err != nil { 120 return nil 121 } 122 123 + baseURL.Path = filepath.Join(subDir, slug) 124 return &AtomLink{Href: baseURL.String()} 125 }