]> BookStack Code Mirror - website/commitdiff
Added og image tag
authorDan Brown <redacted>
Fri, 28 Jul 2017 13:37:33 +0000 (14:37 +0100)
committerDan Brown <redacted>
Fri, 28 Jul 2017 13:37:33 +0000 (14:37 +0100)
themes/bookstack/layouts/partials/header.html

index f5db199a4ab1e97f25c6aa9106dab03224c08d36..6bfdb0ce8c0ba7c47d7f24d8ffbdbe6174b58ad5 100644 (file)
        <meta property="og:site_name" content="{{ .Site.Title }}" />
        <meta property="og:url" content="{{ .Permalink }}" />
 
+
+    {{ $baseURL := .Site.BaseURL }}
     {{ if .IsPage }}
-       <meta property="og:type" content="article" />
 
+    {{ with .Params.image }}
+        <!-- Twitter summary card with large image must be at least 280x150px -->
+        <meta name="twitter:card" content="summary_large_image"/>
+        <meta name="og:image" content="{{ $baseURL }}{{ . }}"/>
+    {{ end }}
+
+       <meta property="og:type" content="article" />
     <meta property="og:article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}" />
 
     {{ range .Params.tags }}