diff --git a/site/astro.config.mjs b/site/astro.config.mjs index 6fcea9f..fc94e64 100644 --- a/site/astro.config.mjs +++ b/site/astro.config.mjs @@ -64,20 +64,10 @@ function buildRedirects(base) { const base = '/awesome-prometheus-alerts'; -/** Legacy .html page redirects from the pre-Astro (Jekyll) site. - * These pages 404 after the Astro migration since they moved to trailing-slash directories. - * rules.html alone had 105 referring domains and was the #1 traffic page — critical to preserve. */ -const legacyHtmlRedirects = { - [`${base}/rules.html`]: { destination: `${base}/rules/`, status: 301 }, - [`${base}/alertmanager.html`]: { destination: `${base}/alertmanager/`, status: 301 }, - [`${base}/blackbox-exporter.html`]: { destination: `${base}/blackbox-exporter/`, status: 301 }, - [`${base}/sleep-peacefully.html`]: { destination: `${base}/sleep-peacefully/`, status: 301 }, -}; - export default defineConfig({ site: 'https://samber.github.io', base, - redirects: { ...buildRedirects(base), ...legacyHtmlRedirects }, + redirects: buildRedirects(base), output: 'static', integrations: [ sitemap({ diff --git a/site/public/robots.txt b/site/public/robots.txt index eff0940..411b4f3 100644 --- a/site/public/robots.txt +++ b/site/public/robots.txt @@ -1,5 +1,9 @@ User-agent: * Allow: / +Disallow: /awesome-prometheus-alerts/rules.html +Disallow: /awesome-prometheus-alerts/alertmanager.html +Disallow: /awesome-prometheus-alerts/blackbox-exporter.html +Disallow: /awesome-prometheus-alerts/sleep-peacefully.html # AI search bots — explicitly allowed for citation User-agent: GPTBot diff --git a/site/src/pages/alertmanager.html.astro b/site/src/pages/alertmanager.html.astro new file mode 100644 index 0000000..cdb2a86 --- /dev/null +++ b/site/src/pages/alertmanager.html.astro @@ -0,0 +1,16 @@ +--- +const base = import.meta.env.BASE_URL.replace(/\/$/, ''); +const destination = `${base}/alertmanager/`; +--- + + +
+ +Redirecting to {destination}…
+ + diff --git a/site/src/pages/blackbox-exporter.html.astro b/site/src/pages/blackbox-exporter.html.astro new file mode 100644 index 0000000..502ead9 --- /dev/null +++ b/site/src/pages/blackbox-exporter.html.astro @@ -0,0 +1,16 @@ +--- +const base = import.meta.env.BASE_URL.replace(/\/$/, ''); +const destination = `${base}/blackbox-exporter/`; +--- + + + + +Redirecting to {destination}…
+ + diff --git a/site/src/pages/rules.html.astro b/site/src/pages/rules.html.astro new file mode 100644 index 0000000..e447221 --- /dev/null +++ b/site/src/pages/rules.html.astro @@ -0,0 +1,16 @@ +--- +const base = import.meta.env.BASE_URL.replace(/\/$/, ''); +const destination = `${base}/rules/`; +--- + + + + +Redirecting to {destination}…
+ + diff --git a/site/src/pages/sleep-peacefully.html.astro b/site/src/pages/sleep-peacefully.html.astro new file mode 100644 index 0000000..6a11ffe --- /dev/null +++ b/site/src/pages/sleep-peacefully.html.astro @@ -0,0 +1,16 @@ +--- +const base = import.meta.env.BASE_URL.replace(/\/$/, ''); +const destination = `${base}/sleep-peacefully/`; +--- + + + + +Redirecting to {destination}…
+ +