Skip to content

Commit

Permalink
Update posting.js
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueBoy247 committed Aug 29, 2024
1 parent e011df2 commit e707ae4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/posting.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function listPostsPage(now){
url: '/blog/postlist.txt',
async: false,
success: function(data){
page = Math.ceil((data.split('\n').length) / postNum);
page = Math.ceil((data.split('\n').filter(line => line.trim() !== '').length) / postNum);
}
});
if(now==undefined){
Expand Down Expand Up @@ -43,7 +43,7 @@ function listPostsBlock(startNum,endNum){
url: '/blog/postlist.txt',
async: false,
success: function(data){
fileList = data.split('\n');
fileList = data.split('\n').filter(line => line.trim() !== '');
}
});
if (fileList==[] || fileList==""){
Expand All @@ -59,8 +59,7 @@ function listPostsBlock(startNum,endNum){
$(`#postblock`).css("display","table");
fileList.reverse();
for (let i=startNum; i<endNum && i<fileList.length; i++) {
let postData=fileList[i].split(' ');
let postPath=postData[0];
let postPath=fileList[i];
let postUrl=`/blog/posts/${postPath}`;
$.ajax({
url: `/blog/posts/${postPath}/index.html`,
Expand Down

0 comments on commit e707ae4

Please sign in to comment.