diff options
author | kdevo <kdevo@users.noreply.github.com> | 2022-04-25 22:37:33 +0300 |
---|---|---|
committer | kdevo <kdevo@users.noreply.github.com> | 2022-04-25 22:37:33 +0300 |
commit | dbc2c439d93c5254a4203f7ac831254954b94e56 (patch) | |
tree | c1cbbdb150bc66dfb88d631f9c933c7906f63a2a | |
parent | 15782df57560f51c26d529178d4e7d905c978578 (diff) |
fix(layouts/partials): nil pointer .Params.Social
-rw-r--r-- | layouts/partials/head.html | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 191ee9d..6c33b32 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -30,12 +30,14 @@ <meta name="author" content="{{ .Site.Params.author }}"> {{- end }} - {{ $twitter := index (where .Site.Params.Social "type" "==" "twitter") 0 }} - {{ with $twitter }} - <meta name="twitter:card" content="summary_large_image"> - <meta name="twitter:site" content="@{{ default $.Site.Params.author .name }}"> - <meta name="twitter:creator" content="@{{ default $.Site.Params.author .name }}"> - {{- end }} + {{ with .Site.Params.Social -}} + {{ $twitter := index (where . "type" "==" "twitter") 0 }} + {{ with $twitter }} + <meta name="twitter:card" content="summary_large_image"> + <meta name="twitter:site" content="@{{ default $.Site.Params.author .name }}"> + <meta name="twitter:creator" content="@{{ default $.Site.Params.author .name }}"> + {{- end }} + {{ end -}} <meta property="og:title" content="{{ if .IsHome }}{{ .Site.Title }}{{ else if .Params.heading }}{{ .Params.heading }}{{ else }}{{ .Title }} | {{ .Site.Title }}{{ end }}"> <meta property="og:type" content="website"> |