Files
SANGUSHUI/functions.php
sagrrecn acc2487481 1.0
2026-02-19 13:26:07 +08:00

52 lines
1.7 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
function themeConfig($form)
{
$logoUrl = new \Typecho\Widget\Helper\Form\Element\Text(
'logoUrl',
null,
null,
_t('网站 Logo'),
_t('在这里填写图片 URL网站将显示 Logo')
);
$form->addInput($logoUrl->addRule('url', _t('请填写正确的 URL 地址')));
$colorSchema = new \Typecho\Widget\Helper\Form\Element\Select(
'colorSchema',
array(
null => _t('自动'),
'light' => _t('浅色'),
'dark' => _t('深色'),
'customize' => _t('自定义'),
),
null,
_t('外观风格'),
_t('如果选择了自定义,主题将使用 theme.css 的样式')
);
$form->addInput($colorSchema);
}
function postMeta(
\Widget\Archive $archive,
string $metaType = 'archive'
)
{
?>
<header class="entry-header text-center">
<h1 class="entry-title" itemprop="name headline">
<a href="<?php $archive->permalink() ?>" itemprop="url"><?php $archive->title() ?></a>
</h1>
<?php if ($metaType != 'page'): ?>
<ul class="entry-meta list-inline text-muted">
<li class="feather-calendar"><time datetime="<?php $archive->date('c'); ?>" itemprop="datePublished"><?php $archive->date(); ?></time></li>
<li class="feather-folder"><?php $archive->category(', '); ?></li>
<li class="feather-message"><a href="<?php $archive->permalink() ?>#comments" itemprop="discussionUrl"><?php $archive->commentsNum(_t('暂无评论'), _t('1 条评论'), _t('%d 条评论')); ?></a></li>
</ul>
<?php endif; ?>
</header>
<?php
}