From f5b0a0e527b1d147546c5d3d4cc86f742d8901ac Mon Sep 17 00:00:00 2001 From: Michael Jolley Date: Thu, 11 Apr 2024 20:58:56 -0500 Subject: [PATCH] Fixing astro referrer --- netlify/edge-functions/hiya.ts | 5 ++--- src/pages/index.astro | 18 +++++++++--------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/netlify/edge-functions/hiya.ts b/netlify/edge-functions/hiya.ts index 8dd3889..156af11 100644 --- a/netlify/edge-functions/hiya.ts +++ b/netlify/edge-functions/hiya.ts @@ -48,9 +48,8 @@ export default async (request: Request, context: Context) => { let updatedPage = page; let astroReplace = - analytic.referrer == "https://astro.build/" ? astroed : ""; - console.log(analytic.referrer); - const astroRegex = //i; + analytic.referrer && analytic.referrer.indexOf("astro.build") >= 0 ? astroed : ""; + const astroRegex = /\**ASTROED\**/i; updatedPage = updatedPage.replace(astroRegex, astroReplace); const regex = //i; diff --git a/src/pages/index.astro b/src/pages/index.astro index 05f0e44..ec9387a 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -7,17 +7,17 @@ import Twitch from "@components/Twitch.astro"; const title = "Michael Jolley is the Bald Bearded Builder"; const description = - "Welcome to the home of Michael Jolley, also known as the bald, bearded, builder. Here you'll find all Michael's content curated for easier viewing."; + "Welcome to the home of Michael Jolley, also known as the bald, bearded, builder. Here you'll find all Michael's content curated for easier viewing."; const permalink = `https://${import.meta.env.HOST}/`; --- - - - - - + + **ASTROED** + + +