主题配置有关的说明请查看说明文档
'; //主题色 $themeColor = new Typecho_Widget_Helper_Form_Element_Radio('themeColor', array( 'matcha' => _t('抹茶绿'), 'ocean' => _t('海青色'), 'kirin' => _t('秋麒麟'), 'maple' => _t('枫树红'), 'violet' => _t('紫罗兰'), 'custom' => _t('自定义主题色') ), 'matcha', _t('该设置相会影响首页的文章列表内的文章内容摘要如何显示。
若选择 根据 more 标签截断,主题会截取 <!--more--> 之前的内容,这样能保留这一文段的样式,而不是单调的文字。
若选择 截断前200字符,主题总是会截取文章前 200 字纯文本,且不保留原本样式。
若选择 不输出摘要,文章列表中只会显示文章标题和元信息。
') ); $form->addInput($IndexDisplayMode->addRule('required', _t('此处必须设置'))); //启用 ajax 评论 $EnableExtraSimple = new Typecho_Widget_Helper_Form_Element_Radio('EnableExtraSimple', array( 'able' => _t('启用'), 'disable' => _t('停用'), ), 'able', _t('超简洁模式(Beta)'), _t(' ') ); $form->addInput($EnableExtraSimple->addRule('required', _t('此处必须设置'))); /** * 相关信息 */ $favicon = new Typecho_Widget_Helper_Form_Element_Text('favicon', NULL, 'favicon.png', _t('浙ICP备19006255号-1 ),留空则不显示'));
$form->addInput($icpNum);
$startDate = new Typecho_Widget_Helper_Form_Element_Text('startDate', NULL, date('Y-m-d'), _t('网站建立日期'), _t('用于显示在页脚的版权信息,以及计算网站建立时长,格式为 Y-m-d'));
$form->addInput($startDate);
/**
* 进阶功能
*/
//首页相关链接
$relatedLinksTitle = new Typecho_Widget_Helper_Form_Element_Text('relatedLinksTitle', NULL, NULL, _t('下一个设置项不留空则生效,自定义相关链接之前显示的标题
')); $form->addInput($relatedLinksTitle); $relatedLinks = new Typecho_Widget_Helper_Form_Element_Textarea('relatedLinks', NULL, NULL, _t('首页「相关链接」内容'), _t('使用特定的 JSON 格式书写,可以在首页文章目录之前展示一个相关链接版块,详情请查看说明文档
')); $form->addInput($relatedLinks); /** * 附加功能 */ //启用 CDN 加速 $StaticCDN = new Typecho_Widget_Helper_Form_Element_Select('StaticCDN', array( 'local' => _t('本地资源(不加速)'), 'bytedance' => _t('字节跳动资源库(推荐)'), 'cdnjs' => _t('CDNJS'), 'custom'=> _t('自定义') ), 'local', _t('上一个设置选择「自定义」,则通过此处设置的 CDN 引入主题所需的静态文件。
如果您拥有自己的储存服务,可以将主题的 assets 目录上传,选择「自定义」并在这里填写对应的 URL,以 “/” 结尾。
')); $form->addInput($CustomCDN); //夜间模式设置 $DarkMode = new Typecho_Widget_Helper_Form_Element_Select('DarkMode', array( 'default' => _t('默认日间模式,自动+手动开关(默认)'), 'dark' => _t('默认夜间模式,自动+手动开关'), 'no' => _t('总是日间模式,不可开关(不启用夜间模式)'), 'always' => _t('总是夜间模式,不可开关'), ), 'default', _t('选择「夜间模式」应用方式'), _t('选择如何在你的网站上应用夜间模式') ); $form->addInput($DarkMode->addRule('required', _t('此处必须设置'))); //启用 ajax 评论 $EnableAjaxComment = new Typecho_Widget_Helper_Form_Element_Radio('EnableAjaxComment', array( 'able' => _t('启用'), 'disable' => _t('停用'), ), 'able', _t('是否启用 Ajax 评论无刷新功能(Beta)'), _t(' 启用后将使用 Ajax 异步提交评论,提交评论后页面不会刷新。这个功能目前还在测试中。 ') ); $form->addInput($EnableAjaxComment->addRule('required', _t('此处必须设置'))); //启用文章浏览量统计 $EnableViewsCount = new Typecho_Widget_Helper_Form_Element_Radio('EnableViewsCount', array( 'able' => _t('启用'), 'disable' => _t('停用'), ), 'able', _t('是否启用文章浏览量统计'), _t(' 启用后,将在文章列表和文章内页显示当前文章的浏览量,并实时统计。 ') ); $form->addInput($EnableViewsCount->addRule('required', _t('此处必须设置'))); //启用不蒜子统计 $EnableBusuanzi = new Typecho_Widget_Helper_Form_Element_Radio('EnableBusuanzi', array( 'able' => _t('启用'), 'disable' => _t('停用'), ), 'able', _t('是否启用 不蒜子 统计功能'), _t(' 不蒜子是一个即装即用的网页 js 计数脚本,目前可与主题进行对接显示访问数,默认启用 ') ); $form->addInput($EnableBusuanzi->addRule('required', _t('此处必须设置'))); //启用字数统计 $EnableWordsCounter = new Typecho_Widget_Helper_Form_Element_Radio('EnableWordsCounter', array( 'able' => _t('启用'), 'disable' => _t('停用'), ), 'disable', _t('是否启用 字数统计 功能'), _t(' 字数统计是一个基于WordsCounter插件统计全站字数的 ') ); $form->addInput($EnableWordsCounter->addRule('required', _t('此处必须设置'))); /** * 自定义 & 开发者设置 */ //自定义时间显示 $timeFormat = new Typecho_Widget_Helper_Form_Element_Text('timeFormat', NULL, NULL, _t('留空则默认采用人性化时间(即“昨天、前天、几天前”),若不想要使用人性化时间则在此填入 PHP 时间格式,例如:Y-m-d G:i:s
将会在显示在 footer 标签结束之前,即页脚版权信息和不算子统计之后,可以在这里写入备案信息等附加内容
')); $form->addInput($footerInfo); //自定义导航栏 $customNav = new Typecho_Widget_Helper_Form_Element_Textarea('customNav', NULL, NULL, _t('自定义导航栏'), _t('用 JSON 书写,具体格式参考文档。
')); $form->addInput($customNav); //自定义 head $customHead = new Typecho_Widget_Helper_Form_Element_Textarea('customHead', NULL, NULL, _t('自定义 head 头部'), _t('将会输出在 head 标签结束之前,通常用于引入 css 文件。
')); $form->addInput($customHead); //自定义 footer $customFooter = new Typecho_Widget_Helper_Form_Element_Textarea('customFooter', NULL, NULL, _t('自定义 footer 页脚'), _t('将会输出在 body 标签结束之前,通常用于引入 js 文件。
')); $form->addInput($customFooter); //自定义 pjax 回调函数 $pjaxCallback = new Typecho_Widget_Helper_Form_Element_Textarea('pjaxCallback', NULL, NULL, _t('Pjax 回调函数'), _t('用于在 Pjax 切换页面后刷新某些元素,避免失效。如果你没有使用其他插件或者没有遇到问题,这里应当留空。
')); $form->addInput($pjaxCallback); }