fix: correct url for awesome-gitea "edit this page" (#109)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/109
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: jolheiser <john.olheiser@gmail.com>
Co-committed-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
jolheiser
2024-02-19 16:13:00 +00:00
committed by John Olheiser
parent a85623f6d9
commit a6008e65af

View File

@@ -95,6 +95,10 @@ const config = {
sidebarPath: require.resolve('./sidebars.js'),
routeBasePath: '/', // Serve the docs at the site's root
editUrl: ({versionDocsDirPath, docPath, locale, version, permalink}) => {
// Special case for awesome page
if (docPath.includes('awesome.md')) {
return `https://gitea.com/gitea/awesome-gitea/src/branch/main/README.md`
}
let fileName = `${docPath.replace('.md', '')}.${locale}.md`;
// intro.md has different name from upstream, need to handle this here
if (docPath.includes('intro.md')) {