mirror of
https://github.com/misode/misode.github.io.git
synced 2026-05-04 14:42:53 +00:00
Fix page titles and remove field settings page
This commit is contained in:
+1
-2
@@ -8,7 +8,7 @@ import '../styles/nodes.css'
|
|||||||
import { Analytics } from './Analytics'
|
import { Analytics } from './Analytics'
|
||||||
import { Header } from './components'
|
import { Header } from './components'
|
||||||
import { loadLocale, locale, Locales } from './Locales'
|
import { loadLocale, locale, Locales } from './Locales'
|
||||||
import { FieldSettings, Generator, Home, Worldgen } from './pages'
|
import { Generator, Home, Worldgen } from './pages'
|
||||||
import type { VersionId } from './Schemas'
|
import type { VersionId } from './Schemas'
|
||||||
import { Store } from './Store'
|
import { Store } from './Store'
|
||||||
import { cleanUrl } from './Utils'
|
import { cleanUrl } from './Utils'
|
||||||
@@ -70,7 +70,6 @@ function Main() {
|
|||||||
<Header {...{lang, title, version, theme, language: lang, changeLanguage, changeTheme}} />
|
<Header {...{lang, title, version, theme, language: lang, changeLanguage, changeTheme}} />
|
||||||
<Router onChange={changeRoute}>
|
<Router onChange={changeRoute}>
|
||||||
<Home path="/" {...{lang, changeTitle}} />
|
<Home path="/" {...{lang, changeTitle}} />
|
||||||
<FieldSettings path="/settings/fields" {...{lang, changeTitle}} />
|
|
||||||
<Worldgen path="/worldgen" {...{lang, changeTitle}} />
|
<Worldgen path="/worldgen" {...{lang, changeTitle}} />
|
||||||
<Generator default {...{lang, version, changeTitle}} onChangeVersion={changeVersion} />
|
<Generator default {...{lang, version, changeTitle}} onChangeVersion={changeVersion} />
|
||||||
</Router>
|
</Router>
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
import { locale } from '../Locales'
|
|
||||||
|
|
||||||
type FieldSettingsProps = {
|
|
||||||
lang: string,
|
|
||||||
path?: string,
|
|
||||||
}
|
|
||||||
export function FieldSettings({ lang }: FieldSettingsProps) {
|
|
||||||
const loc = locale.bind(null, lang)
|
|
||||||
return <main>
|
|
||||||
<div class="settings">
|
|
||||||
<p>{loc('settings.fields.description')}</p>
|
|
||||||
<ul class="field-list">
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
export * from './FieldSettings'
|
|
||||||
export * from './Generator'
|
export * from './Generator'
|
||||||
export * from './Home'
|
export * from './Home'
|
||||||
export * from './Worldgen'
|
export * from './Worldgen'
|
||||||
|
|||||||
+4
-2
@@ -4,6 +4,7 @@ import html from '@rollup/plugin-html'
|
|||||||
import config from './src/config.json'
|
import config from './src/config.json'
|
||||||
import { env } from 'process'
|
import { env } from 'process'
|
||||||
import copy from 'rollup-plugin-copy'
|
import copy from 'rollup-plugin-copy'
|
||||||
|
import English from './src/locales/en.json'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
build: {
|
build: {
|
||||||
@@ -41,8 +42,9 @@ export default defineConfig({
|
|||||||
|
|
||||||
function getTitle(m) {
|
function getTitle(m) {
|
||||||
const minVersion = Math.max(0, config.versions.findIndex(v => m.minVersion === v.id))
|
const minVersion = Math.max(0, config.versions.findIndex(v => m.minVersion === v.id))
|
||||||
const versions = config.versions.slice(minVersion).map(v => v.id).join(', ')
|
const versions = config.versions.slice(minVersion).map(v => v.id)
|
||||||
return `${m.name} Generator${m.category === true ? 's' : ''} Minecraft ${versions}`
|
versions.splice(0, versions.length - 3)
|
||||||
|
return `${English[m.id] ?? ''} Generator${m.category === true ? 's' : ''} Minecraft ${versions.join(', ')}`
|
||||||
}
|
}
|
||||||
|
|
||||||
function template({ files, title }) {
|
function template({ files, title }) {
|
||||||
|
|||||||
Reference in New Issue
Block a user