question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docs editURL assumes `docs/` base path

See original GitHub issue

🐛 Bug Report

The editUrl built as part of doc metadata assumes that the base path for the docs source matches the local paths (e.g. always processed with docs/). This may not always be the case if the content is coming from a separate repo.

As an example: placeos/docs, which then maps into place-technology/website as a submodule. Setting editUrl in the config to https://github.com/placeos/docs/edit/master/ results in all edit links generating https://github.com/placeos/docs/edit/master/docs/ as the base path.

edit: cross-repo dependency in linked example is now via npm for better build support, but same issue still exists.

In v2 there does not look to be a way to override this behaviour. What seems to be the old behaviour seems preferable for flexibility.

Have you read the Contributing Guidelines on issues?

yes

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
kimburgesscommented, May 28, 2020

Hey @fanny, the limitation is that it tightly binds the docs source and website repos.

Here’s an example config:

        docs: {
          path: 'node_modules/placeos-docs',
          sidebarPath: require.resolve('./sidebars.js'),
          editUrl: 'https://github.com/placeos/docs/edit/master/',
        },

(from here)

The docs repo is just a set of markdown files that can be separately maintained. This allows them to be used as part of the site, but also in other distribution channels.

Using an editUrl that allows for specifying the full base path enables this style of setup.

1reaction
infotexturecommented, Jan 5, 2021

@slorber Found the answer in https://github.com/facebook/docusaurus/issues/3152#issue-667570288

“Edit this page” links for content docs are generated by joining the editUrl with the path setting.

I had modified the routeBasePath, but not the path setting, which explains where docs was coming from.

I updated my comment above and will send a PR later to clarify the docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

plugin-content-docs | Docusaurus
Base URL to edit your site. The final URL is computed by editUrl + relativeDocPath . Using a function allows more nuanced control...
Read more >
API Host and Base Path - Swagger
REST APIs have a base URL to which the endpoint paths are appended. ... it is assumed to be the same host where...
Read more >
Configuration - MkDocs
edit_uri . The path from the base repo_url to the docs directory when directly viewing a page, accounting for specifics of the...
Read more >
Blog and Docs explicit editUrl without appending to preset path
I'm requesting this feature because even though I still keep docs/ and blog/ within my docusaurus site but I want to separate the...
Read more >
Site URL :: Antora Docs
Assume the following conditions are true: The site is published to the docs subfolder of the example.com domain. The page new-page.adoc ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found