added option to disable tags in article preview
This commit is contained in:
parent
2535186101
commit
3631685b4d
4 changed files with 12 additions and 10 deletions
|
|
@ -1,12 +1,11 @@
|
|||
<script>
|
||||
function renderTags(tags) {
|
||||
if (tags.length <= 0) return '';
|
||||
let res = '| <span title="tags"> </span>';
|
||||
for (let tag of tags) {
|
||||
res += `<a href="/tags/${tag}">#${tag}</a>
|
||||
`;
|
||||
}
|
||||
return res;
|
||||
if (tags.length <= 0) return '';
|
||||
let res = '| <span title="tags"> </span>';
|
||||
for (let tag of tags) {
|
||||
res += `<a href="/tags/${tag}">#${tag}</a>`;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
function renderImage(image) {
|
||||
if (!image) return '';
|
||||
|
|
@ -22,7 +21,9 @@
|
|||
<p class="date">
|
||||
<span title="Date"> </span>
|
||||
${article.date}
|
||||
${renderTags(article.tags)}
|
||||
{{ if (.Site.Params.tagsInArticlePreview | default true) }}
|
||||
${renderTags(article.tags)}
|
||||
{{ end }}
|
||||
</p>
|
||||
{{ if .Site.Params.imageInArticlePreview }}
|
||||
${renderImage(article.image)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue