Repository navigation
Expand file tree
/
Copy pathfunctions.php
More file actions
97 lines (89 loc) · 3.04 KB
/
Copy pathfunctions.php
File metadata and controls
97 lines (89 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?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')
);
$sidebarBlock = new \Typecho\Widget\Helper\Form\Element\Checkbox(
'sidebarBlock',
[
'ShowTOC' => _t('显示文章目录'),
'ShowRecentPosts' => _t('显示最新文章'),
'ShowRecentComments' => _t('显示最近回复'),
'ShowCategory' => _t('显示分类'),
'ShowArchive' => _t('显示归档'),
'ShowOther' => _t('显示其它杂项')
],
['ShowTOC', 'ShowCategory', 'ShowArchive'],
_t('侧边栏显示')
);
$copyrightInfo = new \Typecho\Widget\Helper\Form\Element\Text(
'copyrightInfo',
null,
null,
_t('页脚版权信息'),
_t('在这里填入你的大名(将在页脚显示为 "© 今年年份 你的大名")')
);
$beianInfo = new \Typecho\Widget\Helper\Form\Element\Text(
'beianInfo',
null,
null,
_t('页脚备案信息'),
_t('在这里填入你的备案号(将在页脚显示;为空则不显示)')
);
$prismjsLineNumbers = new \Typecho\Widget\Helper\Form\Element\Radio(
'prismjsLineNumbers',
[
true => _t('启用'),
false => _t('禁用')
],
false,
_t('Prism.js 代码块行数显示'),
_t('需要您的 Prism.js 安装了行数显示插件。<br>该选项对打印功能无效,打印时始终不显示行数')
);
$form->addInput($logoUrl->addRule('url', _t('请填写一个合法的URL地址')));
$form->addInput($sidebarBlock->multiMode());
$form->addInput($copyrightInfo);
$form->addInput($beianInfo);
$form->addInput($prismjsLineNumbers);
}
function postMeta(
\Widget\Archive $archive,
string $metaType = 'archive'
)
{
$titleTag = $metaType == 'archive' ? 'h2' : 'h1';
?>
<<?php echo $titleTag ?> class="post-title" itemprop="name headline">
<a itemprop="url"
href="<?php $archive->permalink() ?>"><?php $archive->title() ?></a>
</<?php echo $titleTag ?>>
<ul class="post-meta">
<li>
<time datetime="<?php $archive->date('c'); ?>" itemprop="datePublished"><?php $archive->date(); ?></time>
</li>
<?php if ($metaType != 'page'): ?>
<li><?php $archive->category(', ', true, _t('無')); ?></li>
<li><?php $archive->tags(', ', true, _t('無')); ?></li>
<?php endif; ?>
</ul>
<?php
}
/*
function themeFields($layout)
{
$logoUrl = new \Typecho\Widget\Helper\Form\Element\Text(
'logoUrl',
null,
null,
_t('站点LOGO地址'),
_t('在这里填入一个图片URL地址, 以在网站标题前加上一个LOGO')
);
$layout->addItem($logoUrl);
}
*/