chore:修复文章排序以及ssr构建

This commit is contained in:
pengzhanbo 2022-04-06 00:49:38 +08:00
parent 6f0423366c
commit 7b2ad0e97c
12 changed files with 17 additions and 7 deletions

7
docs/public/CNAME Normal file
View File

@ -0,0 +1,7 @@
---
title: CNAME
createTime: 2022/04/06 12:46:57
author: pengzhanbo
permalink: /article/i7k2vzbu/
---
pengzhanbo.cn

BIN
docs/public/g.gif Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -25,5 +25,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "689d9606b97e32b20530979d37f6a12020b2f0b8"
"gitHead": "6f0423366c8b337d5a561bcf7302bd648a8a3781"
}

View File

@ -50,5 +50,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "689d9606b97e32b20530979d37f6a12020b2f0b8"
"gitHead": "6f0423366c8b337d5a561bcf7302bd648a8a3781"
}

View File

@ -11,6 +11,7 @@ const footer = computed(() => {
})
const style = ref({})
function setStyle(): void {
if (__VUEPRESS_SSR__) return
setTimeout(() => {
if (
document.documentElement.scrollHeight <=

View File

@ -41,6 +41,13 @@ export const preparedPostIndex = (
page.path !== '/404.html'
)
})
.sort((left, right) => {
const leftMatter = left.frontmatter as PlumeThemePostFrontmatter
const rightMatter = right.frontmatter as PlumeThemePostFrontmatter
const leftTime = getCreateTime(leftMatter.createTime || '')
const rightTime = getCreateTime(rightMatter.createTime || '')
return leftTime < rightTime ? 1 : -1
})
.map((page: Page<PlumeThemePageData>) => {
const frontmatter = page.frontmatter as PlumeThemePostFrontmatter
return {
@ -56,11 +63,6 @@ export const preparedPostIndex = (
isNote: page.data.isNote,
} as PostItem
})
.sort((left, right) => {
const leftTime = getCreateTime(left.createTime)
const rightTime = getCreateTime(right.createTime)
return leftTime < rightTime ? 1 : -1
})
postIndex = [
...postIndex
.filter((post) => post.sticky)