🐛 Fix title on kind pages

This commit is contained in:
Kazhnuz 2025-08-23 00:17:09 +02:00
parent 1a4264346a
commit 0923f5dd10
4 changed files with 33 additions and 0 deletions

View file

@ -143,6 +143,14 @@ class Theme
} catch (Exception $e) {
// Author doesn't exist
}
} elseif ($WHERE_AM_I == 'kind') {
try {
$kindKey = $url->slug();
$format = $site->titleFormatKind();
return $L->get($kindKey);
} catch (Exception $e) {
// Kind doesn't exist
}
} elseif ($WHERE_AM_I == 'home') {
return $L->get("Latest articles");
}
@ -195,6 +203,14 @@ class Theme
} catch (Exception $e) {
// Author doesn't exist
}
} elseif ($WHERE_AM_I == 'kind') {
try {
$kindKey = $url->slug();
$format = $site->titleFormatKind();
return $L->get('all-post-kind') . " " . $L->get($kindKey);
} catch (Exception $e) {
// Kind doesn't exist
}
} elseif ($WHERE_AM_I == 'home') {
return $L->get("all-post");
}
@ -221,6 +237,7 @@ class Theme
global $categories;
global $WHERE_AM_I;
global $page;
global $L;
if ($WHERE_AM_I == 'page') {
$format = $site->titleFormatPages();
@ -261,6 +278,14 @@ class Theme
} catch (Exception $e) {
// Author doesn't exist
}
} elseif ($WHERE_AM_I == 'kind') {
try {
$kindKey = $url->slug();
$format = $site->titleFormatKind();
$format = Text::replace('{{kind-name}}', $L->get($kindKey), $format);
} catch (Exception $e) {
// Kind doesn't exist
}
} else {
$format = $site->titleFormatHomepage();
}

View file

@ -50,6 +50,7 @@ class Site extends dbJSON
'titleFormatTag' => '{{tag-name}} | {{site-title}}',
'titleFormatAuthor' => '{{author-name}} | {{site-title}}',
'titleFormatArchive' => '{{archive-name}} | {{site-title}}',
'titleFormatKind' => '{{kind-name}} | {{site-title}}',
'imageRestrict' => true,
'imageRelativeToAbsolute' => false,
'thumbnailWidth' => 400, // px
@ -346,6 +347,11 @@ class Site extends dbJSON
return $this->getField('titleFormatArchive');
}
public function titleFormatKind()
{
return $this->getField('titleFormatKind');
}
public function titleFormatAuthor()
{
return $this->getField('titleFormatAuthor');

View file

@ -420,6 +420,7 @@
"all-post-tags": "All posts with the tag",
"all-post-archive": "All posts written in",
"all-post-author": "All posts written by",
"all-post-kind": "All posts using the following format :",
"all-post": "All the latest posts written on the blog"
}

View file

@ -431,5 +431,6 @@
"all-post-tags": "Tous les articles avec le tag",
"all-post-archive": "Tous les articles écrits en",
"all-post-author": "Tous les articles écrits par",
"all-post-kind": "Tous les post utilisant le format suivant :",
"all-post": "Tout les articles écrits récemment sur le blog"
}