fix modify blogroll.html and about.html archived in archive.html

This commit is contained in:
deepzz0
2018-07-17 22:11:11 +08:00
parent 63a4d69209
commit 1d54ff3ac5

9
db.go
View File

@@ -403,20 +403,21 @@ func dropArticle(artc *Article) {
// 替换文章
func ReplaceArticle(oldArtc *Article, newArtc *Article) {
Ei.MapArticles[newArtc.Slug] = newArtc
GenerateExcerptAndRender(newArtc)
if newArtc.ID < setting.Conf.General.StartID {
return
}
if oldArtc != nil {
i, artc := GetArticle(oldArtc.ID)
DelFromLinkedList(artc)
Ei.Articles = append(Ei.Articles[:i], Ei.Articles[i+1:]...)
delete(Ei.MapArticles, artc.Slug)
dropArticle(oldArtc)
}
Ei.MapArticles[newArtc.Slug] = newArtc
Ei.Articles = append(Ei.Articles, newArtc)
sort.Sort(Ei.Articles)
GenerateExcerptAndRender(newArtc)
AddToLinkedList(newArtc.ID)
upArticle(newArtc, true)