nextcloud / gallery

DEPRECATED Gallery app was replaced by Photos
https://github.com/nextcloud/photos
GNU Affero General Public License v3.0
109 stars 58 forks source link

OpenGraph preview for shared links #141

Open oparoz opened 8 years ago

oparoz commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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.

BRadHoc commented 4 years ago

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

civita commented 4 years ago

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).