make sure date later than now will now be publish
This commit is contained in:
1 parent
9ea60c68c7
commit
d8161be401
47 files changed
+25
-11589
No files matched your search
@@ -29,7 +29,7 @@ export const getStaticPaths: GetStaticPaths = async () => {
|
||||
paths: Array(
|
||||
Math.ceil(
|
||||
dbPost.find({
|
||||
date: { $exists: true } as any
|
||||
date: { $lt: new Date().getTime() }
|
||||
}).length / 5
|
||||
) - 1
|
||||
)
|
||||
|
||||
@@ -35,7 +35,9 @@ export const getStaticPaths: GetStaticPaths = async () => {
|
||||
await initDatabase()
|
||||
const tMap = new Map<string, number>()
|
||||
|
||||
dbPost.find().map(({ tag = [] }) => {
|
||||
dbPost.find({
|
||||
date: { $lt: new Date().getTime() }
|
||||
}).map(({ tag = [] }) => {
|
||||
return tag.map((t) => {
|
||||
return tMap.set(t, (tMap.get(t) || 0) + 1)
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user