From 47520427460b908119c126dac9a0556b0b278223 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Thu, 16 Jan 2025 11:55:18 -0500
Subject: [PATCH] Send not_yet_a_page template as an HTTP 404 response instead
of HTTP 200.
This lets users see the same UI, but tells search engines this content doesn't
actually exist (yet), so they'll hopefully not index non-pages.
---
index.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.php b/index.php
index 520559f..081ee15 100644
--- a/index.php
+++ b/index.php
@@ -1245,7 +1245,7 @@ function sort_search_results($a, $b)
$cooked = '';
if (!file_exists($published_path)) {
- print_template('not_yet_a_page');
+ fail404('This page does not exist...yet!', 'not_yet_a_page');
} else {
print_template('view', [ 'cooked' => file_get_contents($published_path), 'preamble' => $preamble ]);
}