mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-15 10:52:26 +08:00
fix modify blogroll.html and about.html archived in archive.html
This commit is contained in:
9
db.go
9
db.go
@@ -403,20 +403,21 @@ func dropArticle(artc *Article) {
|
|||||||
|
|
||||||
// 替换文章
|
// 替换文章
|
||||||
func ReplaceArticle(oldArtc *Article, newArtc *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 {
|
if oldArtc != nil {
|
||||||
i, artc := GetArticle(oldArtc.ID)
|
i, artc := GetArticle(oldArtc.ID)
|
||||||
DelFromLinkedList(artc)
|
DelFromLinkedList(artc)
|
||||||
Ei.Articles = append(Ei.Articles[:i], Ei.Articles[i+1:]...)
|
Ei.Articles = append(Ei.Articles[:i], Ei.Articles[i+1:]...)
|
||||||
delete(Ei.MapArticles, artc.Slug)
|
|
||||||
|
|
||||||
dropArticle(oldArtc)
|
dropArticle(oldArtc)
|
||||||
}
|
}
|
||||||
|
|
||||||
Ei.MapArticles[newArtc.Slug] = newArtc
|
|
||||||
Ei.Articles = append(Ei.Articles, newArtc)
|
Ei.Articles = append(Ei.Articles, newArtc)
|
||||||
sort.Sort(Ei.Articles)
|
sort.Sort(Ei.Articles)
|
||||||
|
|
||||||
GenerateExcerptAndRender(newArtc)
|
|
||||||
AddToLinkedList(newArtc.ID)
|
AddToLinkedList(newArtc.ID)
|
||||||
|
|
||||||
upArticle(newArtc, true)
|
upArticle(newArtc, true)
|
||||||
|
|||||||
Reference in New Issue
Block a user