fix(check): fix some html check bugs

This commit is contained in:
Dillon
2020-02-18 16:22:24 +08:00
parent d8681cd489
commit 4b3addf634
20 changed files with 53 additions and 67 deletions

View File

@@ -76,12 +76,12 @@
"wordcount": {{ .WordCount }},
"url": "{{ .Permalink }}",
{{- if not .PublishDate.IsZero -}}
"datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }}",
"datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" }}",
{{- else if not .Date.IsZero -}}
"datePublished": "{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}",
"datePublished": "{{ .Date.Format "2006-01-02T15:04:05-07:00" }}",
{{- end -}}
{{- with .Lastmod -}}
"dateModified": "{{ .Format "2006-01-02T15:04:05-07:00" | safeHTML }}",
"dateModified": "{{ .Format "2006-01-02T15:04:05-07:00" }}",
{{- end -}}
{{- with .Site.Copyright -}}
"license": "{{ . }}",

View File

@@ -37,7 +37,7 @@
{{- $currentPage := . -}}
{{- range .Site.Menus.main -}}
<a class="menu-item" href="{{ .URL | absLangURL }}" title="{{ .Title }}">
{{- .Name | safeHTML -}}
{{- .Pre | safeHTML }}{{ .Name -}}
</a>
{{- end -}}
<a href="javascript:void(0);" class="theme-switch" title="{{ T "switchTheme" }}">

View File

@@ -16,12 +16,16 @@
{{- if $.Site.Params.home.profile.typeit -}}
{{- $id := md5 . | printf "tp-%s" -}}
<div id={{ printf "r%s" $id }} hidden=true>
{{- . | safeHTML -}}
{{- /* FIXME: https://github.com/gohugoio/hugo/issues/6882 */ -}}
{{- /* . | $.RenderString | safeHTML */ -}}
{{- . | markdownify | safeHTML -}}
</div>
<div id={{ $id }} class="typeit"></div>
{{- $.Scratch.SetInMap "typeitMap" $id (slice $id) -}}
{{- else -}}
{{- . | safeHTML -}}
{{- /* FIXME: https://github.com/gohugoio/hugo/issues/6882 */ -}}
{{- /* . | $.RenderString | safeHTML */ -}}
{{- . | markdownify | safeHTML -}}
{{- end -}}
</h2>
{{- end -}}