From 0d1886ddc98d17a85818e0ca01fa82becd791e9e Mon Sep 17 00:00:00 2001
From: Micressor <micressor@secure.mailbox.org>
Date: Wed, 12 Dec 2018 07:47:38 +0100
Subject: [PATCH] Fix validation errors according to validator.w3.org

* Add html lang tag
* Error: A charset attribute on a meta element found after the first 1024 bytes.
* Error: An img element must have an alt attribute, except under certain conditions.
* Error: Stray end tag input.
* Warning: The language attribute on the script element is obsolete. You can safely omit it.
* Error: An img element must have an alt attribute, except under certain conditions.
* Error: duplicate menu ids
* Baseof: Remove duplicate ids
* Warning: The border attribute is obsolete. Consider specifying img { border: 0; } in CSS instead.
* The border attribute is obsolete. Consider specifying img { border: 0; } in CSS instead.
* Error: Element f12 not allowed as child of element p in this context.
* Error: An img element must have an alt attribute, except under certain conditions.
* Stray end tag input.
* The language attribute on the script element is obsolete. You can safely omit it.
* Unclosed element div.
---
 assets/css/styles.css                            |  1 +
 config.yaml                                      |  6 +++---
 content/page/download.md                         |  5 +++--
 themes/briar/layouts/_default/baseof.html        |  8 ++++++--
 themes/briar/layouts/_default/list.html          |  4 ----
 themes/briar/layouts/_default/section.html       |  4 ----
 themes/briar/layouts/_default/single.html        |  4 ----
 themes/briar/layouts/partials/footer.html        |  6 +++---
 themes/briar/layouts/partials/head.html          |  2 +-
 themes/briar/layouts/partials/header.html        | 11 +++++------
 themes/briar/layouts/shortcodes/fdroid.html      |  3 ++-
 themes/briar/layouts/shortcodes/googleplay.html  |  2 +-
 themes/briar/layouts/shortcodes/hidingemail.html |  2 +-
 13 files changed, 26 insertions(+), 32 deletions(-)

diff --git a/assets/css/styles.css b/assets/css/styles.css
index cdd45ec..dffbcd5 100644
--- a/assets/css/styles.css
+++ b/assets/css/styles.css
@@ -532,6 +532,7 @@ span.reverse {
 
     #playbutton, #fdroidbutton {
         width:200px;
+        border: 0;
     }
 
     #phone {
diff --git a/config.yaml b/config.yaml
index 27413fe..f9c50be 100644
--- a/config.yaml
+++ b/config.yaml
@@ -15,7 +15,7 @@ permalinks:
 
 menu:
   main:
-  - identifier: home
+  - identifier: index
     name: Home
     title: Home
     url: /
@@ -27,7 +27,7 @@ menu:
     url: /download/
     weight: -100
 
-  - identifier: howitworks
+  - identifier: how
     name: How it works
     title: How it works
     url: /how-it-works/
@@ -39,7 +39,7 @@ menu:
     url: /about-us/
     weight: -80
 
-  - identifier: getinvolved
+  - identifier: involved
     name: Get Involved
     title: Get Involved
     url: /get-involved/
diff --git a/content/page/download.md b/content/page/download.md
index 9b23254..6b17c2a 100644
--- a/content/page/download.md
+++ b/content/page/download.md
@@ -10,8 +10,9 @@ Briar 1.1 for Android is now available for download from Google Play.
 Thank you to everyone who has tested Briar and sent feedback! We've
 fixed a lot of bugs and made many improvements thanks to your feedback.
 
-<a href="https://play.google.com/store/apps/details?id=org.briarproject.briar.android" rel="noopener noreferrer" target="_blank"><img id="playbutton" src="/img/google_play_badge_web_generic.png" alt="Get it on Google Play" border="0"></a>
-<a href="/fdroid"><img id="fdroidbutton" src="/img/fdroid_badge.png" alt="Get it on F-Droid" border="0"></a>
+{{< googleplay url="https://play.google.com/store/apps/details?id=org.briarproject.briar.android" >}}
+
+{{< fdroid  url="/fdroid" >}}
 
 If you prefer not to use Google Play, you can [install the app via
 F-Droid](/fdroid) or [download the APK file](/apk) directly from
diff --git a/themes/briar/layouts/_default/baseof.html b/themes/briar/layouts/_default/baseof.html
index 5f8e2ec..ba9e13f 100644
--- a/themes/briar/layouts/_default/baseof.html
+++ b/themes/briar/layouts/_default/baseof.html
@@ -1,11 +1,15 @@
 <!DOCTYPE html>
-<html>
+<html lang="{{ .Site.LanguageCode }}">
     {{- partial "head.html" . -}}
     <body>
+    <div id="wrapper">
         {{- partial "header.html" . -}}
-        <div id="content">
+        <div id="container">
+          <div id="content">
         {{- block "main" . }}{{- end }}
+          </div>
         </div>
         {{- partial "footer.html" . -}}
+    </div>
     </body>
 </html>
diff --git a/themes/briar/layouts/_default/list.html b/themes/briar/layouts/_default/list.html
index 0e17753..5b21482 100644
--- a/themes/briar/layouts/_default/list.html
+++ b/themes/briar/layouts/_default/list.html
@@ -1,6 +1,4 @@
 {{ define "main" }}
- <div id="container">
-      <div id="content">
       <h1>{{ with .Title }} {{ . }} {{ else }} {{ .Site.Title }} {{ end }}</h1>
       {{ range first 1 .Pages.ByDate.Reverse }}
       <h3 itemprop="headline" class="blog-post-title">
@@ -13,6 +11,4 @@
       </p>
       {{ end }}
       {{ .Content }}
-      </div> <!-- content -->
-    </div> <!-- container -->
 {{ end }}
diff --git a/themes/briar/layouts/_default/section.html b/themes/briar/layouts/_default/section.html
index ce70db8..d870959 100644
--- a/themes/briar/layouts/_default/section.html
+++ b/themes/briar/layouts/_default/section.html
@@ -1,6 +1,4 @@
 {{ define "main" }}
- <div id="container">
-      <div id="content">
       <h1>{{ with .Title }} {{ . }} {{ else }} {{ .Site.Title }} {{ end }}</h1>
       {{ range first 10 .Pages.ByDate.Reverse }}
       <h3 itemprop="headline" class="blog-post-title">
@@ -13,6 +11,4 @@
       </p>
       {{ end }}
       {{ .Content }}
-      </div> <!-- content -->
-    </div> <!-- container -->
 {{ end }}
diff --git a/themes/briar/layouts/_default/single.html b/themes/briar/layouts/_default/single.html
index 1271be3..830b17e 100644
--- a/themes/briar/layouts/_default/single.html
+++ b/themes/briar/layouts/_default/single.html
@@ -1,8 +1,4 @@
 {{ define "main" }}
- <div id="container">
-      <div id="content">
       <h2>{{ .Title }}</h2>
       {{ .Content }}
-      </div> <!-- content -->
-    </div> <!-- container -->
 {{ end }}
diff --git a/themes/briar/layouts/partials/footer.html b/themes/briar/layouts/partials/footer.html
index 0c10e30..8513381 100644
--- a/themes/briar/layouts/partials/footer.html
+++ b/themes/briar/layouts/partials/footer.html
@@ -2,14 +2,14 @@
     <div id="footer">
       <div id="signup2">
         <div id="twitter2">
-          <a href="https://twitter.com/BriarApp" rel="noopener noreferrer" target="_blank"><img class="twitterbutton" src="/img/twitter.png"/></a>
+          <a href="https://twitter.com/BriarApp" rel="noopener noreferrer" target="_blank"><img class="twitterbutton" src="/img/twitter.png" alt="Small logo of twitter"/></a>
         </div> <!-- twitter2 -->
         <form id="signupform2" action="https://sourceforge.net/projects/briar/lists/briar-announce" rel="noopener noreferrer" target="_blank" method="get" onSubmit="submitForm2()">
-          <input placeholder="Email address" type="email" name="email" tabindex="2"></input>
+          <input placeholder="Email address" type="email" name="email" tabindex="2"/>
           <button name="submit" type="submit" id="signup-submit2">Keep me updated</button>
         </form>
         <div id="signupconf2">Thanks! We'll keep you updated.</div>
-        <script language="JavaScript">
+        <script>
         <!--
         function submitForm2(){
             document.getElementById('signupform2').style.display = 'none';
diff --git a/themes/briar/layouts/partials/head.html b/themes/briar/layouts/partials/head.html
index af70b86..bd8ae2c 100644
--- a/themes/briar/layouts/partials/head.html
+++ b/themes/briar/layouts/partials/head.html
@@ -1,4 +1,5 @@
 <head>
+  <meta charset="utf-8" />
   {{ .Hugo.Generator }}
   {{ with resources.Get "css/styles.css" | minify }}
   <style media="screen">{{ .Content | safeCSS }}</style>
@@ -7,7 +8,6 @@
   <meta name="description"
         lang="{{ $.Site.LanguageCode | default "en" }}"
         content="{{ with .Param "description" }}{{ . }}{{ else }}{{ .Summary }}{{ end }}"/>
-  <meta charset="utf-8" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta name="flattr:id"
         content="{{ with .Param "flatterid" }}{{ . }}{{ end }}">
diff --git a/themes/briar/layouts/partials/header.html b/themes/briar/layouts/partials/header.html
index 50c4aee..616075e 100644
--- a/themes/briar/layouts/partials/header.html
+++ b/themes/briar/layouts/partials/header.html
@@ -1,18 +1,17 @@
-  <div id="wrapper">
     <div id="header_container">
       <div id="header">
         <a href="index.html"><div id="logo"><img src="/img/briar_logo_large.png" alt="Briar" class="logo"/></div></a>
         <div id="nav">
           <div id="signup">
             <div id="twitter">
-              <a href="https://twitter.com/BriarApp" rel="noopener noreferrer" target="_blank"><img class="twitterbutton" src="/img/twitter.png"/></a>
+              <a href="https://twitter.com/BriarApp" rel="noopener noreferrer" target="_blank"><img class="twitterbutton" src="/img/twitter.png" alt="Small twitter logo"/></a>
             </div> <!-- twitter -->
             <form id="signupform" action="https://sourceforge.net/projects/briar/lists/briar-announce" rel="noopener noreferrer" target="_blank" method="get" onSubmit="submitForm()">
-              <input placeholder="Email address" type="email" name="email" tabindex="2"></input>
+              <input placeholder="Email address" type="email" name="email" tabindex="2"/>
               <button name="submit" type="submit" id="signup-submit">Keep me updated</button>
             </form>
             <div id="signupconf">Thanks! We'll keep you updated.</div>
-            <script language="JavaScript">
+            <script>
             <!--
             function submitForm(){
                 document.getElementById('signupform').style.display = 'none';
@@ -22,12 +21,12 @@
             //-->
             </script>
           </div> <!-- signup -->
-          <label for="menu-toggle"><img src="/img/menu.png"></label>
+          <label for="menu-toggle"><img src="/img/menu.png" alt="Drop-down menu"></label>
           <input type="checkbox" id="menu-toggle"/>
           <ul id="menu">
           {{ range .Site.Menus.main }}
           <li>
-          <a id="indexnav" href="{{ .URL }}">{{ .Name }}</a>
+          <a id="{{ .Identifier }}nav" href="{{ .URL }}">{{ .Name }}</a>
           </li>
           {{ end }}
           </ul>
diff --git a/themes/briar/layouts/shortcodes/fdroid.html b/themes/briar/layouts/shortcodes/fdroid.html
index 63298bd..b21ece6 100644
--- a/themes/briar/layouts/shortcodes/fdroid.html
+++ b/themes/briar/layouts/shortcodes/fdroid.html
@@ -1,2 +1,3 @@
 <a href="{{.Get "url" }}">
-<img id="fdroidbutton" src="img/fdroid_badge.png" alt="Get it on F-Droid" border="0"></a>
+<img id="fdroidbutton" src="/img/fdroid_badge.png" alt="Get it on F-Droid">
+</a>
diff --git a/themes/briar/layouts/shortcodes/googleplay.html b/themes/briar/layouts/shortcodes/googleplay.html
index d9807be..e0b1b69 100644
--- a/themes/briar/layouts/shortcodes/googleplay.html
+++ b/themes/briar/layouts/shortcodes/googleplay.html
@@ -1,3 +1,3 @@
 <a href="{{.Get "url" }}" rel="noopener noreferrer" target="_blank">
 <img id="playbutton" src="/img/google_play_badge_web_generic.png"
-alt="Get it on Google Play" border="0"></a>
+alt="Get it on Google Play"></a>
diff --git a/themes/briar/layouts/shortcodes/hidingemail.html b/themes/briar/layouts/shortcodes/hidingemail.html
index 2d31b5d..16aa37f 100644
--- a/themes/briar/layouts/shortcodes/hidingemail.html
+++ b/themes/briar/layouts/shortcodes/hidingemail.html
@@ -1,2 +1,2 @@
 {{.Get "name" }} <span class="reverse">{{.Get "email" }}</span>
-[<a href="{{.Get "pgplink" }}">PGP key</a>]<F12>
+[<a href="{{.Get "pgplink" }}">PGP key</a>]
-- 
GitLab