Changed twitter:site and twitter:meta tags

Both should contain a twitter handle and not a url
This can now be achieved through config.toml
This commit is contained in:
Marco Kamner 2020-07-15 15:35:52 +02:00
parent 9d6ad58ac5
commit 4592404816
2 changed files with 7 additions and 4 deletions

View File

@ -37,6 +37,10 @@ copyright = "© {year}"
# "Twitter", "GitHub", "Email", "Facebook", "GitLab", "Instagram", "LinkedIn", "YouTube"
iconTitles = ["Twitter", "GitHub"]
# Metadata for Twitter cards, defaults to params.twitter
# twitterSite = "@<your handle>"
# twitterAuthor = "@<your handle>"
# This disables Hugo's default syntax highlighting in favor
# of prismjs. If you wish to use Hugo's default syntax highlighting
# over prismjs, remove this. You will also need to remove the prismjs

View File

@ -16,10 +16,9 @@
{{ if isset .Site.Params "twitter" }}
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="{{ .Title }}" />
<meta name="twitter:description" content="{{ if .IsHome }}{{ htmlEscape .Site.Params.description }}{{ else }}{{ htmlEscape .Description }}{{ end }}"
/>
<meta name="twitter:site" content="@{{ .Site.Params.twitter }}" />
<meta name="twitter:creator" content="@{{ .Site.Params.twitter }}" />
<meta name="twitter:description" content="{{ if .IsHome }}{{ htmlEscape .Site.Params.description }}{{ else }}{{ htmlEscape .Description }}{{ end }}"/>
<meta name="twitter:site" content="{{ .Site.Params.twitterSite | default .Site.Params.twitter }}" />
<meta name="twitter:creator" content="{{ .Site.Params.twitterCreator | default .Site.Params.twitter }}" />
{{ end }}
<link rel="shortcut icon" type="image/png" href="/favicon.ico" />