Description updates
This commit is contained in:
parent
5df4ac4c7f
commit
7a17716711
3 changed files with 22 additions and 10 deletions
File diff suppressed because one or more lines are too long
|
|
@ -210,19 +210,19 @@ Required fields:
|
|||
- quote_da: Write exactly one sentence in Danish in the style of Anders Matthesen. The sentence should sound like a sharp, self-deprecating observation from a middle-aged motorcycle traveler who often ends up in absurd or unexpected situations.
|
||||
- personality: exactly "$PERSONALITY_KEY", used for teaser and description generation.
|
||||
- teaser: English, max 32 words
|
||||
- description: English, up to 448 words
|
||||
- description: English, up to 512 words
|
||||
- tags: 5 to 8 lowercase short tags
|
||||
|
||||
Content rules:
|
||||
- Use the selected personality at maximum intensity.
|
||||
- Do not be subtle.
|
||||
- The voice MUST BE provocative, opinionated, funny, and slightly over the top.
|
||||
- Highlight the funniest, strangest, most beautiful, or most ridiculous visible aspect.
|
||||
- Highlight the funniest, strangest, most beautiful, or most ridiculous visible aspect you see on the captured frames.
|
||||
- Be challenging, provocative, witty, and playful.
|
||||
- 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: subscribe, contact, journal.
|
||||
- Description MUST contain at least one of the following words: subscribe, contact.
|
||||
|
||||
JSON rules:
|
||||
- Output JSON only.
|
||||
|
|
|
|||
20
index.php
20
index.php
|
|
@ -251,7 +251,7 @@ function article_og_image_url($articleId){
|
|||
if (!preg_match('/^[0-9]{14}[a-f0-9]{16}$/', $articleId)) return '';
|
||||
$path = __DIR__ . '/out-dir/' . $articleId . '_og.jpg';
|
||||
if (!is_file($path)) return '';
|
||||
return 'https://bubulescu.org/out-dir/' . rawurlencode($articleId . '_og.jpg');
|
||||
return 'https://bubulescu.org/out-dir/' . rawurlencode($articleId . '_og.jpg') . '?v=' . filemtime($path);
|
||||
}
|
||||
|
||||
function render_404_page(){
|
||||
|
|
@ -493,6 +493,7 @@ $baseParams = ($rawKeyword !== '') ? ['q' => $rawKeyword] : [];
|
|||
$defaultOgImageUrl = 'https://bubulescu.org/assets/img/bubulescuorg.jpg';
|
||||
$ogImageUrl = $defaultOgImageUrl;
|
||||
$ogImageAlt = 'journal of an unreliable narrator.';
|
||||
$ogDescription = 'Motorcycle road stories, hockey passion, pizza nerdism and facts remembered by an unreliable narrator.';
|
||||
$ogType = ($articleId !== '') ? 'article' : 'website';
|
||||
$canonicalArticleUrl = ($articleId !== '') ? article_permalink_url($config, $articleId, $videoCache, true) : '';
|
||||
$ogUrl = ($canonicalArticleUrl !== '') ? $canonicalArticleUrl : 'https://bubulescu.org/';
|
||||
|
|
@ -510,6 +511,17 @@ if ($articleId !== '') {
|
|||
$ogImageAlt = $firstTitle;
|
||||
$pageTitle = $firstTitle;
|
||||
}
|
||||
$firstDescription = trim((string)($firstMeta['teaser'] ?? ''));
|
||||
if ($firstDescription === '') $firstDescription = trim((string)($firstMeta['description'] ?? ''));
|
||||
if ($firstDescription !== '') {
|
||||
$firstDescription = preg_replace('/\s+/', ' ', $firstDescription) ?? $firstDescription;
|
||||
if (function_exists('mb_strlen') && function_exists('mb_substr')) {
|
||||
if (mb_strlen($firstDescription) > 240) $firstDescription = rtrim(mb_substr($firstDescription, 0, 237)) . '…';
|
||||
} elseif (strlen($firstDescription) > 240) {
|
||||
$firstDescription = rtrim(substr($firstDescription, 0, 237)) . '...';
|
||||
}
|
||||
$ogDescription = $firstDescription;
|
||||
}
|
||||
}
|
||||
}
|
||||
$headerTitles = require __DIR__ . '/header_titles.php';
|
||||
|
|
@ -527,7 +539,7 @@ $siteHeaderTitle = $headerTitles[array_rand($headerTitles)];
|
|||
<!-- Basic Open Graph -->
|
||||
<meta property="og:type" content="<?=h($ogType)?>">
|
||||
<meta property="og:title" content="<?=h($ogImageAlt)?>">
|
||||
<meta property="og:description" content="Motorcycle road stories, hockey passion, pizza nerdism and facts remembered by an unreliable narrator.">
|
||||
<meta property="og:description" content="<?=h($ogDescription)?>">
|
||||
<meta property="og:url" content="<?=h($ogUrl)?>">
|
||||
<meta property="og:site_name" content="Bubulescu.Org">
|
||||
|
||||
|
|
@ -543,7 +555,7 @@ $siteHeaderTitle = $headerTitles[array_rand($headerTitles)];
|
|||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="<?=h($ogImageUrl)?>">
|
||||
<meta name="twitter:title" content="<?=h($ogImageAlt)?>">
|
||||
<meta name="twitter:description" content="Motorcycle road stories, hockey passion, pizza nerdism and facts remembered by an unreliable narrator.">
|
||||
<meta name="twitter:description" content="<?=h($ogDescription)?>">
|
||||
|
||||
<link rel="alternate" type="application/rss+xml" title="MVLog RSS" href="/feed.php">
|
||||
<link rel="icon" type="image/png" href="/assets/img/moto_travel.png">
|
||||
|
|
@ -631,7 +643,7 @@ $siteHeaderTitle = $headerTitles[array_rand($headerTitles)];
|
|||
$permalinkEnabled = $articleIdForVideo !== '' && article_permalink_enabled($config, $articleIdForVideo);
|
||||
$permalinkUrl = $permalinkEnabled ? article_permalink_url($config, $articleIdForVideo, $videoCache, false) : '';
|
||||
$shareUrl = $permalinkEnabled ? article_permalink_url($config, $articleIdForVideo, $videoCache, true) : '';
|
||||
$url = '/' . ltrim((string)$config['public_videos'], '/') . '/'.rawurlencode($name);
|
||||
$url = '/' . ltrim((string)$config['public_videos'], '/') . '/'.rawurlencode($name) . (is_file($v) ? '?v=' . filemtime($v) : '');
|
||||
$m = $videoCache[$name]['metadata'] ?? video_metadata($v);
|
||||
$posterUrl = video_thumb_public_url($config, $name);
|
||||
$dateFilterUrl = query_url(['q' => 'date=' . (string)($m['date'] ?? '')]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue