htmlized = append(htmlized, lineURLize(cfg.AtomBaseURL+cfg.URLPrefix, l))
}
htmlized = append(htmlized, "</pre>")
+ links := []atom.Link{{
+ Rel: "alternate",
+ Href: cfg.AtomBaseURL + cfg.URLPrefix + "/" + commit.Hash.String(),
+ }}
+ for _, img := range listImgs(cfg, commit.Hash) {
+ links = append(links, atom.Link{
+ Rel: "enclosure",
+ Href: "http://" + cfg.ImgDomain + "/" + img.Path,
+ Type: img.Typ,
+ Length: uint(img.Size),
+ })
+ }
feed.Entry = append(feed.Entry, &atom.Entry{
- Title: lines[0],
- ID: "urn:uuid:" + bytes2uuid(commit.Hash[:]),
- Link: []atom.Link{{
- Rel: "alternate",
- Href: cfg.AtomBaseURL + cfg.URLPrefix + "/" + commit.Hash.String(),
- }},
+ Title: lines[0],
+ ID: "urn:uuid:" + bytes2uuid(commit.Hash[:]),
+ Link: links,
Published: atom.Time(commit.Author.When),
Updated: atom.Time(commit.Author.When),
Summary: &atom.Text{Type: "text", Body: lines[0]},
NoteLines []string
Comments []CommentEntry
Topics []string
+ Imgs []Img
}{
T: localizer,
Version: sgblog.Version,
NoteLines: notesLines,
Comments: comments,
Topics: sgblog.ParseTopics(topicsRaw),
+ Imgs: listImgs(cfg, commit.Hash),
})
if err != nil {
makeErr(err, http.StatusInternalServerError)