]> git.ardis.lu - ardislu.dev/commitdiff
Simplify logic to insert header
authorArdis Lu <ardisglu@gmail.com>
Sun, 17 Jul 2022 03:53:28 +0000 (20:53 -0700)
committerArdis Lu <ardisglu@gmail.com>
Sun, 17 Jul 2022 03:53:28 +0000 (20:53 -0700)
script.js

index 4900c7800726684daddba0d2841bda9240b46550..00f78839e17275049d38ce87376f409e2f1b18fc 100644 (file)
--- a/script.js
+++ b/script.js
@@ -110,14 +110,13 @@ async function fetchPostContent(path) {
 /* Client-side routing */
 async function showPage(path) {
   document.body.innerHTML = '';
+  document.body.appendChild(header);
 
   // Determine which placeholders to show
   if (path === '/home' || path === '/') {
-    document.body.appendChild(header);
     document.body.appendChild(homeLoader);
   }
   else {
-    document.body.appendChild(header);
     document.body.appendChild(postLoader);
   }
 
This page took 0.043394 seconds and 4 git commands to generate.