关于评论的判断

This commit is contained in:
浪子 2024-05-17 18:23:58 +08:00
parent 46f50de81b
commit 965dd0fc7f
8 changed files with 22 additions and 16 deletions

View File

@ -28,7 +28,3 @@
</section> </section>
</main> </main>
<?php $this->need('footer.php'); ?> <?php $this->need('footer.php'); ?>
<script src="https://cdnjs.sgcd.net/code-highlight/js/prism.js"></script>
<link rel="stylesheet" href="https://cdnjs.sgcd.net/code-highlight/css/prism.css" />
<script src="<?php $this->options->themeUrl('/dist/js/bundle.js'); ?>"></script>
<script>Prism.highlightAll()</script>

View File

@ -8,4 +8,4 @@ https://github.com/bigfa/hugo-theme-farallon
70% 70%
## 待实现 ## 待实现
-[]豆瓣观影 -[] 豆瓣观影

View File

@ -57,7 +57,7 @@
<header class="archive-header archive-header__search"> <header class="archive-header archive-header__search">
<div class="pagination"> <div class="pagination">
<h2>Sorry</h2> <h2>Sorry</h2>
<p>很遗憾,未找到您想看的内容</p> <p>很遗憾,未找到您期待的内容</p>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php $this->pageNav('&laquo; 前一页', '后一页 &raquo;'); ?> <?php $this->pageNav('&laquo; 前一页', '后一页 &raquo;'); ?>

View File

@ -74,7 +74,7 @@
<?php else: ?> <?php else: ?>
<?php _e(''); ?> <?php _e(''); ?>
<?php endif; ?> <?php endif; ?>
<?php $this->options->twikoo(); ?>
</div> </div>
</div> </div>
</main> </main>

View File

@ -24,7 +24,9 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
</ul> </ul>
</div> </div>
<?php if ($this->allow('comment')): ?>
<?php $this->need('comments.php'); ?> <?php $this->need('comments.php'); ?>
<?php endif; ?>
</section> </section>

View File

@ -9,7 +9,12 @@
<?php $this->content(); ?> <?php $this->content(); ?>
</div> </div>
</article> </article>
<!-- 判断如果禁止评论则不显示评论的div -->
<?php if ($this->allow('comment')): ?>
<?php $this->need('comments.php'); ?> <?php $this->need('comments.php'); ?>
<?php endif; ?>
<!-- 可以使用第三方评论-->
<?php $this->options->twikoo(); ?>
</section> </section>
<?php $this->need('footer.php'); ?> <?php $this->need('footer.php'); ?>

View File

@ -78,8 +78,11 @@
</nav> </nav>
</ul> </ul>
</article> </article>
<!-- 判断如果禁止评论则不显示评论的div -->
<?php if ($this->allow('comment')): ?>
<?php $this->need('comments.php'); ?> <?php $this->need('comments.php'); ?>
<?php endif; ?>
<!-- 可以使用第三方评论-->
<?php $this->options->twikoo(); ?>
</main> </main>
<?php $this->need('footer.php'); ?> <?php $this->need('footer.php'); ?>

View File

@ -15,14 +15,14 @@
</a> </a>
</h2> </h2>
<div class="description" itemprop="about"> <div class="description" itemprop="about">
<!-- 本功能实现 借助插件实现 -->
<?php <?php
// 判断是否存在自定义字段summary并输出否则输出自动生成的摘要 // 判断是否存在自定义字段summary并输出否则输出自动生成的摘要
if($this->fields->summary){ if($this->fields->summary){
echo $this->fields->summary; echo $this->fields->summary;
} else { } else {
$this->excerpt(180); $this->excerpt(180);
} }?>
?>
</div> </div>
<div class="meta"> <div class="meta">
<svg class="icon" viewBox="0 0 1024 1024" width="16" height="16"> <svg class="icon" viewBox="0 0 1024 1024" width="16" height="16">