summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorEltrac <45323514+BigCoke233@users.noreply.github.com>2019-07-17 13:28:56 +0800
committerGitHub <noreply@github.com>2019-07-17 13:28:56 +0800
commit76317320c58d6c5a859dbf9e8c8d0d1ca06053dc (patch)
tree26309679b37f697424a95df8c2d4e0cdc050cf28 /index.php
parentc0a0f26cb2e9715478ce4eeec2c660e738a2d7da (diff)
文章支持自定义摘要
Diffstat (limited to 'index.php')
-rw-r--r--index.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/index.php b/index.php
index 8c21025..2db75f8 100644
--- a/index.php
+++ b/index.php
@@ -31,7 +31,14 @@ $this->need('includes/header.php');
<a href="<?php $this->permalink(); ?>" class="post-link">
<h1 class="post-title"><?php $this->sticky(); ?><?php $this->title(); ?></h1>
</a>
- <p class="post-excerpt"><?php $this->excerpt(); ?></p>
+ <p class="post-excerpt">
+ <?php if($this->fields->excerpt && $this->fields->excerpt!='') {
+ echo $this->fields->excerpt;
+ }else{
+ echo $this->excerpt(130);
+ }
+ ?>
+ </p>
<p class="post-meta"><i class="iconfont icon-block"></i> <?php $this->category(','); ?>&emsp;<i class="iconfont icon-comments"></i> <?php $this->commentsNum('None', 'Only 1', '%d'); ?>&emsp;<i class="iconfont icon-clock"></i> <?php $this->date(); ?></p>
<p class="post-button-box"><a href="<?php $this->permalink(); ?>" class="post-button">Read More</a></p>
</div>