diff --git a/Gmeek.py b/Gmeek.py index 6876c21..bf19fdc 100644 --- a/Gmeek.py +++ b/Gmeek.py @@ -313,6 +313,10 @@ else: listFile=open("blogBase.json","w") listFile.write(json.dumps(blog.blogBase)) listFile.close() -shutil.copy("blogBase.json",blog.root_dir) +# shutil.copy("blogBase.json",blog.root_dir) +blog.blogBase["postListJson"]=dict(sorted(self.blogBase["postListJson"].items(),key=lambda x:x[1]["createdAt"],reverse=True))#使列表由时间排序 +docListFile=open(blog.root_dir+"postList.json","w") +docListFile.write(json.dumps(blog.blogBase)) +docListFile.close() ###################################################################################### diff --git a/templates/tag.html b/templates/tag.html index 03c7ac4..bf335dd 100644 --- a/templates/tag.html +++ b/templates/tag.html @@ -68,7 +68,7 @@ document.getElementById("{{ blogBase['singeListJson'][num]['postTitle'] }}").set tagList=[]; jsonData=''; -let requestJson="blogBase.json" +let requestJson="postList.json" let request=new XMLHttpRequest(); request.open("GET",requestJson); request.responseType='text';