summaryrefslogtreecommitdiff
path: root/post
diff options
context:
space:
mode:
Diffstat (limited to 'post')
-rw-r--r--post/post-content.php3
-rw-r--r--post/post-item.php13
2 files changed, 11 insertions, 5 deletions
diff --git a/post/post-content.php b/post/post-content.php
index a1fdd24..56d160d 100644
--- a/post/post-content.php
+++ b/post/post-content.php
@@ -1,7 +1,8 @@
<?php
$content = $this->content;
- $content = preg_replace('/<table(.*?)>/s','<table class="table table-striped table-hover">',$content);
+ $content = preg_replace('/<a(.*?)>/s','<a ${1} data-pjax>',$content);
+ $content = preg_replace('/<table(.*?)>/s','<table class="table table-striped table-hover table-bordered">',$content);
$content = preg_replace('/<pre><code>/s','<pre><code class="language-html">',$content);
$content = preg_replace('/<img(.*?)src="(.*?)"(.*?)alt="(.*?)"(.*?)>/s','<a data-fancybox="gallery" href="${2}" class="gallery-link"><img${1}src="${2}"${3}></a><span class="post-img-alt">${4}</span>',$content);
diff --git a/post/post-item.php b/post/post-item.php
index 5452f45..262632f 100644
--- a/post/post-item.php
+++ b/post/post-item.php
@@ -12,10 +12,10 @@
<?php $this->author->gravatar(50) ?>
</div>
<div class="col-md-11 col-xs-10">
- <h4 class="saying-title"><a href="<?php $this->permalink() ?>"><?php $this->title(); ?></a></h4>
+ <h4 class="saying-title"><a href="<?php $this->permalink() ?>" data-pjax><?php $this->title(); ?></a></h4>
<div class="saying-info"><?php $this->date('F j, Y'); ?></div>
- <a href="<?php $this->permalink() ?>" class="read-more pull-right btn btn-default">前往吐槽</a>
+ <a href="<?php $this->permalink() ?>" class="read-more pull-right btn btn-default" data-pjax>前往吐槽</a>
</div>
</div>
</div>
@@ -24,7 +24,7 @@
<?php endif; ?>
<!-- 小板式文章 -->
<?php elseif($this->fields->type=='2'): ?>
- <a href="<?php $this->permalink() ?>" class="post-link">
+ <a href="<?php $this->permalink() ?>" class="post-link" data-pjax>
<div class="item post-item">
<div class="row">
<div style="height:160px;background:url('<?php $this->fields->banner(); ?>');background-repeat:no-repeat;background-size:cover" class="col-md-3 col-xs-5 post-banner-sm"></div>
@@ -45,7 +45,7 @@
<br />
<?php else: ?>
<!-- 普通文章 -->
- <a href="<?php $this->permalink() ?>" class="post-link">
+ <a href="<?php $this->permalink() ?>" class="post-link" data-pjax>
<div class="item post-item">
<?php if ($this->is('index')): ?>
<div class="post-banner">
@@ -58,6 +58,11 @@
<h2 class="index-post-header"><?php $this->sticky(); $this->title() ?></h4>
<p class="excerpt">
+ <?php if($this->fields->topic && $this->fields->topic!='') :?>
+ <blockquote class="post-topic">
+ <p><?php $this->fields->topic(); ?></p>
+ </blockquote>
+ <?php endif; ?>
<?php $this->need('post/post-excerpt.php'); ?>
<?php echo $this->excerpt(100); ?>
</p>