-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Implement Reddit liquid tag #4221
Conversation
Looking good so far, thanks for this |
Hi @benhalpern 👋 I'm close to finish this but got a couple of questions. Hope this is the place to ask.
Don't know where in the codebase happens but seems the image URL is wrapped to make it lazy load. I'm not very sure how to proceed fix/proceed/handle this situation and would appreciate your input.
Don't understand what's going on there. I installed the codeclimate firefox plugin but can't see the diff. I appreciate your time 😄 |
@cesc1989 I believe it is likely the images are only failing locally because you don't have Cloudinary fully set up. We can confirm this, but that is my suspicion right now. With regards to the text/markdown/html, we should be able to parse as markdown in our normal parser. CodeClimate is down because it needs tests. Check out @maestromac @Zhao-Andy if either of you want to add some guidance or suggestions here when you could, that would be great. |
Hello @cesc1989
|
@maestromac I believe this is because the cloudinary key is set to We mostly just need to proper markdown parsing now. |
Thanks a bunch! @benhalpern @maestromac I finally could render the text content properly 😄 I think the PR is ready to be reviewed/merged. Let me know if there's anything to change/improve. |
Hey @cesc1989 sorry for the late review! I'm reviewing it now and noticed the icon could be more true to Reddit's icon. Do you mind if I push up a new SVG file? Have some additional comments to make, but overall looks great! |
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.
Left some comments. Great PR so far!
@Zhao-Andy just submitted the suggested changes 😄 The reddit icon does look nicer. Thanks! |
BTW, @Zhao-Andy I think the code in How do you handle this kind of refactors? |
I decided a UI similar to the Stack Exchange tag would be better. Now the Reddit tag looks a bit similar.
Also emphasize notice about compilation of article when using any liquid tag
Sometimes the attribute `post_hint` might be null and neither condition would apply.
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.
Sorry for the delay. Tested locally. Works great!
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.
Actually the size of the VCR is concerning. I need to think about a better way to test this without relying on VCR.
@maestromac thanks for reviewing! I'll take a look at it and see how could it be improved. |
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.
Overall looks good! One improvement I'd like to see i having more useful error handling. For example, if I use an invalid link here:
{% reddit https://www.reddit.com/r/aww/comments/ag3s4 %}
# errors out:
"base: no implicit conversion of String into Integer"
Instead of a run time error, I think we'd want to raise an error like this:
https://github.com/thepracticaldev/dev.to/blob/1481faf34d5a98b259c677aa8e058e14902882ca/app/liquid_tags/gist_tag.rb#L36-L39
Sorry for the delay on all this! I'll keep a better eye on this so we can get this released sooner rather than later. :)
Hey @cesc1989! Thank you so much for the PR to add this incredible feature! With that said, we are in the process of going through and cleaning up some of our PR history to help us better prioritize what we need to be focusing on. Since this PR has not been active for a while and has some conflicts I am going to close it for now. If you would still like to get this merged please feel free to resolve the conflicts, make the requested changes, and then open the PR back up. We would be more than happy to help push this through if you would like! Thanks so much for being an awesome contributor! Ping us anytime if you have questions! |
Thank you @mstruve for the heads up. I have this inline to work but had it completely forgotten. Soon I'll be tackling the conflicts and the last reviews 🤠 👍 |
I just pushed (to my fork branch) solved conflicts and the two feedback items provided. Do I have to open another PR? |
Hi @cesc1989, I think so, as GitHub won't let me reopen this. Make sure you're up to date with master when you create it |
What type of PR is this? (check all applicable)
Description
Implement Liquid tag for reddit content.
It takes the post URL and renders a block of content based on the JSON response of requesting that URL and appending
.json
:I tried to emulate the same way the Medium liquid tag was coded and that's why the request is made and handled in a different class(
RedditJsonFromUrlService
)I'm still pending to add tests and improve the styling of the reddit content.
Related Tickets & Documents
This PR resolves #1536
Added to documentation?
What gif best describes this PR or how it makes you feel?