docs editUrl should accept a function to handle specific cases
See original GitHub issue🐛 Bug Report
In v2 alpha 59, the “Edit this page” links for content docs are generated by joining the editUrl
with the path
setting. I am using a markdown preprocessor that generates files into the provided path, so I would like the edit links to point at the original files, not the generated ones.
Have you read the Contributing Guidelines on issues?
Y
To Reproduce
(Write your steps here:)
in presets:
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
homePageId: 'intro',
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/scalapb/zio-grpc/edit/master/docs',
path: '../zio-grpc-docs/target/mdoc'
},
Expected behavior
The path
setting doesn’t play a part in the edit url. In other words, the editUrl will look like https://github.com/scalapb/zio-grpc/edit/master/docs/intro.md
Actual Behavior
The generated edit url contains the path to the generated file (which is not checked in):
https://github.com/scalapb/zio-grpc/edit/master/zio-grpc-docs/target/mdoc/intro.md
Your Environment
Repository: https://github.com/scalapb/zio-grpc
Markdown generator processes files in docs into zio-grpc-docs/target/mdoc
.
To invoke it, install sbt, and type: sbt docs/mdoc
. Then cd to website
and do a yarn start
.
The docs dire
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:14
Would it work for you if the editUrl was a function that takes the absolute doc path, and then you return the edit url?
Something like:
Getting a function would be fine, though I think it would be preferable to get the relative path to the docs directory - this way the function would get the same input in dev and on CI.