+2
-10
atom/feed.go
+2
-10
atom/feed.go
···
114
114
return []byte(xml.Header + string(feedXML)), nil
115
115
}
116
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 {
117
+
func newAtomLink(base, subDir, slug string) *AtomLink {
124
118
baseURL, err := url.Parse(base)
125
119
if err != nil {
126
120
return nil
127
121
}
128
122
129
-
baseURL.Host = subdomain + "." + baseURL.Host
130
-
baseURL.Path = slug
131
-
123
+
baseURL.Path = filepath.Join(subDir, slug)
132
124
return &AtomLink{Href: baseURL.String()}
133
125
}