mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-13 06:01:21 +00:00
add optional base postfix to the page title
This commit is contained in:
parent
f874583740
commit
8944bd2792
@ -33,6 +33,10 @@
|
||||
"ellipsize":
|
||||
{
|
||||
"mode":3
|
||||
},
|
||||
"postfix":
|
||||
{
|
||||
"hostname":true
|
||||
}
|
||||
},
|
||||
"redirect":
|
||||
|
@ -834,6 +834,23 @@ class Page
|
||||
?string $value = null
|
||||
): void
|
||||
{
|
||||
// Append hostname postfix
|
||||
if ($this->config->title->postfix->hostname && str_starts_with($this->request->get_text(), 'gemini://'))
|
||||
{
|
||||
$address = new \Yggverse\Net\Address(
|
||||
$this->request->get_text()
|
||||
);
|
||||
|
||||
if ($address->getHost())
|
||||
{
|
||||
$value = sprintf(
|
||||
'%s - %s',
|
||||
$value,
|
||||
$address->getHost()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Build new tab label on title length reached
|
||||
if ($value && mb_strlen($value) > $this->config->title->width->chars)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user