article image click links to article
This commit is contained in:
parent
92861a3b56
commit
5de16a03ce
|
@ -16,7 +16,9 @@
|
||||||
</p>
|
</p>
|
||||||
{{ if .Site.Params.imageInArticlePreview }}
|
{{ if .Site.Params.imageInArticlePreview }}
|
||||||
{{ if .Params.Image }}
|
{{ if .Params.Image }}
|
||||||
<img src="{{ .Params.Image }}" />
|
<a class="unstyledLink" href="{{ .Permalink }}">
|
||||||
|
<img src="{{ .Params.Image }}" />
|
||||||
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{ if (site.Params.articleSummary | default true) }}
|
{{ if (site.Params.articleSummary | default true) }}
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
function renderImage(image) {
|
function renderImage(image, link) {
|
||||||
if (!image) return '';
|
if (!image) return '';
|
||||||
return `<img src="${image}" />`
|
return `<a href="${link}"><img src="${image}" /></a>`;
|
||||||
}
|
}
|
||||||
function renderSingleArticle(article) {
|
function renderSingleArticle(article) {
|
||||||
return `
|
return `
|
||||||
|
@ -20,15 +20,15 @@
|
||||||
<a href="${article.link}">${article.title}</a>
|
<a href="${article.link}">${article.title}</a>
|
||||||
</h2>
|
</h2>
|
||||||
<p class="date">
|
<p class="date">
|
||||||
<span title='{{ i18n "date" | safeJS }}'> </span>
|
<span title='{{ i18n "date" | safeJS }}'> </span>
|
||||||
${article.date}
|
${article.date}
|
||||||
{{ if (.Site.Params.tagsInArticlePreview | default true) }}
|
{{ if (.Site.Params.tagsInArticlePreview | default true) }}
|
||||||
${renderTags(article.tags)}
|
${renderTags(article.tags)}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</p>
|
</p>
|
||||||
{{ if .Site.Params.imageInArticlePreview }}
|
{{ if .Site.Params.imageInArticlePreview }}
|
||||||
${renderImage(article.image)}
|
${renderImage(article.image, article.link)}
|
||||||
{{end}}
|
{{ end }}
|
||||||
{{ if (site.Params.articleSummary | default true) }}
|
{{ if (site.Params.articleSummary | default true) }}
|
||||||
<div class="articlePreview">
|
<div class="articlePreview">
|
||||||
<p>${article.summary}</p>
|
<p>${article.summary}</p>
|
||||||
|
|
Loading…
Reference in New Issue