-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add more asset-searching locations and solve a known issue #271
base: master
Are you sure you want to change the base?
Conversation
the check is not passed ,your idea is very good,i have the same demand |
I managed to resolve the lint problems. See if it helps. |
I need this. |
Thats a good one and will be nice to have it especially VS code now can set the Destination for past a image use the setting, |
I expect this feature |
@uiolee Could you please spare some time to review this pull request? |
按照你说的,确实起了作用 Following your suggestions, it indeed worked. I usually use Typora to edit markdown files, and I personally prefer the following path structure: |
This resolves #216.
Until now, if I would like to insert an image named
image.jpg
in a post with the filenamefoo.md
with these configurations:and the filesystem structure:
I have to use
![](image.jpg)
instead of![](foo/image.jpg)
otherwise hexo would not generate a valid img src. However, if I would like to preview the markdown file while editing, I have to use the latter one. This is contradictory.So I made a modification to allow
hexo-renderer-marked
to search for assets not only in current asset foldersource/_posts/foo
, but also in its parent foldersource/_posts
, so that![](foo/image.jpg)
can also be located and the src can be generated correctly.Moreover, this change is compatible with the previous versions and developers can safely update the package to a new version without the need for changing each and every link in their blogs.
Notice: the changes have passed the tests on Linux (WSL2, Ubuntu 22.04).
I hope these changes are acceptable.