-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Reader: Pretty URLs for some feeds #832
Conversation
@@ -19,7 +19,8 @@ var i18n = require( 'lib/mixins/i18n' ), | |||
i18n = require( 'lib/mixins/i18n' ), | |||
TitleStore = require( 'lib/screen-title/store' ), | |||
titleActions = require( 'lib/screen-title/actions' ), | |||
FeedSubscriptionActions = require( 'lib/reader-feed-subscriptions/actions' ); | |||
FeedSubscriptionActions = require( 'lib/reader-feed-subscriptions/actions' ), | |||
urlHelper = require( 'reader/url-helper' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to include this resource in lib/route/path
? There are some similar helpers there. Or even a new lib/route/reader.js
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea moving it to lib/route/reader.js
. @bluefuton or @blowery any thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 sounds like a good place for it to live :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved in 22356af and added tests in d078858
Also make it easier to add pretty aliases for streams like `/discover`
Across various places in the reader codebase where we were hard-coding the stream paths.
If a feed/site has a pretty URL, we should redirect to that instead of showing the full ID-laden URL.
a948a09
to
d078858
Compare
Maybe |
Also adds tests for the helper.
d078858
to
7e80cad
Compare
Cool, moved to |
@blowery I thought the file was about formatting links to use in views, in which case it makes sense as a |
@bluefuton I don't want to hold this PR because of figuring out where to place things. We can continue the discussion in a separate issue. I do think it would make our lives easier to place all these utils in |
Reader: Pretty URLs for some feeds
The primary goal of this PR is to redirect full site/feed URLs for Discover to the pretty version (i.e.
/discover
) but this refactors the URL generation for streams and makes it easier to add other pretty URLs in the future (/longreads
?).Testing
/read/blog/feed/12733228
and/read/blog/id/53424024
both redirect to/discover
.