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

(to unstable branch) Adjust opengraph tag to show scrapped image #8291

Merged
merged 16 commits into from
Aug 12, 2020

Conversation

Shulammite-Aso
Copy link
Collaborator

Fixes #8273
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

jywarren and others added 16 commits August 4, 2020 15:22
* Update tag_test.rb

* Update tag_test.rb

* Update tag_test.rb

* Update tag.rb
* queue feature spam2

* indentation issue

* bulk moderation for comments and tag count in queue

* indentation

* moderator queue

* batch controller

* first-timmer issue

* tag filter

* queue indentation

* all tags filter queue
* Don't let newcomers edit wiki pages (controller-level)

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller.rb

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb
* adding tags in modals of Nodes publiclab#8230

* refactored publiclab#8230

* fixed tag path in the modal publiclab#8230
also fixed extra spacing when no tags on the modal
Changed "btn btn-xs" to "btn btn-sm"
@Shulammite-Aso Shulammite-Aso requested a review from a team as a code owner August 12, 2020 14:21
@gitpod-io
Copy link

gitpod-io bot commented Aug 12, 2020

@codecov
Copy link

codecov bot commented Aug 12, 2020

Codecov Report

Merging #8291 into unstable will decrease coverage by 0.36%.
The diff coverage is 62.60%.

Impacted file tree graph

@@             Coverage Diff              @@
##           unstable    #8291      +/-   ##
============================================
- Coverage     81.68%   81.32%   -0.37%     
============================================
  Files           100      101       +1     
  Lines          5842     5873      +31     
============================================
+ Hits           4772     4776       +4     
- Misses         1070     1097      +27     
Impacted Files Coverage Δ
app/controllers/spam2_controller.rb 61.53% <7.14%> (-14.06%) ⬇️
app/controllers/batch_controller.rb 67.96% <67.96%> (ø)
app/controllers/tag_controller.rb 81.40% <100.00%> (+0.05%) ⬆️
app/controllers/wiki_controller.rb 85.22% <100.00%> (+0.22%) ⬆️
app/models/tag.rb 97.47% <100.00%> (ø)

@Shulammite-Aso
Copy link
Collaborator Author

Hi @sagarpreet-chadha @jywarren @cesswairimu can you merge this? Using it to test #8284

@jywarren jywarren changed the title Adjust opengraph tag to show scrapped image (to unstable branch) Adjust opengraph tag to show scrapped image Aug 12, 2020
@jywarren jywarren merged commit 073d3f1 into publiclab:unstable Aug 12, 2020
@jywarren
Copy link
Member

Yep! Done! Thanks!!!!

@Shulammite-Aso
Copy link
Collaborator Author

Shulammite-Aso commented Aug 12, 2020

This didn't work.🙊

I guess i'ld have to request from @cesswairimu or anybody who knows about how to access an image(preferably the first image) from the post's body from this file.

Also perhaps default to the public lab logo when the post has no image at all: main_image and post body image. Will this be okay?

@sagarpreet-chadha
Copy link
Contributor

Hey @Shulammite-Aso ,
Can you look at this amazing data model representation to learn the relationships between tables in the DB: https://github.com/publiclab/plots2/blob/main/doc/DATA_MODEL.md
So from the image in the above link we can see that each node has many images which we can see in node.rb, line:

has_many :images, foreign_key: :nid

So once you have reference of that node ruby object, using images getter function we can get all the images, right.

Thanks! 😄

Also in the documentation of twitter it is mentioned that the images size should be of certain size and ratio: https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image

We can test the images displayed using these tools provided by FB and twitter:
https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/getting-started
https://developers.facebook.com/docs/sharing/webmasters/

@sagarpreet-chadha
Copy link
Contributor

Also you can use gitpod url to test instead of pushing to unstable:
https://3000-c5782e9a-bc16-446a-a16e-e2eaaaf4ab1c.ws-us02.gitpod.io/wiki/licenses

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.

6 participants