use params.socialAccounts.twitter.username to change twitter meta tag

<meta name=twitter:site> and <meta name=twitter:creator>
This commit is contained in:
Reorx 2022-09-05 22:55:05 +08:00
parent 0935880bf3
commit 51d922a535
1 changed files with 4 additions and 2 deletions

View File

@ -93,8 +93,10 @@
{{- end }} {{- end }}
<meta name="twitter:title" content="{{ $pageTitle }}" /> <meta name="twitter:title" content="{{ $pageTitle }}" />
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}" /> <meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}" />
<meta name="twitter:site" content="@novoreorx" /> {{- with site.Params.socialAccounts.twitter }}
<meta name="twitter:creator" content="@novoreorx" /> <meta name="twitter:site" content="@{{ .username }}" />
<meta name="twitter:creator" content="@{{ .username }}" />
{{- end }}
{{- template "partials/templates/opengraph.html" (dict "page" . "pageTitle" $pageTitle) }} {{- template "partials/templates/opengraph.html" (dict "page" . "pageTitle" $pageTitle) }}