roll

Rolled my own static website builder 💻

Commit
b4edd30c0864a631a2621462f271efdf875006d2
Parent
c0ed690bfcf461db10cc1fbb4ea6dfa7399bbecb
Author
Pablo <pablo-pie@riseup.net>
Date

Fixed some warnings & errors from validator.w3.org

Diffstats

1 files changed, 11 insertions, 11 deletions

Status Name Changes Insertions Deletions
Modified src/html.rs 2 files changed 11 11
diff --git a/src/html.rs b/src/html.rs
@@ -562,27 +562,27 @@ fn render_head(
   const PRELOAD_MAX: usize = 2;
   writeln!(w, "<head>")?;
   writeln!(w, "<title>{}</title>", Escaped(title))?;
-  writeln!(w, "<meta charset=\"utf-8\" />")?;
-  writeln!(w, "<meta name=\"viewport\"    content=\"width=device-width, initial-scale=1.0\" />")?;
+  writeln!(w, "<meta charset=\"utf-8\">")?;
+  writeln!(w, "<meta name=\"viewport\"    content=\"width=device-width, initial-scale=1.0\">")?;
   if let Some(description) = description {
-    writeln!(w, "<meta name=\"description\" content=\"{}\" />",
+    writeln!(w, "<meta name=\"description\" content=\"{}\">",
                 Escaped(description))?;
   }
-  writeln!(w, "<meta name=\"author\"      content=\"{AUTHOR}\" />")?;
+  writeln!(w, "<meta name=\"author\"      content=\"{AUTHOR}\">")?;
   // TODO: this apparently is not complient with the standards:
   //       https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name
-  writeln!(w, "<meta name=\"copyright\"   content=\"GPLv3\" />")?;
-  writeln!(w, "<link rel=\"stylesheet\" href=\"/css/styles.css\" />")?;
+  writeln!(w, "<meta name=\"copyright\"   content=\"GPLv3\">")?;
+  writeln!(w, "<link rel=\"stylesheet\" href=\"/css/styles.css\">")?;
   if head_info.needs_katex {
-    writeln!(w, "<link rel=\"stylesheet\" href=\"/css/katex.css\" />")?;
+    writeln!(w, "<link rel=\"stylesheet\" href=\"/css/katex.css\">")?;
   }
   if head_info.needs_highlighting {
-    writeln!(w, "<link rel=\"stylesheet\" href=\"/css/highlighting.css\" />")?;
+    writeln!(w, "<link rel=\"stylesheet\" href=\"/css/highlighting.css\">")?;
   }
   writeln!(w, "<link rel=\"icon\" type=\"image/svg+xml\" sizes=\"16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512\" href=\"/{IMGS_SUBDIR}/icons/favicon.svg\">")?;
   writeln!(w, "<script type=\"module\" src=\"/js/vim-controls.js\"></script>")?;
   for img_path in head_info.preload_imgs.iter().take(PRELOAD_MAX) {
-    writeln!(w, "<link rel=\"preload\" as=\"image\" href=\"/{IMGS_SUBDIR}/{img_path}\" />")?;
+    writeln!(w, "<link rel=\"preload\" as=\"image\" href=\"/{IMGS_SUBDIR}/{img_path}\">")?;
   }
   writeln!(w, "</head>")?;
 
@@ -592,7 +592,7 @@ fn render_head(
 fn render_nav<W: Write>(w: &mut W) -> io::Result<()> {
   writeln!(w, "<header>")?;
   writeln!(w, "<nav id=\"site-map\">")?;
-  writeln!(w, "<img src=\"/{ICONS_SUBDIR}/favicon.svg\" width=\"20px\" height=\"20px\">")?;
+  writeln!(w, "<img src=\"/{ICONS_SUBDIR}/favicon.svg\" width=\"20\" height=\"20\" alt=\"website favicon\">")?;
   writeln!(w, "<ul>")?;
   writeln!(w, "<li><strong><a href=\"/\">pablo</a></strong></li>")?;
   writeln!(w, "<li><a href=\"/{POSTS_SUBDIR}/\">blog</a></li>")?;
@@ -606,7 +606,7 @@ fn render_nav(w: &mut W) -> io::Result<()> {
 
 fn render_footer<W: Write>(w: &mut W) -> io::Result<()> {
   const FOOTER: &str = include_str!("html/footer.html");
-  writeln!(w, "{}", FOOTER)
+  write!(w, "{}", FOOTER)
 }
 
 impl Display for DateTime {