diff --git a/layouts/partials/head/head.html b/layouts/partials/head/head.html index ae7bde1..f35313a 100644 --- a/layouts/partials/head/head.html +++ b/layouts/partials/head/head.html @@ -2,7 +2,7 @@ <meta name='viewport' content='width=device-width, initial-scale=1'> {{- $description := partialCached "data/description" . .RelPermalink -}} -<meta name='description' content='{{ $description }}'> +<meta name='description' {{ printf "content=%q" $description | safeHTMLAttr }}> {{ with .Params.Keywords }}<meta name="keywords" content="{{ delimit . ", " }}">{{ end }} {{- $title := partial "data/title" . -}} @@ -23,7 +23,7 @@ {{ if $favicon }} <link rel="shortcut icon" href="{{ $favicon.RelPermalink }}" /> {{ else }} - {{ errorf "Failed loading favicon from %q" . }} + <link rel="shortcut icon" href="{{ . | relURL }}" /> {{ end }} {{ end }} diff --git a/layouts/partials/head/opengraph/provider/base.html b/layouts/partials/head/opengraph/provider/base.html index 60da962..055745d 100644 --- a/layouts/partials/head/opengraph/provider/base.html +++ b/layouts/partials/head/opengraph/provider/base.html @@ -1,8 +1,8 @@ {{- $title := partialCached "data/title" . .RelPermalink -}} {{- $description := partialCached "data/description" . .RelPermalink -}} -<meta property='og:title' content='{{ $title }}'> -<meta property='og:description' content='{{ $description }}'> +<meta property='og:title' {{ printf "content=%q" $title | safeHTMLAttr }}> +<meta property='og:description' {{ printf "content=%q" $description | safeHTMLAttr }}> <meta property='og:url' content='{{ .Permalink }}'> <meta property='og:site_name' content='{{ .Site.Title }}'> <meta property='og:type' content=' diff --git a/layouts/partials/head/opengraph/provider/twitter.html b/layouts/partials/head/opengraph/provider/twitter.html index a837ba3..d677410 100644 --- a/layouts/partials/head/opengraph/provider/twitter.html +++ b/layouts/partials/head/opengraph/provider/twitter.html @@ -6,8 +6,8 @@ {{- $title := partialCached "data/title" . .RelPermalink -}} {{- $description := partialCached "data/description" . .RelPermalink -}} -<meta name="twitter:title" content="{{ $title }}"> -<meta name="twitter:description" content="{{ $description }}"> +<meta name="twitter:title" {{ printf "content=%q" $title | safeHTMLAttr }}> +<meta name="twitter:description" {{ printf "content=%q" $description | safeHTMLAttr }}> {{- $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" -}} {{- if $image.exists -}}