删除了字数统计
把douban设置移到自定义页面
This commit is contained in:
浪子
2024-12-13 14:36:50 +08:00
parent 8b692a05d1
commit ff27b5558a
3 changed files with 19 additions and 86 deletions
+12 -6
View File
@@ -14,12 +14,18 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
</header>
<div class="site--main">
<div class="db--container"></div>
<script>
new Douban({
baseAPI: '<?php $this->options->doubanID() ?>', // api
container: ".db--container", // 容器名
});
</script>
<?php
// 获取自定义字段 douban 的值,如果不存在则使用默认值
$douban = $this->fields->douban ? $this->fields->douban : 'https://db.imsun.org/';
// 确保URL末尾只有一个斜杠
$douban = rtrim($douban, '/') . '/';
?>
<script>
new Douban({
baseAPI: <?php echo json_encode($douban); ?>,
container: ".db--container",
});
</script>
</div>
</section>
<?php $this->need('footer.php'); ?>