Wrap gongan_icon_url with url_for#1520
Merged
Merged
Conversation
The path to `gongan_icon_url` may be incorrect when it is set to a relative path like `gongan.png` in _config.yml. For example, assume `gongan_icon_url` is `gongan.png` and current page url is `localhost:4000/page/3/`, the exact source of the generated img element is `localhost:4000/page/3/gongan.png`, rather than `localhost:4000/gongan.png`. It should be wrapped with `url_for` like [this](https://github.com/theme-next/hexo-theme-next/blob/a7a948a08f48dbe48879e277703d75706aec18e5/layout/_partials/sidebar/site-overview.swig#L4).
|
Thanks so much for opening your first PR here! |
jiangtj
approved these changes
Jun 15, 2020
|
Congrats on merging your first pull request here! 🎉 How awesome! |
kyangc
pushed a commit
to kyangc/hexo-theme-next-1
that referenced
this pull request
Aug 31, 2020
…ew_head * 'master' of github.com:theme-next/hexo-theme-next: fix: Chinese TOC cannot jump (theme-next#1540) Fix: Wrap `gongan_icon_url` with `url_for` (theme-next#1520)
CCCarrion
pushed a commit
to CCCarrion/hexo-theme-next
that referenced
this pull request
Jan 9, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
PR Type
What is the current behavior?
The path to
gongan_icon_urlmay be incorrect when it is set to a relative path likegongan.pngin _config.yml.For example, assume
gongan_icon_urlisgongan.pngand current page url islocalhost:4000/page/3/, the exact source of the generated img element islocalhost:4000/page/3/gongan.png, rather thanlocalhost:4000/gongan.png.What is the new behavior?
It should be wrapped with
url_forlike this.How to use?
In NexT
_config.yml: