break
}
etagHash.Write(commit.Hash[:])
- commentsRaw := getNote(commentsTree, commit.Hash)
+ commentsRaw := sgblog.GetNote(repo, commentsTree, commit.Hash)
etagHash.Write(commentsRaw)
- topicsRaw := getNote(topicsTree, commit.Hash)
+ topicsRaw := sgblog.GetNote(repo, topicsTree, commit.Hash)
etagHash.Write(topicsRaw)
entries = append(entries, TableEntry{
Commit: commit,
}
entry.DomainURLs = append(entry.DomainURLs, makeA(line, u.Host))
}
- entry.CommentsNum = len(parseComments(entry.CommentsRaw))
- entry.Topics = parseTopics(entry.TopicsRaw)
+ entry.CommentsNum = len(sgblog.ParseComments(entry.CommentsRaw))
+ entry.Topics = sgblog.ParseTopics(entry.TopicsRaw)
entries[i] = entry
}
offsetPrev := offset - PageEntries
}
lines := msgSplit(commit.Message)
var categories []atom.Category
- for _, topic := range parseTopics(getNote(topicsTree, commit.Hash)) {
+ for _, topic := range sgblog.ParseTopics(sgblog.GetNote(repo, topicsTree, commit.Hash)) {
categories = append(categories, atom.Category{Term: topic})
}
htmlized := make([]string, 0, len(lines))
if err != nil {
continue
}
- comments := parseComments(getNote(t, commentedHash))
+ comments := sgblog.ParseComments(sgblog.GetNote(repo, t, commentedHash))
if len(comments) == 0 {
continue
}
cfg.AtomBaseURL, cfg.URLPrefix, "/",
commit.Hash.String(), "/", AtomCommentsFeed,
}, "")
- commentsRaw := getNote(commentsTree, commit.Hash)
+ commentsRaw := sgblog.GetNote(repo, commentsTree, commit.Hash)
etagHash.Write(commentsRaw)
- topicsRaw := getNote(topicsTree, commit.Hash)
+ topicsRaw := sgblog.GetNote(repo, topicsTree, commit.Hash)
etagHash.Write(topicsRaw)
if strings.HasSuffix(pathInfo, AtomCommentsFeed) {
etagHash.Write([]byte("ATOM COMMENTS"))
date string
body []string
}
- commentsRaw := parseComments(commentsRaw)
+ commentsRaw := sgblog.ParseComments(commentsRaw)
var toSkip int
if len(commentsRaw) > PageEntries {
toSkip = len(commentsRaw) - PageEntries
out.Write(data)
goto AtomFinish
}
- notesRaw := getNote(notesTree, commit.Hash)
+ notesRaw := sgblog.GetNote(repo, notesTree, commit.Hash)
etagHash.Write(notesRaw)
checkETag(etagHash)
if len(commit.ParentHashes) > 0 {
parent = commit.ParentHashes[0].String()
}
- commentsParsed := parseComments(commentsRaw)
+ commentsParsed := sgblog.ParseComments(commentsRaw)
comments := make([]CommentEntry, 0, len(commentsParsed))
for _, comment := range commentsParsed {
lines := strings.Split(comment, "\n")
Lines: lines[2:],
NoteLines: notesLines,
Comments: comments,
- Topics: parseTopics(topicsRaw),
+ Topics: sgblog.ParseTopics(topicsRaw),
})
if err != nil {
makeErr(err)