summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorEltrac Koalar <hi@guhub.cn>2022-09-24 23:54:29 +0800
committerEltrac Koalar <hi@guhub.cn>2022-09-24 23:54:29 +0800
commitdb86bb4726d28d679e425d09e5b98672ede1ac10 (patch)
tree9add9672c7d4ecaff70f25e7ae61444937a47dc5 /includes
parent812c284d66134819eccc25a821e275e4bfcd36a6 (diff)
:newspaper: Add: 新增首页「相关链接」功能
Diffstat (limited to 'includes')
-rw-r--r--includes/post-list.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/includes/post-list.php b/includes/post-list.php
index 7e695a8..583ae60 100644
--- a/includes/post-list.php
+++ b/includes/post-list.php
@@ -6,7 +6,12 @@
'tag' => _t('标签 %s 下的文章'),
'author' => _t('%s 发布的文章')
), '', ''); ?></h3><?php } ?>
+ <?php if($this->is('index') && $this->options->relatedLinks!=''): ?><!-- 相关链接 -->
+ <?php if($this->options->relatedLinksTitle!=''): ?><h2 class="section-title"><?php $this->options->relatedLinksTitle(); ?></h2><?php endif; ?>
+ <section class="indexlink"><?php Matcha::relatedLinks($this); ?></section><?php endif; ?>
<!-- 文章列表 -->
+ <?php if($this->options->relatedLinksTitle!='' && $this->options->relatedLinks!=''): ?><h2 class="section-title">最新文章</h2><?php endif; ?>
+ <section class="latest-post">
<?php while($this->next()): ?>
<article class="post post-atmain<?php if($this->fields->thumbnail!='') echo ' post-with-thumbnail'; ?>" itemscope itemtype="http://schema.org/BlogPosting">
<div class="post-text">
@@ -26,6 +31,7 @@
</div><?php endif;?>
</article>
<?php endwhile; ?>
+ </section>
<!-- 分页按钮 -->
<div class="page-navigator">
<span id="previous"><?php $this->pageLink('<span class="iconfont">&#xe749;</span>'); ?></span>