gallery icon indicating copy to clipboard operation
gallery copied to clipboard

OpenGraph preview for shared links

Open oparoz opened this issue 9 years ago • 5 comments

From @Matthias84 on May 20, 2016 8:51

Feature request

User type: public

User level: beginner

Description

OpenGraph is an HTML extension that allows third party sites as facebook, Twitter, ... to embedd previews for links at their own pages. It's basically just some additional meta elements:

<html prefix="og: http://ogp.me/ns#">
<head>
<title>My Link</title>
<meta property="og:title" content="My Link shows OGP" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://example.com/ogp.jpg" />
<meta property="og:image:secure_url" content="https://secure.example.com/ogp.jpg" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content="400" />
<meta property="og:image:height" content="300" />
...
</head>
...
</html>

Depending on the priority, you can just refer to an existing image, or create an new thumbnail that mixes all the photos of a gallery.

Benefit / value

It's getting more attractive to share own photos for beginner users, as they don't need to create a teaser on their own. OC content becomes more attractive for third parties.

Risk / caveats

Sponsorship

Are you a developer willing to implement this feature?: no

Can you sponsor the development of this feature or do you know somewone who can?: no

Copied from original issue: owncloud/gallery#657

oparoz avatar Sep 04 '16 13:09 oparoz

Seems easy enough to implement.

  1. Define all the headers to add
  2. Add headers using https://github.com/owncloud/core/blob/master/lib/public/AppFramework/Http/Response.php#L172
  3. Test

oparoz avatar Sep 04 '16 13:09 oparoz

From @Matthias84 on May 20, 2016 17:40

I'm not familar with the OC architecture, so it might be wise to add it upstream, so all apps with share functionality will benefit from the functionality. On the other hand, it might be easier to implement it first at this app and move the code later :wink:

oparoz avatar Sep 04 '16 13:09 oparoz

I think it's best if apps implement it for the type of content they're displaying. Very few apps have a public side. It will take a long time for Files to support all content types, but people can add the headers one type at a time.

For Gallery, we should probably only include references to the first 5 or so images.

oparoz avatar Sep 04 '16 13:09 oparoz

I'm guessing this never got done and is still open?

BRadHoc avatar May 05 '20 17:05 BRadHoc

I've made some minor tweaks on layout.public.php with additional JSON file, to allow OpenGraph-based platforms to parse og: metadata. If you are interested, the steps are posted here (external website).

civita avatar May 08 '20 19:05 civita