Skip to content
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

Support root path configure for img tag #1444

Merged
merged 2 commits into from
Dec 21, 2015

Conversation

liuhongjiang
Copy link
Contributor

Current img tag doesn't prepend root path if it's not a slash. With
this fix, the root path will be prepend to the img src if it's not a
slash.
This fix only works for the hexo tags, does not work for the markdown
syntax of links and images. The issues of markdown links and images should
be fixed in the hexo-renderer-marked module.

Resolves: #1440

@liuhongjiang
Copy link
Contributor Author

This pull request only fix the image tag.
For the image and link of markdown syntax, please refer to the pull request:
hexojs/hexo-renderer-marked#7

@liuhongjiang
Copy link
Contributor Author

I test run the test with iojs using the master branch, it gets the same error, I think this may be related to the recent upgrade of iojs.

@liuhongjiang
Copy link
Contributor Author

Add one more commit to fix the problem, when the root path is set to a subdirectory, there is no this root path in the permalink of post.

Current img tag doesn't prepend root path if it's not a slash. With
this fix, the root path will be prepend to the img src if it's not a
slash.
This fix only works for the hexo tags, does not work for the markdown
syntax of links and images. The issues of markdown links and images should
be fixed in the hexo-renderer-marked module.

Resolves: hexojs#1440
@liuhongjiang liuhongjiang force-pushed the prepend-root-to-img-tag branch 3 times, most recently from d6dd70c to b801915 Compare December 21, 2015 09:41
This commit fixs this problem, when the root path is set to a
subdirectory, there is no this root path in the permalink of post.
@liuhongjiang
Copy link
Contributor Author

I rebased the code on the latest master, And it has the same logic as this pull request: hexojs/hexo-renderer-marked#7

@Xuanwo please check it.

@Xuanwo
Copy link
Contributor

Xuanwo commented Dec 21, 2015

👍

Xuanwo pushed a commit that referenced this pull request Dec 21, 2015
Support root path configure for img tag
@Xuanwo Xuanwo merged commit 6bc0526 into hexojs:master Dec 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image link not correct at index page when site is under subdirectory
2 participants