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.

Related Links broken when linking to blog posts

See original GitHub issue

Contribution guidelines

I’ve found a bug and checked that …

  • … the problem doesn’t occur with the mkdocs or readthedocs themes
  • … the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • … the documentation does not mention anything about my problem
  • … there are no open or closed issues that are related to my problem

Description

When linking to an existing blog post, a 404 error is produced.

Expected behaviour

The Related Links should work without error.

Actual behaviour

Linking to a blog post using the relative path of the Markdown file results in a 404 error. This can be seen in the official docs for two of the blog posts…

Both “Chinese search support” & “Excluding content from search” link to https://squidfunk.github.io/mkdocs-material/blog/posts/search-better-faster-smaller/, which produces a 404 error.

When adding a related link such as Hello World!, mkdocs serve fails with the following error:

ERROR - Blog post ‘blog/posts/example.md’ has no date set.

Steps to reproduce

Using either of the following will not let the documentation build:

---
date: 2022-09-17
links:
    - blog/posts/example.md
---
---
date: 2022-09-17
links:
    - [Example}(blog/posts/example.md)
---

Package versions

Python: Python 3.9. MkDocs: mkdocs, version 1.3.1 Material: Version: 8.5.0+insiders.4.23.3

Configuration

site_name: My Docs
docs_dir: content
theme: 
  name: material
  custom_dir: theme
  include_search_page: false
  search_index_only: true
  features:
    - navigation.tabs
    - navigation.tabs.sticky
    - navigation.top
    - navigation.tracking
    - navigation.instant
    - navigation.indexes
    - search.suggest
    - search.share
    - announce.dismiss
    - content.code.annotate
    - content.tooltips
plugins:
  # Built-in
  - search:
      separator: '[\s\-,:!=\[\]()"/]+|(?!\b)(?=[A-Z][a-z])|\.(?!\d)|&[lg]t;'
  # Extra
  - git-revision-date-localized:
      type: timeago
      enable_creation_date: true
      exclude:
        - index.md
        - blog/archive/*
        - blog/category/*
  - glightbox:
      touchNavigation: true
      loop: false
      effect: zoom
      width: 100%
      height: auto
      zoomable: true
      draggable: true
  - minify:
      minify_html: true
  - offline:
      enabled: !ENV [OFFLINE, false]
  # Ensure Data Privacy
  - privacy:
      enabled: !ENV [PRIVACY, true]
      externals: bundle
      externals_dir: assets/externals
  - blog
nav:
  - Home: 'index.md'
  - Blog:
    - 'blog/index.md'

System information

Operating system: … macOS 12.5.1 Browser: … Firefox 104.0.2

Edit: Fixed formatting.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
squidfunkcommented, Sep 18, 2022

Released as part of 8.5.2-insiders-4.23.5.

1reaction
squidfunkcommented, Sep 18, 2022

Also, the blog plugin is fantastic. I can’t wait to see all that comes next.

Thanks! Glad to hear that. All feedback is welcome 😊

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Find and Fix Broken Links (5 Methods) - Kinsta
Simply put your site URL into Ahrefs Site Explorer, go to the “Outgoing links” report, and click “Broken links.” You can then see...
Read more >
How to Find and Fix Broken Links in WordPress (Step by Step)
A broken link, also known as a dead link, is a link that no longer works. Broken links can happen for many reasons,...
Read more >
How to Fix Broken Links On Your Website - Monsido
Fixing Broken Internal Links · 1. Is It A Typo? · 2. Make the Page Real Again · 3. Redirects · 4. Delete...
Read more >
What are Broken Links? And How Do You Find and Fix Them?
A broken link is a web-page that can't be found or accessed by a user, for various reasons. Web servers will often return...
Read more >
How to find and remove broken links on your blog - XOmisse
Remove Link – if the site you've linked to no longer exists, or the post/page has been removed and you don't have anything...
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