ysk24ok / jekyll-linkpreview

Jekyll plugin to generate link preview
https://rubygems.org/gems/jekyll-linkpreview
MIT License
29 stars 8 forks source link

Feature: boxed preview without an image, for non-OG links #23

Closed mostafa closed 4 years ago

mostafa commented 4 years ago

Hi @ysk24ok,

I've added a feature to include a boxed preview of the link, just like in Medium, to your library, and done some cleanups. Usage:

Issue: And found out that some websites block traffic to metainspector, so it fails to fetch data.

Suggestion: it would be good if we cache the images.

ysk24ok commented 4 years ago

Thank you for this PR and sorry for the late reply. It seems this change breaks tests, could you please let the tests pass? https://travis-ci.org/github/ysk24ok/jekyll-linkpreview/builds/694973845 (I'm not sure you can see this page.) You can run tests by bundle exec rake test in your local environment before git push.

mostafa commented 4 years ago

Hey @ysk24ok, I wrote a test to check if everything works as expected. It works, but I have changed the focus of the test from fetch to get, since fetch now returns a new metainspector object, rather than meta_tags.

ysk24ok commented 4 years ago

Thank you for the quick fix, @mostafa . I tried this feature in a new Jekyll site and confirmed it worked correctly. But one question, why are there two NonOpenGraphProperties classes?

mostafa commented 4 years ago

You're welcome! :slightly_smiling_face: I have merged things back and forth, and it slipped out of my hand. I'll fix it.