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

use dataset thumbnail if available #5621

Merged

Conversation

qqmyers
Copy link
Member

@qqmyers qqmyers commented Mar 11, 2019

New Contributors

Welcome! New contributors should at least glance at CONTRIBUTING.md, especially the section on pull requests where we encourage you to reach out to other developers before you start coding. Also, please note that we measure code coverage and prefer you write unit tests. Pull requests can still be reviewed without tests or completion of the checklist outlined below. Thanks!

Related Issues

Pull Request Checklist

@coveralls
Copy link

coveralls commented Mar 11, 2019

Coverage Status

Coverage remained the same at 19.488% when pulling 624128d on QualitativeDataRepository:IQSS-4894-Open_Graph_metadata into ee874a6 on IQSS:develop.

@@ -43,7 +43,7 @@
<meta property="og:title" content="#{DatasetPage.title}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="#{DatasetPage.dataverseSiteUrl}/dataset.xhtml?persistentId=#{dataset.globalId}" />
<meta property="og:image" content="#{DatasetPage.dataverseSiteUrl.concat(resource['images/favicondataverse.png'])}" />
<meta property="og:image" content="#{DatasetPage.dataset.getDatasetThumbnail() == null ? DatasetPage.dataverseSiteUrl.concat(resource['images/favicondataverse.png']): DatasetPage.dataverseSiteUrl.concat('/api/datasets/:persistentId/thumbnail?persistentId=').concat(DatasetPage.dataset.getGlobalId().asString())}" />
Copy link
Contributor

Choose a reason for hiding this comment

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

@qqmyers -- one question I have about this og:image file path is if it requires the dataverseSiteUrl in your installation? In my initial local and AWS tests, it seems that a relative path with just content="#{resource['images/...']}" to the default image file works with no problem.

Copy link
Member Author

Choose a reason for hiding this comment

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

@mheppler - I'm not sure how you're testing, but it may be that relative URLs are OK for some uses. I think we went with a full URL based on https://stackoverflow.com/a/9858694 and looking at https://developers.facebook.com/tools/debug/og/object/ which gives an error such as
image
with a relative URL.

That said, Facebook also complains about the article:author field not being a profile (minimally a URL for the person), and doesn't like images less than 200x200... other things that could/should be fixed but that don't appear to cause trouble in slack for example...

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, that might explain the lack of complaints on my end. I haven't checked my local development on the Facebook yet. (That's on today's agenda.) The dataset thumbnail image size was also something I was going to experiment today, so I am glad to hear you've already gone down that route.

@pdurbin pdurbin mentioned this pull request Apr 11, 2019
5 tasks
@dataversebot
Copy link

Can one of the admins verify this patch?

@qqmyers
Copy link
Member Author

qqmyers commented Oct 2, 2019

FWIW: I just resolve the conflict, but, with the changes to make the supplied images higher resolution, this could/should wait until one can specify a higher resolution dataset thumbnail as in #5679

@pdurbin
Copy link
Member

pdurbin commented Jan 18, 2024

Over at #10220 (comment) mentioned that this PR increases the dataset logo size (that's my understanding anyway), so it may be a solution for this issue:

@qqmyers qqmyers self-assigned this Mar 27, 2024
@qqmyers qqmyers added the Size: 3 A percentage of a sprint. 2.1 hours. label Mar 27, 2024
@qqmyers qqmyers removed their assignment Mar 27, 2024
@jp-tosca jp-tosca self-assigned this May 20, 2024
@jp-tosca
Copy link
Contributor

jp-tosca commented May 23, 2024

Hi @qqmyers 👋🏼 I was thinking that this being a solution on the JSF it would be better to implement this logic on /api/datasets/:persistentId/thumbnail so this solution could also be available to the SPA?

@pdurbin
Copy link
Member

pdurbin commented May 23, 2024

I found a site that can preview the Open Graph images. For example https://orcascan.com/tools/open-graph-validator?url=https%3A%2F%2Fdataverse.harvard.edu%2Fdataset.xhtml%3FpersistentId%3Ddoi%3A10.7910%2FDVN%2FTJCLKP does show the generic Dataverse logo:

(Note that it does say "invalid: Your page is missing Open Graph tags, learn more.)

Screenshot 2024-05-23 at 10-39-08 Open Graph Validator

@jp-tosca
Copy link
Contributor

jp-tosca commented May 23, 2024

I found a site that can preview the Open Graph images.

At least it gives you a nice detail of what is missing 😄

@jp-tosca
Copy link
Contributor

I opened #10586 to keep track of this for the SPA

Copy link
Contributor

@jp-tosca jp-tosca left a comment

Choose a reason for hiding this comment

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

Looks good 👍🏼. Adding #10586 to keep track of this for the SPA. probably we need to remove this change from the JSF when the endpoint is updated.

@jp-tosca jp-tosca removed their assignment May 23, 2024
@sekmiller sekmiller self-assigned this May 28, 2024
@sekmiller sekmiller merged commit 1e137ef into IQSS:develop May 29, 2024
2 checks passed
@pdurbin pdurbin added this to the 6.3 milestone May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 3 A percentage of a sprint. 2.1 hours.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Dataset Thumbnail in Open Graph metadata
8 participants