Static render all combinations of convert formats

This commit is contained in:
Misode
2024-11-29 07:03:19 +01:00
parent 7501b392be
commit 061c1d5cef

View File

@@ -7,6 +7,8 @@ import { viteStaticCopy } from 'vite-plugin-static-copy'
const config = require('./src/config.json')
const English = require('./src/locales/en.json')
const convertFormats = ['give-command', 'loot-table', 'item-modifier']
export default defineConfig({
server: {
port: 3000,
@@ -44,6 +46,11 @@ export default defineConfig({
title: `${English[m.id] ?? ''} Generator${m.category === true ? 's' : ''} - ${getVersions(m)}`,
template,
})),
...convertFormats.flatMap(s => convertFormats.filter(t => s !== t).map(t => [s, t])).map(([s, t]) => html({
fileName: `convert/${s}-to-${t}/index.html`,
title: `${English[`convert.format.${s}`]} to ${English[`convert.format.${t}`]} Converter - ${getVersions({ minVersion: '1.20.5' })}`,
template,
})),
...config.legacyGuides.map(g => html({
fileName: `guides/${g.id}/index.html`,
title: `${g.title} - ${getVersions()}`,