Skip to content

docs editUrl should accept a function to handle specific cases #3152

@thesamet

Description

@thesamet

🐛 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.good first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.help wantedAsking for outside help and/or contributions to this particular issue or PR.proposalThis issue is a proposal, usually non-trivial change

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions