Fix url jump error, add Chinese support. 修复url跳转,支持中文 #23
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.
Adaptation: Hugo's url will handle spaces and symbols.
The content of the article supports Chinese.
url处理空格和标点符号,修复在文章中跳转另一个文章时url拼接错误
文章content支持中文(基本汉字)
URL Jump Bug
For example I created a post with the command
hugo new "posts/Hello World.md"
My browser's current url is
https://blog.example.com/
. When I search for "hello world", there is an article called "Hello World" in the search results. When I click on it, it jumps tohttps://blog.example.com/posts/Hello%20World
, the result is 404. Because the actual address of this post ishttps://blog.example.com/posts/hello-world
.Another bug is that when my current url is
https://blog.example.com/posts/hello-world
. When I search and jump to another post called "test", my url becomeshttps://blog.example.com/posts/hello-world/posts/test
instead ofhttps://blog.example.com/posts/test
.