From 3a1854168f37a23703c0abc14d2b57b90085af58 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Wed, 16 Aug 2023 20:26:24 -0700 Subject: [PATCH] Set metadata on showPage('/search') Fixes bug where going back to search from an article will retain the article's metadata unexpectedly --- script.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/script.js b/script.js index 204057a..1a77386 100644 --- 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)) { -- 2.47.3