Merge pull request #192 from esammier/feat-opengraph-description
Show description in OpenGraph link previews
This commit is contained in:
@@ -1,15 +1,21 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title><%= title %></title>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<%# Meta tags for link previews (title, optionally description and thumbnail) %>
|
||||||
|
<title><%= title %></title>
|
||||||
|
<meta property="og:title" content="<%= title %>">
|
||||||
|
<meta name="twitter:title" content="<%= title %>">
|
||||||
|
<% if (description) { %>
|
||||||
|
<meta name="description" content="<%= description %>">
|
||||||
|
<meta property="og:description" content="<%= description %>">
|
||||||
|
<meta property="twitter:description" content="<%= description %>">
|
||||||
|
<% } %>
|
||||||
<%
|
<%
|
||||||
// Add an og-image using the first image's thumbnail
|
// Add an og-image using the first image's thumbnail
|
||||||
if (items?.[0]?.previewUrl) {
|
if (items?.[0]?.previewUrl) {
|
||||||
%>
|
%>
|
||||||
<meta property="og:title" content="<%= title %>">
|
|
||||||
<meta property="og:image" content="<%- publicBaseUrl %><%- items[0].previewUrl %>">
|
<meta property="og:image" content="<%- publicBaseUrl %><%- items[0].previewUrl %>">
|
||||||
<meta name="twitter:title" content="<%= title %>">
|
|
||||||
<meta name="twitter:image" content="<%- publicBaseUrl %><%- items[0].previewUrl %>">
|
<meta name="twitter:image" content="<%- publicBaseUrl %><%- items[0].previewUrl %>">
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|||||||
Reference in New Issue
Block a user