{{ if .IsPage }}
    {{ with .Params.image }}
        <!-- Twitter summary card with large image must be at least 280x150px -->
        <meta name="twitter:card" content="summary_large_image"/>
        <meta name="twitter:image" content="{{ .  | relURL }}"/>
    {{ else }}
        <meta name="twitter:card" content="summary"/>
    {{ end }}
{{ else }}
    <meta name="twitter:card" content="summary"/>
    <meta name="twitter:image" content="{{ .Site.Params.cover | relURL }}"/>
{{ end }}

<!-- Twitter Card data -->
<meta name="twitter:title" content="{{ .Title }}"/>
<meta name="twitter:description" content="{{if .IsPage}}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}"/>
<meta name="twitter:site" content="@{{ .Site.Params.twitterName }}"/>


{{ if .IsPage }}
    {{ with .Params.image }}
        <!-- Twitter summary card with large image must be at least 280x150px -->
        <meta name="twitter:card" content="summary_large_image"/>
        <meta name="twitter:image" content="{{ .  | relURL }}"/>
    {{ else }}
        <meta name="twitter:card" content="summary"/>
    {{ end }}
{{ else }}
    <meta name="twitter:card" content="summary"/>
    {{ with .Site.Params.cover }}
    <meta name="twitter:image" content="{{ .Site.Params.cover | relURL }}"/>
    {{ end }}
{{ end }}

<!-- Twitter Card data -->
<meta name="twitter:title" content="{{ .Title }}"/>
<meta name="twitter:description" content="{{if .IsPage}}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}"/>
<meta name="twitter:site" content="@{{ .Site.Params.twitterName }}"/>


Make cover image option in Twitter card
Make cover image option in Twitter card

Without a configuration setting for 'cover', the `twitter_card.html`
partial fails to render, and throws errors during site build.
