Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangpeng96 committed Feb 29, 2024
2 parents 225e7b4 + d84e261 commit 6182044
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
8 changes: 4 additions & 4 deletions var/Widget/Archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ class Archive extends Contents
/**
* 本页关键字
*
* @var string
* @var string|null
*/
private string $archiveKeywords;
private ?string $archiveKeywords = null;

/**
* 本页描述
*
* @var string
* @var string|null
*/
private ?string $archiveDescription = null;

Expand Down Expand Up @@ -1023,7 +1023,7 @@ public function header(?string $rule = null)
$header .= '<meta name="twitter:title" property="og:title" itemprop="name" content="'
. htmlspecialchars($this->archiveTitle ?? $this->options->title) . '" />' . "\n";
$header .= '<meta name="twitter:description" property="og:description" itemprop="description" content="'
. htmlspecialchars($this->archiveDescription ?? $this->options->description) . '" />' . "\n";
. htmlspecialchars($this->archiveDescription ?? ($this->options->description ?? '')) . '" />' . "\n";
$header .= '<meta property="og:site_name" content="' . htmlspecialchars($this->options->title) . '" />' . "\n";
$header .= '<meta name="twitter:card" content="summary" />' . "\n";
$header .= '<meta name="twitter:domain" content="' . $this->options->siteDomain . '" />' . "\n";
Expand Down
27 changes: 27 additions & 0 deletions var/Widget/Base/Contents.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
* @property-read string $commentUrl
* @property-read string $trackbackUrl
* @property-read string $responseUrl
* @property-read string $year
* @property-read string $month
* @property-read string $day
*/
class Contents extends Base implements QueryInterface, RowFilterInterface, PrimaryKeyInterface, ParamsDelegateInterface
{
Expand Down Expand Up @@ -922,4 +925,28 @@ protected function ___responseUrl(): string
{
return $this->permalink . '#' . $this->respondId;
}

/**
* @return string
*/
protected function ___year(): string
{
return $this->date->year;
}

/**
* @return string
*/
protected function ___month(): string
{
return $this->date->month;
}

/**
* @return string
*/
protected function ___day(): string
{
return $this->date->day;
}
}

0 comments on commit 6182044

Please sign in to comment.