add 分类图片获取
This commit is contained in:
parent
2b595583c1
commit
d1e6567cc9
|
@ -3,6 +3,9 @@
|
||||||
移植自 `bigfa `大大的 `hugo-theme-farallon` 原汁原味,可以直接使用 原主题的CSS
|
移植自 `bigfa `大大的 `hugo-theme-farallon` 原汁原味,可以直接使用 原主题的CSS
|
||||||
精简部分 JS.
|
精简部分 JS.
|
||||||
|
|
||||||
|
- 2024.7.4
|
||||||
|
把分类图片以`mid.jpg`的形式在主题`img`目录下,自动匹配
|
||||||
|
|
||||||
- 2024.6.12
|
- 2024.6.12
|
||||||
|
|
||||||
更新豆瓣API获取方式
|
更新豆瓣API获取方式
|
||||||
|
@ -50,9 +53,9 @@ https://github.com/bigfa/hugo-theme-farallon
|
||||||
|
|
||||||
### 已知问题
|
### 已知问题
|
||||||
|
|
||||||
由于typecho分类并无图片,所以默认使用
|
~~由于typecho分类并无图片,所以默认使用~~
|
||||||
`bigfa` 的 `https://static.fatesinger.com/2021/12/vhp6eou5x2wqh2zy.jpg`
|
~~`bigfa` 的 `https://static.fatesinger.com/2021/12/vhp6eou5x2wqh2zy.jpg` ~~
|
||||||
可以自行替换或者删除
|
~~可以自行替换或者删除~~
|
||||||
|
|
||||||
|
|
||||||
### 豆瓣观影
|
### 豆瓣观影
|
||||||
|
|
16
comments.php
16
comments.php
|
@ -43,7 +43,6 @@
|
||||||
<?php $this->comments()->to($comments); ?>
|
<?php $this->comments()->to($comments); ?>
|
||||||
<?php if($this->allow('comment')): ?>
|
<?php if($this->allow('comment')): ?>
|
||||||
<?php if ($this->is('attachment')) : ?>
|
<?php if ($this->is('attachment')) : ?>
|
||||||
<?php _e(''); ?>
|
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<h3 class="comments--title" id="comments">
|
<h3 class="comments--title" id="comments">
|
||||||
<svg viewBox="0 0 24 24" class="icon" aria-hidden="true" width="16" height="16">
|
<svg viewBox="0 0 24 24" class="icon" aria-hidden="true" width="16" height="16">
|
||||||
|
@ -52,8 +51,10 @@
|
||||||
d="M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01zm8.005-6c-3.317 0-6.005 2.69-6.005 6 0 3.37 2.77 6.08 6.138 6.01l.351-.01h1.761v2.3l5.087-2.81c1.951-1.08 3.163-3.13 3.163-5.36 0-3.39-2.744-6.13-6.129-6.13H9.756z">
|
d="M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01zm8.005-6c-3.317 0-6.005 2.69-6.005 6 0 3.37 2.77 6.08 6.138 6.01l.351-.01h1.761v2.3l5.087-2.81c1.951-1.08 3.163-3.13 3.163-5.36 0-3.39-2.744-6.13-6.129-6.13H9.756z">
|
||||||
</path>
|
</path>
|
||||||
</g>
|
</g>
|
||||||
</svg><?php $this->commentsNum(_t('0'), _t('1'), _t('%d')); ?>
|
</svg>
|
||||||
</h3>
|
<?php $this->commentsNum(_t('0'), _t('1'), _t('%d')); ?>
|
||||||
|
</h3>
|
||||||
|
<ol class="commentlist sulliComment--list"></ol>
|
||||||
<div id="<?php $this->respondId(); ?>" class="comment-respond">
|
<div id="<?php $this->respondId(); ?>" class="comment-respond">
|
||||||
<div class="cancel-comment-reply cancel-comment-reply-link"><?php $comments->cancelReply(); ?></div>
|
<div class="cancel-comment-reply cancel-comment-reply-link"><?php $comments->cancelReply(); ?></div>
|
||||||
<form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" role="form" class="comment-form">
|
<form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" role="form" class="comment-form">
|
||||||
|
@ -76,7 +77,6 @@
|
||||||
<p class="comment-form-comment">
|
<p class="comment-form-comment">
|
||||||
<textarea rows="8" cols="50" name="text" id="textarea" class="textarea" onkeydown="if(event.ctrlKey&&event.keyCode==13){document.getElementById('misubmit').click();return false};" placeholder="<?php _e('评论审核后显示,请勿重复提交...'); ?>" required ><?php $this->remember('text'); ?></textarea>
|
<textarea rows="8" cols="50" name="text" id="textarea" class="textarea" onkeydown="if(event.ctrlKey&&event.keyCode==13){document.getElementById('misubmit').click();return false};" placeholder="<?php _e('评论审核后显示,请勿重复提交...'); ?>" required ><?php $this->remember('text'); ?></textarea>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p class="form-submit">
|
<p class="form-submit">
|
||||||
<button type="submit" class="submit" id="misubmit"><?php _e('提交评论(Ctrl+Enter)'); ?></button>
|
<button type="submit" class="submit" id="misubmit"><?php _e('提交评论(Ctrl+Enter)'); ?></button>
|
||||||
</p>
|
</p>
|
||||||
|
@ -84,9 +84,8 @@
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?php _e(''); ?>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<ol class="commentlist sulliComment--list"></ol>
|
|
||||||
<?php if ($comments->have()): ?>
|
<?php if ($comments->have()): ?>
|
||||||
<?php $comments->listComments(); ?>
|
<?php $comments->listComments(); ?>
|
||||||
<?php
|
<?php
|
||||||
|
@ -161,8 +160,3 @@ function threadedComments($comments, $options) {
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<ol class="commentlist">
|
|
||||||
<?php $this->comments()->to($comments); ?>
|
|
||||||
<?php while($comments->next()): ?>
|
|
||||||
<?php endwhile; ?>
|
|
||||||
</ol>
|
|
||||||
|
|
|
@ -12,17 +12,26 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||||
<h2 class="post--single__subtitle"><?php $this->content(); ?> </h2>
|
<h2 class="post--single__subtitle"><?php $this->content(); ?> </h2>
|
||||||
</header>
|
</header>
|
||||||
<section class="category--list">
|
<section class="category--list">
|
||||||
<?php $this->widget('Widget_Metas_Category_List')->parse('
|
<?php $this->widget('Widget_Metas_Category_List')->to($categories); ?>
|
||||||
<div class="category--item">
|
<?php while($categories->next()): ?>
|
||||||
<img src="https://static.fatesinger.com/2021/12/vhp6eou5x2wqh2zy.jpg" class="category--cover"/>
|
<?php
|
||||||
<div class="category--content">
|
// 获取分类 ID
|
||||||
<a href="{permalink}" class="category--card">{name}
|
$categoryId = $categories->mid;
|
||||||
<span>({count})</span>
|
// 获取主题URL
|
||||||
</a>
|
$themeUrl = $this->options->themeUrl;
|
||||||
<div class="category--desc">{description}</div>
|
// 为每个分类生成图片地址
|
||||||
</div>
|
$categoryImage = $themeUrl . 'img/' . $categoryId . '.jpg';
|
||||||
</div>
|
?>
|
||||||
'); ?>
|
<div class="category--item">
|
||||||
|
<img class="category--cover" src="<?php echo $categoryImage; ?>" loading="lazy" alt="<?php $categories->name(); ?>">
|
||||||
|
<div class="category--content">
|
||||||
|
<a class="category--card" href="<?php $categories->permalink(); ?>"><?php $categories->name(); ?>
|
||||||
|
<span>(<?php $categories->count(); ?>)</span></a>
|
||||||
|
<div class="category--desc"> <?php $categories->description(); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endwhile; ?>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<?php $this->need('footer.php'); ?>
|
<?php $this->need('footer.php'); ?>
|
Loading…
Reference in New Issue