Skip to content

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 liuhongjiang force-pushed the prepend-root-to-img-tag branch from 570b46b to 4ad77fe Compare August 13, 2015 06:49
@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.

@liuhongjiang liuhongjiang force-pushed the prepend-root-to-img-tag branch from 69a0e2e to 30d1953 Compare August 13, 2015 06:57
@liuhongjiang liuhongjiang force-pushed the prepend-root-to-img-tag branch from 30d1953 to a11d7db Compare December 20, 2015 08:30
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 liuhongjiang force-pushed the prepend-root-to-img-tag branch from b801915 to 657f9e7 Compare December 21, 2015 09:47
@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