Skip to content

Can't reference links to docs from Blog #3250

Closed

Description

@danon

🐛 Bug Report

After update to 2.0-alpha61, the "broken links" util (which I find very helpful), said my link to doc from Blog was broken:

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

(Write your steps here:)

  1. Add docs file, e.g. file.mdx.
  2. Add blog post
  3. Add link to your doc in Blog post with extension (e.g. file.mdx, like me)
  4. Build the application

Expected behavior

The link should be considered a valid link.

Actual Behavior

"Broken links" complain it's broken. It will only be considered valid, if it doesn't contain an extension. It's inconsitent, since link in docs to docs can have extensions.

Kinda looks like links in /docs can point to files, but links in blog point to URL? It's really unintuitive.

Error: Broken links found!

- Page path = /blog:
   -> link to ../../docs/filter.mdx#filter-by-keys (resolved as: /docs/filter.mdx)


- Page path = /blog/2019/08/31/super-duper-stargazers:
   -> link to ../../docs/filter.mdx#filter-by-keys (resolved as: /blog/2019/docs/filter.mdx)

Note: it's possible to ignore broken links with the 'onBrokenLinks' Docusaurus configuration.

Your Environment

  • Docusaurus version used: 2.0-alpha61
  • Operating system: Windows

Activity

  1. added
    bug
    status: needs triage
    on Aug 9, 2020
  2. slorber commented on Aug 9, 2020

    @slorber
    Collaborator

    Hi @danon

    Linking using md file paths only works for docs, it's not possible to link from/to blog this way, because the fs path to URL resolution system is plugin dependant (slug frontmatter etc...)

    It is pretty sure that this link was not reported before, but it was actually broken in practice, so this new system likely catched a bug on your site :)

  3. danon commented on Aug 9, 2020

    @danon
    ContributorAuthor

    @slorber Yes, you're right, it found a bug.

    Sorry to have taken your time.

  4. removed
    status: needs triage
    on Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions