From 1d54ff3ac5f1366dfde5ee9abacc021fc2e681e4 Mon Sep 17 00:00:00 2001 From: deepzz0 Date: Tue, 17 Jul 2018 22:11:11 +0800 Subject: [PATCH] fix modify blogroll.html and about.html archived in archive.html --- db.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/db.go b/db.go index d1ad1fa..c6e8ffc 100644 --- a/db.go +++ b/db.go @@ -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)