Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 25 lines (23 sloc) 1.5 KB
<!-- Modified from _internal/twitter_card.html -->
{{ if .IsPage }}
{{ with .Params.twitterImage }}
<!-- The Open Graph protocol data -->
<meta property="og:image" content="{{ print $.Site.BaseURL . }}"/>
<!-- Twitter summary card with large image must be at least 280x150px -->
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image:src" content="{{ print $.Site.BaseURL . }}"/>
{{ else }}
<meta name="twitter:card" content="summary"/>
{{ end }}
<!-- The Open Graph protocol data -->
<meta property="og:url" content="{{ $.Permalink }}"/>
<meta property="og:type" content="article"/>
<meta property="og:title" content="{{ print .Title " - " .Site.Title }}"/>
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage }}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}"/>
<!-- Twitter Card data -->
<meta name="twitter:title" content="{{ print .Title " - " .Site.Title }}"/>
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage }}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}"/>
{{ with .Site.Params.twitterCardSite }}<meta name="twitter:site" content="@{{ . }}"/>{{ end }}
{{ with .Site.Params.twitterCardDomain }}<meta name="twitter:domain" content="{{ . }}"/>{{ end }}
{{ with .Site.Params.twitterCardAuthor }}<meta name="twitter:creator" content="@{{ . }}"/>{{ end }}
{{ end }}