mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 23:09:49 +02:00
build(docs): allow using custom editLink
In Vitepress, allow using a custom `editLink`, if specified in the YAML frontmatter.
This commit is contained in:
@@ -35,7 +35,12 @@ export default defineConfig({
|
|||||||
themeConfig: {
|
themeConfig: {
|
||||||
nav: nav(),
|
nav: nav(),
|
||||||
editLink: {
|
editLink: {
|
||||||
pattern: 'https://github.com/mermaid-js/mermaid/edit/develop/packages/mermaid/src/docs/:path',
|
pattern: ({ filePath, frontmatter }) => {
|
||||||
|
if (typeof frontmatter.editLink === 'string') {
|
||||||
|
return frontmatter.editLink;
|
||||||
|
}
|
||||||
|
return `https://github.com/mermaid-js/mermaid/edit/develop/packages/mermaid/src/docs/${filePath}`;
|
||||||
|
},
|
||||||
text: 'Edit this page on GitHub',
|
text: 'Edit this page on GitHub',
|
||||||
},
|
},
|
||||||
sidebar: {
|
sidebar: {
|
||||||
|
Reference in New Issue
Block a user