From 30cffc211d3bd768c078dd0f4329b02e6201f7b5 Mon Sep 17 00:00:00 2001
From: hbrain
Date: Thu, 11 Jun 2026 20:25:43 +0200
Subject: [PATCH] Keywords subscribe, contact, journal, postcard in description
marked as link to contact.php in new tab. Modified generate_content to
include those words.
---
bin/generate_data.sh | 1 +
index.php | 13 ++++++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/bin/generate_data.sh b/bin/generate_data.sh
index 5cbfb6a..ae1ef57 100755
--- a/bin/generate_data.sh
+++ b/bin/generate_data.sh
@@ -211,6 +211,7 @@ Content rules:
- Roasting is allowed.
- Profanity is allowed only if it fits the selected personality.
- Do not invent specific facts that are not visible or provided.
+- Description MUST contain at least one of the following words (preferably more): subscribe, contact, postcard, journal. It's ok to use the same word mutliple times.
JSON rules:
- Output JSON only.
diff --git a/index.php b/index.php
index 77b1a3d..9e49390 100644
--- a/index.php
+++ b/index.php
@@ -5,6 +5,13 @@ foreach (["videos_dir", "thumbs_dir", "uploads_dir"] as $d) if (!is_dir($config[
if (!is_dir(__DIR__ . "/cache")) mkdir(__DIR__ . "/cache", 0775, true);
function h($s){ return htmlspecialchars((string)$s, ENT_QUOTES, "UTF-8"); }
+function render_description_html($s){
+ $html = h($s);
+ $linked = preg_replace_callback('/(?' . $m[0] . '↗ (opens in new tab)';
+ }, $html);
+ return nl2br($linked ?? $html, false);
+}
function nice_title($s){ return trim(ucwords(str_replace(['_','-'], ' ', (string)$s))); }
function lower_text($s){ return function_exists('mb_strtolower') ? mb_strtolower((string)$s, 'UTF-8') : strtolower((string)$s); }
function fold_text($s){
@@ -443,6 +450,10 @@ $siteHeaderTitle = $headerTitles[array_rand($headerTitles)];
.video-info .meta{margin:0 0 .45rem}
.description-teaser{margin:.15rem 0 .45rem;color:#EADFC9}
.description-quote{margin:.15rem 0 .45rem;font-style:italic;font-size:.82rem;color:#D6D9DE}
+.description-contact-link{color:#3BA7A0;text-decoration:underline;text-underline-offset:.12em}
+.description-contact-link:visited{color:#3BA7A0}
+.description-contact-link:hover,.description-contact-link:focus-visible{color:#4fb9b2}
+.external-link-icon{font-size:.78em;margin-left:.15em;vertical-align:.12em}
#videos .video-wrapper{align-self:start}
#videos .video-info{align-self:start}
#videos .video-info .description{margin-top:0}
@@ -525,7 +536,7 @@ $siteHeaderTitle = $headerTitles[array_rand($headerTitles)];
=h($m['location'])?>
=h((string)$m['teaser'])?>
- =nl2br(h($m['description']), false)?>
+ =render_description_html($m['description'])?>
“=h(trim((string)$m['quote_da'], "\"“”"))?>”