]> git.ardis.lu - ardislu.dev/commitdiff
Set metadata on showPage('/search')
authorArdis Lu <ardisglu@gmail.com>
Thu, 17 Aug 2023 03:26:24 +0000 (20:26 -0700)
committerArdis Lu <ardisglu@gmail.com>
Thu, 17 Aug 2023 03:26:24 +0000 (20:26 -0700)
Fixes bug where going back to search from an article will retain the article's metadata unexpectedly

script.js

index 204057ab3d0db9c0f3fccd9c577b091e5243571d..1a77386189fd62f7383539de5b7b896fbe05f7d4 100644 (file)
--- a/script.js
+++ b/script.js
@@ -254,6 +254,13 @@ async function showPage(path) {
     document.querySelector('main').replaceWith(globalThis.components.get('home'));
   }
   else if (path === '/search') {
+    setPageMetadata({
+      title: 'ardislu.dev',
+      description: 'Notes on web development, crypto, self-hosting, and tech in general.',
+      path: path,
+      editUrl: 'https://docs.google.com/spreadsheets/d/1pfGF8yBu3D0GPTezygLuzu3Cif8SkjhtG98nL-czlhc/edit'
+    });
+
     showSearch(query); // Bypass form submission because it will set the history twice on direct link
   }
   else if (globalThis.metadata.has(path)) {
This page took 0.049732 seconds and 4 git commands to generate.