Closed Yidi0213 closed 2 years ago
@Yidi0213 Hi. I want to clarify the problem.
Q1,
Your package.json
does not include hexo-asset-image
. Why do you mention it in the issue title?
Q2.
The hexo-image-link
plugin is related to this issue? (You are using it)
Q3.
Is this problem occur if you are not using the hexo-image-link
?
@yoshinorin
Q1
It's on me. I forgot to mention that I already tried the solution posted in the stack overflow by deleting the package hexo-asset-image
. After I deleted it, the image path works
Q2
I ran the server with hexo-image-link
installed and uninstalled. It seems like both render the correct image path. Maybe the problem has nothing to do with hexo-image-link
Q3:
If I only have hexo-asset-image
. I got the image path http://localhost:4000/blog/.io//set-basic-auth.png
, whereas the correct path is http://localhost:4000/blog/2022/03/29/web-authentication/set-basic-auth.png
. Probably means hexo-asset-image
has bugs somewhere.
hexo-image-link
FYI. If you are using hexo-renderer-marked
, which is the default markdown renderer provided by Hexo, we have already add the support for transforming the relative image path to the absolute URL, see prependRoot
at https://github.com/hexojs/hexo-renderer-marked#options. According to the version of hexo-renderer-marked
you are using, prependRoot
should be enabled by default for you. So you should uninstall both hexo-asset-image
and hexo-image-link
to see if it works!
hexo-image-link
FYI. If you are using
hexo-renderer-marked
, which is the default markdown renderer provided by Hexo, we have already add the support for transforming the relative image path to the absolute URL, seeprependRoot
at https://github.com/hexojs/hexo-renderer-marked#options. According to the version ofhexo-renderer-marked
you are using,prependRoot
should be enabled by default for you. So you should uninstall bothhexo-asset-image
andhexo-image-link
to see if it works!
Thanks. Yeah, it works after removing hexo-asset-image
and hexo-image-link
. I don't know if hexo-asset-image
is preinstalled. If so, some people in the future might encounter similar problems. It will be helpful to note it in the documentation or not include hexo-asset-image
package.
hexo-asset-image
is not preinstalled. We don't have permission to update its documentation because it's not an official plugin. It's repository is now archived: https://github.com/xcodebuild/hexo-asset-image
@Yidi0213 Thank you for your feedback. May we close this issue?
Off course! Thanks for the help. I have no idea how i ended up installing hexo-asset-image
in the first place lol.
Check List
Please check followings before submitting a new issue.
hexo version
to check)Expected behavior
I enablled
post_asset_folder
and tried embedding image with markdown. After that I should be able to get correct image path with either markdown syntax or tag plugins.Actual behavior
However I got incorrect file path for both markdown syntax and tag plugins. The stack overflow page describe the problem and gave a solution.
How to reproduce?
post_asset_folder
Is the problem still there under "Safe mode"?
Environment & Settings
Node.js & npm version(
node -v && npm -v
)Your site
_config.yml
(Optional)Your theme
_config.yml
(Optional)Hexo and Plugin version(
npm ls --depth 0
)Your package.json
package.json
Others