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

feat: redirect to post using slug #55

Merged
merged 1 commit into from
Sep 3, 2020
Merged

Conversation

curbengh
Copy link
Contributor

useful for redirecting a page to a post

@curbengh curbengh requested a review from a team August 30, 2020 04:05
@coveralls
Copy link

coveralls commented Aug 30, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling 04e033a on curbengh:post-slug into 8352d2f on hexojs:master.

README.md Outdated
---
```

http://yoursite.com/baz-page ⇒ http://yoursite.com/2020/01/02/foo-post/
Copy link
Member

@yoshinorin yoshinorin Sep 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 ?

-http://yoursite.com/2020/01/02/foo-post/
+http://yoursite.com/foo-post/

Copy link
Contributor Author

@curbengh curbengh Sep 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, there is an existing post "source/_posts/foo-post.md" that is available at http://yoursite.com/2020/01/02/foo-post/

The page should redirect to post located at http://yoursite.com/2020/01/02/foo-post/
when a post couldn't be located (due to user's typo), then it will redirect to (non-existent) http://yoursite.com/foo-post/.

README.md Outdated

http://yoursite.com/baz-page ⇒ http://yoursite.com/2020/01/02/foo-post/

_If a post could not be located (due to incorrect value), the article will be redirected to http://yoursite/foo-post_
Copy link
Member

@yoshinorin yoshinorin Sep 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- http://yoursite/foo-post
+ http://yoursite.com/foo-post

@yoshinorin
Copy link
Member

yoshinorin commented Sep 1, 2020

BTW, we should stop to use yoursite.com.
yoursite.com is a real company's domain.

We should use example.com instead of yoursite.com.

https://tools.ietf.org/html/rfc2606

@curbengh
Copy link
Contributor Author

curbengh commented Sep 2, 2020

Updated to example.com, initially wanted to use yourhexo.com, but even that is registered...

@SukkaW
Copy link
Member

SukkaW commented Sep 2, 2020

Updated to example.com, initially wanted to use yourhexo.com, but even that is registered...

example.com is better. It is defined in RFC for the purpose.

@curbengh curbengh merged commit e154e9e into hexojs:master Sep 3, 2020
@curbengh curbengh deleted the post-slug branch September 3, 2020 06:44
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.

4 participants