Skip to content

Incorrect path for relative links in truncated blog post #4119

@ianschmitz

Description

@ianschmitz

🐛 Bug Report

This appears to be somewhat related to #3250.

Links in truncated posts can be broken if they are relative to the post. Perhaps the post links should be massaged to match the expected path based on the final post slug?

Similarly there's no obvious way to construct a relative link from the post to a docs page. The best I could come up with was to convert the blog post to .mdx and use <Link> instead.

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

https://codesandbox.io/s/wonderful-hill-ri0fe?file=/blog/2019-05-30-welcome.md

  1. Navigate to blog posts page
  2. Click on link in truncated post
  3. Notice it tries to navigate to a header on the /blog page which doesn't exist

Expected behavior

Links work in both the truncated post and in the full post.

Actual Behavior

The header link works in the full blog post, but doesn't work in the truncated post.

Your Environment

  • Public source code:
  • Public site url:
  • Docusaurus version used: 2.0.0-alpha.70
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0):
  • Operating system and version (desktop or mobile):

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed: working as intendedThis issue is intended behavior, there's no need to take any action.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions