From: Ardis Lu Date: Thu, 17 Aug 2023 03:26:24 +0000 (-0700) Subject: Set metadata on showPage('/search') X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=3a1854168f37a23703c0abc14d2b57b90085af58;p=ardislu.dev Set metadata on showPage('/search') Fixes bug where going back to search from an article will retain the article's metadata unexpectedly --- 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)) {