Cleaining up some HTMl validation errors

This commit is contained in:
Brandon Rozek 2023-01-20 13:18:47 -05:00
parent 7bba7d0f0b
commit 75124ce773
No known key found for this signature in database
GPG key ID: 26E457DA82C9F480
3 changed files with 26 additions and 26 deletions

View file

@ -1,31 +1,31 @@
<!-- https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/twitter_cards.html --> <!-- https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/twitter_cards.html -->
{{- with $.Params.images -}} {{- with $.Params.images -}}
<meta name="twitter:card" content="summary_large_image"/> <meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/> <meta name="twitter:image" content="{{ index . 0 | absURL }}">
{{ else -}} {{ else -}}
{{- $images := $.Resources.ByType "image" -}} {{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}} {{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}} {{- with $featured -}}
<meta name="twitter:card" content="summary_large_image"/> <meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{ $featured.Permalink }}"/> <meta name="twitter:image" content="{{ $featured.Permalink }}">
{{- else -}} {{- else -}}
{{- with $.Site.Params.images -}} {{- with $.Site.Params.images -}}
<meta name="twitter:card" content="summary_large_image"/> <meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/> <meta name="twitter:image" content="{{ index . 0 | absURL }}">
{{ else -}} {{ else -}}
<meta name="twitter:card" content="summary"/> <meta name="twitter:card" content="summary">
<meta name="twitter:image" content="{{ .Site.BaseURL }}img/{{ .Site.Params.avatar }}"/> <meta name="twitter:image" content="{{ .Site.BaseURL }}img/{{ .Site.Params.avatar }}">
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- end }} {{- end }}
<meta name="twitter:title" content="{{ .Title }}"/> <meta name="twitter:title" content="{{ .Title }}">
<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 -}}">
{{ with .Site.Social.twitter -}} {{ with .Site.Social.twitter -}}
<meta name="twitter:site" content="@{{ . }}"/> <meta name="twitter:site" content="@{{ . }}">
{{ end -}} {{ end -}}
{{ range .Site.Authors }} {{ range .Site.Authors }}
{{ with .twitter -}} {{ with .twitter -}}
<meta name="twitter:creator" content="@{{ . }}"/> <meta name="twitter:creator" content="@{{ . }}">
{{ end -}} {{ end -}}
{{ end -}} {{ end -}}

View file

@ -1,7 +1,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title> <title>
{{- if eq .Title .Site.Title -}} {{- if eq .Title .Site.Title -}}
{{ .Site.Title }} {{ .Site.Title }}
@ -10,30 +10,30 @@
{{- end -}} {{- end -}}
</title> </title>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="supported-color-schemes" content="light dark" /> <meta name="supported-color-schemes" content="light dark">
<meta name="author" content="{{ .Site.Params.Author }}" /> <meta name="author" content="{{ .Site.Params.Author }}">
<meta name="robots" content="index,follow" /> <meta name="robots" content="index,follow">
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json">
<link rel="hub" href="https://pubsubhubbub.superfeedr.com/"/> <link rel="hub" href="https://pubsubhubbub.superfeedr.com/">
<link rel="shortcut icon" type="image/x-icon" href="{{ .Site.BaseURL }}{{ .Site.Params.favicon }}"> <link rel="shortcut icon" type="image/x-icon" href="{{ .Site.BaseURL }}{{ .Site.Params.favicon }}">
<link rel="pgpkey" href="https://keys.openpgp.org/pks/lookup?op=get&options=mr&search={{ .Site.Params.email }}"> <link rel="pgpkey" href="https://keys.openpgp.org/pks/lookup?op=get&options=mr&search={{ .Site.Params.email }}">
<!-- Identities --> <!-- Identities -->
{{- range .Site.Params.identities -}} {{- range .Site.Params.identities -}}
<link href="{{.}}" rel="me"/> <link href="{{.}}" rel="me">
{{ end -}} {{ end -}}
<!-- Webmentions --> <!-- Webmentions -->
{{ $siteHost := (urls.Parse .Site.BaseURL).Host -}} {{ $siteHost := (urls.Parse .Site.BaseURL).Host -}}
<link rel="webmention" href="https://webmention.io/{{ $siteHost }}/webmention" /> <link rel="webmention" href="https://webmention.io/{{ $siteHost }}/webmention">
<link rel="pingback" href="https://webmention.io/{{ $siteHost }}/xmlrpc" /> <link rel="pingback" href="https://webmention.io/{{ $siteHost }}/xmlrpc">
<!-- RSS / Alternative Links --> <!-- RSS / Alternative Links -->
{{- if .IsHome -}} {{- if .IsHome -}}
<link rel="alternate" type="application/json" href="{{ .Site.BaseURL }}blog/index.json" title="Brandon Rozek's Blog" /> <link rel="alternate" type="application/json" href="{{ .Site.BaseURL }}blog/index.json" title="Brandon Rozek's Blog">
<link rel="alternate" type="application/rss+xml" href="{{ .Site.BaseURL }}blog/index.xml" title="Brandon Rozek's Blog" /> <link rel="alternate" type="application/rss+xml" href="{{ .Site.BaseURL }}blog/index.xml" title="Brandon Rozek's Blog">
<link rel="alternate" type="application/json" href="{{ .Site.BaseURL }}presentations/index.json" title="Brandon Rozek's Presentations}" /> <link rel="alternate" type="application/json" href="{{ .Site.BaseURL }}presentations/index.json" title="Brandon Rozek's Presentations}">
<link rel="alternate" type="application/rss+xml" href="{{ .Site.BaseURL }}presentations/index.xml" title="Brandon Rozek's Presentations" /> <link rel="alternate" type="application/rss+xml" href="{{ .Site.BaseURL }}presentations/index.xml" title="Brandon Rozek's Presentations">
{{ else }} {{ else }}
{{ range .AlternativeOutputFormats -}} {{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}

View file

@ -28,7 +28,7 @@
{{ $profile_image := resources.Get (printf "img/%s" .Site.Params.avatar) }} {{ $profile_image := resources.Get (printf "img/%s" .Site.Params.avatar) }}
{{ $profile_width := 75 }} {{ $profile_width := 75 }}
{{ $profile_image := $profile_image.Resize (printf "%dx" $profile_width) }} {{ $profile_image := $profile_image.Resize (printf "%dx" $profile_width) }}
<img class="avatarMask u-photo" width="{{ $profile_width }}" src="{{ $profile_image.RelPermalink }}" alt="Photo of {{ .Site.Params.Author }}" /> <img class="avatarMask u-photo" width="{{ $profile_width }}" src="{{ $profile_image.RelPermalink }}" alt="Photo of {{ .Site.Params.Author }}">
<div style="display: none"> <div style="display: none">
<!-- email / description (for h-card) --> <!-- email / description (for h-card) -->
<a class="u-email" href="mailto://{{ .Site.Params.email }}"></a> <a class="u-email" href="mailto://{{ .Site.Params.email }}"></a>