hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
38.86k stars 4.76k forks source link

relative_link配置无效 #3125

Closed hueidou closed 5 years ago

hueidou commented 6 years ago

Environment Info

Node version(v6.11.0):

Your site _config.yml (Optional):

url: http://teamserver/blog
root: /blog/
permalink: :year/:month/:day/:title/
permalink_defaults:

relative_link: true

Your theme _config.yml (Optional): landscape (no modify)

Hexo and Plugin version(npm ls --depth 0):

+-- hexo@3.7.1
+-- hexo-deployer-sftp@0.1.0
+-- hexo-generator-archive@0.1.5
+-- hexo-generator-category@0.1.3
+-- hexo-generator-index@0.2.1
+-- hexo-generator-tag@0.2.0
+-- hexo-renderer-ejs@0.3.1
+-- hexo-renderer-marked@0.3.2
+-- hexo-renderer-stylus@0.3.3
`-- hexo-server@0.2.2

For question

我的站点在subdirectory下,根据_config.yml里的注释设置了如上的url和root,但发现图片无法正常显示。

不管文章内的图片是写相对路径![](images/write-in-vscode.jpg)还是绝对路径![](/images/write-in-vscode.jpg)都无法在文章页面正常显示。

写法 页面 html 状态
![](images/write-in-vscode.jpg) http://localhost:4000/blog/index.html <img src="images/write-in-vscode.jpg" alt=""> 显示
![](/images/write-in-vscode.jpg) http://localhost:4000/blog/index.html <img src="/images/write-in-vscode.jpg" alt=""> 不显示
![](images/write-in-vscode.jpg) http://localhost:4000/blog/2018/04/18/hello-world/ <img src="images/write-in-vscode.jpg" alt=""> 不显示
![](/images/write-in-vscode.jpg) http://localhost:4000/blog/2018/04/18/hello-world/ <img src="/images/write-in-vscode.jpg" alt=""> 不显示

参考Hexo Configuration部分的relative_link配置(Make links relative to the root folder?),我将此配置修改为true,但生成的html仍和上表一样,未将/blog/添加至url上。

这是哪里配置错误,还是是个问题?

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.