summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorEltrac Koalar <hi@guhub.cn>2022-08-28 00:53:12 +0800
committerEltrac Koalar <hi@guhub.cn>2022-08-28 00:53:12 +0800
commit4c9b13dd4754aa3758439c6831f41448774df95e (patch)
tree8a1bd1c5124e01c6d4858db66de104448d744269 /functions.php
parent6e5a75d1eac52a34335c6f1eac7ff9ed1fd97db7 (diff)
:newspaper: Add: 用 tocbot 实现文章目录
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/functions.php b/functions.php
index 72ae387..4dcc217 100644
--- a/functions.php
+++ b/functions.php
@@ -20,4 +20,15 @@ function themeInit($archive) {
Helper::options()->commentsPageDisplay = 'first';//强制评论第一页
Helper::options()->commentsOrder = 'DESC';//将最新的评论展示在前
Helper::options()->commentsCheckReferer = false;//关闭检查评论来源URL与文章链接是否一致判断(否则会无法评论)
+}
+
+function themeFields($layout)
+{
+ $showTOC = new Typecho_Widget_Helper_Form_Element_Radio('showTOC', array(
+ true => _t('开启'),
+ false => _t('关闭')),
+ false,
+ _t('是否开启文章目录'),
+ _t('解析文章目录展示在文章页面左侧,代替侧边栏的位置'));
+ $layout->addItem($showTOC);
} \ No newline at end of file