Skip to content

Commit

Permalink
Remove prefetch/prerendered pages
Browse files Browse the repository at this point in the history
  • Loading branch information
strayfade committed Apr 11, 2024
1 parent 06d7eda commit 1175268
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions generators/Head.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,6 @@ const { Localize } = require('./tools/LocaleTools')
const fs = require('fs/promises')
const fsdir = require('fs')

let PostsList = (async () => {
let Posts = []
let AllPosts = fsdir.readdirSync(__dirname.replace('generators', 'posts/'))
for (let x = 0; x < AllPosts.length; x++) {
if (AllPosts[x].endsWith('.md')) {
let JSONstr = await fs.readFile(__dirname.replace('generators', 'posts/') + AllPosts[x], {
encoding: 'utf-8',
})
let Current = JSON.parse(JSONstr.split('}')[0] + '}')
if (Current.indexed) {
Posts.push({ data: Current, file: AllPosts[x] })
}
}
}
Posts.sort((a, b) => {
const FirstDate = new Date(a.data.date)
const SecondDate = new Date(b.data.date)

return SecondDate - FirstDate
})
return Posts
})()

const GenerateHead = async (Article, Locale) => {
Article = JSON.parse(Article.split('}')[0] + '}')
Output = `
Expand Down Expand Up @@ -85,12 +62,6 @@ const GenerateHead = async (Article, Locale) => {
<link rel="stylesheet" href="/build/production.css" type="text/css">
<link rel="preload" href="/build/production.js" as="script">
`
;(await PostsList).forEach((Post) => {
Output += `
<link rel="prefetch" href="/${Locale.locale_title}/${Post.file.replace('.md', '')}">
<link rel="prerender" href="/${Locale.locale_title}/${Post.file.replace('.md', '')}">
`
})
return Output
}

Expand Down

0 comments on commit 1175268

Please sign in to comment.