mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 17:45:28 +00:00
add optional base postfix to the page title
This commit is contained in:
parent
f874583740
commit
8944bd2792
2 changed files with 21 additions and 0 deletions
|
|
@ -33,6 +33,10 @@
|
||||||
"ellipsize":
|
"ellipsize":
|
||||||
{
|
{
|
||||||
"mode":3
|
"mode":3
|
||||||
|
},
|
||||||
|
"postfix":
|
||||||
|
{
|
||||||
|
"hostname":true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"redirect":
|
"redirect":
|
||||||
|
|
|
||||||
|
|
@ -834,6 +834,23 @@ class Page
|
||||||
?string $value = null
|
?string $value = null
|
||||||
): void
|
): 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
|
// Build new tab label on title length reached
|
||||||
if ($value && mb_strlen($value) > $this->config->title->width->chars)
|
if ($value && mb_strlen($value) > $this->config->title->width->chars)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue