corp sitemap generation
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import { defineConfig } from 'vitepress'
|
||||
import { SitemapStream } from 'sitemap'
|
||||
import { createWriteStream } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
|
||||
|
||||
// https://vitepress.dev/reference/site-config
|
||||
@@ -84,4 +87,26 @@ export default defineConfig({
|
||||
md.disable(['replacements'], false)
|
||||
},
|
||||
},
|
||||
|
||||
// Sitemap generation
|
||||
transformHtml: (_, id, { pageData }) => {
|
||||
if (!/[\\/]404\.html$/.test(id))
|
||||
links.push({
|
||||
// you might need to change this if not using clean urls mode
|
||||
url: pageData.relativePath.replace(/((^|\/)index)?\.md$/, '$2'),
|
||||
lastmod: pageData.lastUpdated
|
||||
})
|
||||
},
|
||||
buildEnd: async ({ outDir }) => {
|
||||
const sitemap = new SitemapStream({
|
||||
hostname: 'https://dexorder.trade/'
|
||||
})
|
||||
const writeStream = createWriteStream(resolve(outDir, 'sitemap.xml'))
|
||||
sitemap.pipe(writeStream)
|
||||
links.forEach((link) => sitemap.write(link))
|
||||
sitemap.end()
|
||||
await new Promise((r) => writeStream.on('finish', r))
|
||||
},
|
||||
})
|
||||
|
||||
const links = []
|
||||
|
||||
@@ -15,7 +15,7 @@ Dexorder will attempt to execute each tranche at least ten (10) times under norm
|
||||
|
||||
If an execution attempt reverts for an unrecognized reason unrelated to price, time, or other order conditions,
|
||||
Dexorder will progressively slow down its execution attempts of that tranche, and if the tranche execution raises
|
||||
an unknown reversion code three times in a row, the execution of that order may be prematurely aborted.
|
||||
an unknown reversion code five times in a row, the execution of that order may be prematurely aborted.
|
||||
|
||||
## Timeout
|
||||
|
||||
|
||||
Reference in New Issue
Block a user