#5249·hexo

Unable to get proper relative links in Hexo

Author: podybmanCreated Jul 25, 2023Updated Aug 8, 2026
Labelsbug

Check List

Please check followings before submitting a new issue.

  • I have already read Docs page & Troubleshooting page
  • I have already searched existing issues and they are not help to me -> and I was told to open a new one
  • I examined error or warning messages and it's difficult to solve
  • Using the latest version of Hexo (run hexo version to check)
  • Node.js is higher than minimum required version

Expected behavior

When using the Markdown for a relative link like [[My other post]](myotherpost.md), I expect the resulting link, after generating the website to link to the correct destination.

Actual behavior

The link works in most markdown editors because files are in the same folder, but once it's generated, the URL rewriting of Hexo gets in the way of the link. The link isn't parsed by Hexo at all, it's left as a relative link which cannot work because the URL rewriting adds a few /

How to reproduce?

  • Step1 create a markdown file postA
  • Step2 create a markdown file postB
  • Step3 make a relative lin to postB in postA
  • Step4 generate

Is the problem still there under "Safe mode"?

yes

Environment & Settings

v20.4.0
9.7.2
{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "6.3.0"
  },
  "dependencies": {
    "hexo": "^6.3.0",
    "hexo-generator-archive": "^2.0.0",
    "hexo-generator-category": "^2.0.0",
    "hexo-generator-index": "^3.0.0",
    "hexo-generator-tag": "^2.0.0",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-marked": "^6.0.0",
    "hexo-renderer-stylus": "^3.0.0",
    "hexo-server": "^3.0.0",
    "hexo-theme-landscape": "^1.0.0",
    "hexo-theme-redefine": "^2.2.2"
  }
}