Parcourir la source

some updates for twitter card

pull/141/head
abhidj0090 il y a 4 ans
Parent
révision
979b2c0f3b
2 fichiers modifiés avec 7 ajouts et 2 suppressions
  1. 1
    0
      exampleSite/config.toml
  2. 6
    2
      layouts/partials/head.html

+ 1
- 0
exampleSite/config.toml Voir le fichier

@@ -57,6 +57,7 @@ google_analytics_id = ""
logo = "images/logo.jpg"
post_share = true
staticAddress = "https://calcomp.netlify.app"
twitterSite="@1919Calcutta"
[params.cookies]
enable = false
expire_days = 2

+ 6
- 2
layouts/partials/head.html Voir le fichier

@@ -13,9 +13,13 @@
{{ $url := site.Params.staticAddress }}
{{ template "_internal/opengraph.html" . }}
<meta name="og:image" content="{{ with .Params.image }}{{$url}}{{ . | absURL }}{{ else }}{{$url}}{{ `images/Cover.jpg` | absURL}}{{end}}">
{{ template "_internal/twitter_cards.html" . }}

<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:title" content="{{ .Title }}"/>
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}"/>
<meta name="twitter:image" content="{{ with .Params.image }}{{$url}}{{ . | absURL}}{{ else }}{{$url}}{{ `images/Cover.jpg` | absURL}}{{end}}">
<meta property="twitter:site" content="{{site.Params.twitterSite}}" />
<meta property="twitter:creator" content="{{site.Params.twitterSite}}" />

<link rel="canonical" href="{{ .Permalink }}">
{{ "<!-- plugins -->" | safeHTML }}

Chargement…
Annuler
Enregistrer