浏览代码

fix: improve HTML5 validation

See #1197
George Cushen 6 年之前
父节点
当前提交
ac5dcd9dc4
共有 2 个文件被更改,包括 3 次插入4 次删除
  1. 1 1
      layouts/partials/search.html
  2. 2 3
      layouts/partials/site_head.html

+ 1 - 1
layouts/partials/search.html

@@ -14,7 +14,7 @@
       <div id="search-box">
         {{ if eq site.Params.search.engine 1 }}
         <input name="q" id="search-query" placeholder="{{i18n "search_placeholder"}}" autocapitalize="off"
-        autocomplete="off" autocorrect="off" role="textbox" spellcheck="false" type="search">
+        autocomplete="off" autocorrect="off" spellcheck="false" type="search">
         {{ else }}
         <!-- Search box will appear here -->
         {{ end }}

+ 2 - 3
layouts/partials/site_head.html

@@ -96,7 +96,7 @@
 
   {{/* We cannot use SRI with Google Fonts because the CSS is dynamically generated according to the user agent. */}}
   {{ with ($scr.Get "google_fonts") }}
-  <link rel="stylesheet" {{ printf "href=\"https://fonts.googleapis.com/css?family=%s&display=swap\"" . | safeHTMLAttr }}>
+  <link rel="stylesheet" {{ printf "href=\"https://fonts.googleapis.com/css?family=%s&display=swap\"" (htmlEscape .) | safeHTMLAttr }}>
   {{ end }}
 
   {{ $css_options := (dict "targetPath" "css/academic.css" "outputStyle" "compressed") }}
@@ -135,8 +135,7 @@
   {{ end }}
 
   {{ with .OutputFormats.Get "RSS" }}
-  <link rel="alternate" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ site.Title }}">
-  <link rel="feed" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ site.Title }}">
+  <link rel="alternate" href="{{.RelPermalink}}" type="application/rss+xml" title="{{site.Title}}">
   {{ end }}
 
   <link rel="manifest" href="{{ "site.webmanifest" | relURL }}">