meta-twitter.html 825 Bytes
Newer Older
Franco (nextime) Lanza's avatar
Franco (nextime) Lanza committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
{{ if .IsPage }} <!-- Credit V JEANTET -->
    {{ with .Params.image }}
    <meta name="twitter:card" content="summary_large_image"/>
    <meta name="twitter:image" content="{{ .  | absURL }}"/>
    {{ else }}
    <meta name="twitter:card" content="summary"/>
    {{ end }}
{{ else }}
    <meta name="twitter:card" content="summary"/>
    {{ with .Site.Params.cover }}<meta name="twitter:image" content="{{ . | absURL }}"/>{{ end }}
{{ end }} <!-- Twitter Card data -->
    <meta name="twitter:title" content="{{ .Title }}"/>
    <meta name="twitter:description" content="{{if .IsPage}}{{ .Description | default (substr .Summary 0 160) }}{{ else }}{{ .Site.Params.description }}{{ end }}"/>
    <meta name="twitter:url" content="{{.URL | absURL}}" />
    <meta name="twitter:site" content="@{{ .Site.Params.twitterName }}"/>