Fix edit url (#55)

Since the Docusaurus-ify PR series from @jolheiser, the docs pages are no longer inside the doc/ subfolder. Fix the URL for editing a docs page in Docusaurus accordingly.

Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/55
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Co-authored-by: Denys Konovalov <denyskon@noreply.gitea.com>
Co-committed-by: Denys Konovalov <denyskon@noreply.gitea.com>
This commit is contained in:
Denys Konovalov
2023-07-31 17:32:28 +00:00
committed by techknowlogick
parent 53e27a0e86
commit 39f9261333

View File

@@ -80,7 +80,7 @@ const config = {
sidebarPath: require.resolve('./sidebars.js'),
routeBasePath: '/', // Serve the docs at the site's root
editUrl: ({versionDocsDirPath, docPath, locale, version, permalink}) => {
let fileName = `doc/${docPath.replace('.md', '')}.${locale}.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')) {
fileName = `page/index.${locale}.md`;