-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
404 page, localisation improvements (#119)
- Loading branch information
1 parent
1876258
commit 4ace231
Showing
252 changed files
with
2,843 additions
and
2,025 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,61 @@ | ||
import { PageData, TransformPageContext } from 'vitepress' | ||
import snippetPlugin from "markdown-it-vuepress-code-snippet-enhanced"; | ||
import defineVersionedConfig from "vitepress-versioning-plugin"; | ||
|
||
import snippetPlugin from 'markdown-it-vuepress-code-snippet-enhanced' | ||
import defineVersionedConfig, { VersionedConfig } from 'vitepress-versioning-plugin' | ||
|
||
import { loadLocales } from './i18n' | ||
import { applySEO, removeVersionedItems } from './seo' | ||
import { loadLocales } from "./i18n"; | ||
import { transformItems, transformPageData } from "./transform"; | ||
|
||
// https://vitepress.dev/reference/site-config | ||
// https://www.npmjs.com/package/vitepress-versioning-plugin | ||
export default defineVersionedConfig(__dirname, { | ||
versioning: { | ||
latestVersion: '1.20.4', | ||
rewrites: { | ||
localePrefix: 'translated' | ||
} | ||
}, | ||
export default defineVersionedConfig( | ||
{ | ||
cleanUrls: true, | ||
|
||
rewrites: { | ||
'translated/:lang/(.*)': ':lang/(.*)' | ||
}, | ||
head: [["link", { rel: "icon", sizes: "32x32", href: "/favicon.png" }]], | ||
|
||
title: "Fabric Documentation", | ||
description: "Comprehensive documentation for Fabric, the Minecraft modding toolchain.", | ||
cleanUrls: true, | ||
// Prevent dead links from being reported as errors - allows partially translated pages to be built. | ||
ignoreDeadLinks: true, | ||
|
||
head: [[ | ||
'link', | ||
{ rel: 'icon', sizes: '32x32', href: '/favicon.png' }, | ||
]], | ||
lastUpdated: true, | ||
|
||
locales: loadLocales(__dirname), | ||
locales: loadLocales(__dirname), | ||
|
||
// Prevent dead links from being reported as errors - allows partially translated pages to be built. | ||
ignoreDeadLinks: true, | ||
markdown: { | ||
config(md) { | ||
md.use(snippetPlugin); | ||
}, | ||
// TODO: load `mcfunction` | ||
// - https://vitepress.dev/guide/markdown#syntax-highlighting-in-code-blocks | ||
// - https://shiki.style/guide/load-lang | ||
// - https://github.com/MinecraftCommands/syntax-mcfunction/blob/main/mcfunction.tmLanguage.json | ||
lineNumbers: true, | ||
math: true, | ||
}, | ||
|
||
srcExclude: [ | ||
"README.md", | ||
"LICENSE.md", | ||
], | ||
rewrites: { | ||
"translated/:lang/(.*)": ":lang/(.*)", | ||
}, | ||
|
||
transformPageData(pageData: PageData, _ctx: TransformPageContext) { | ||
applySEO(pageData); | ||
}, | ||
sitemap: { | ||
hostname: "https://docs.fabricmc.net/", | ||
transformItems, | ||
}, | ||
|
||
sitemap: { | ||
hostname: "https://docs.fabricmc.net/", | ||
transformItems: items => removeVersionedItems(items) | ||
}, | ||
srcExclude: ["README.md"], | ||
|
||
lastUpdated: true, | ||
themeConfig: { | ||
search: { | ||
provider: "local", | ||
}, | ||
}, | ||
|
||
transformPageData, | ||
|
||
themeConfig: { | ||
search: { | ||
provider: 'local' | ||
versioning: { | ||
latestVersion: "1.20.4", | ||
rewrites: { | ||
localePrefix: "translated", | ||
}, | ||
}, | ||
}, | ||
|
||
markdown: { | ||
lineNumbers: true, | ||
math: true, | ||
config(md) { | ||
md.use(snippetPlugin); | ||
} | ||
} | ||
} as VersionedConfig) | ||
__dirname | ||
); |
Oops, something went wrong.