added option to show image in article preview
This commit is contained in:
parent
b2856c86b7
commit
f2eba5b387
|
@ -32,6 +32,8 @@ paginate = 5 # number of articles per page in the index
|
||||||
showTags = true # show the Tags menu item; default true
|
showTags = true # show the Tags menu item; default true
|
||||||
showRss = true # show the link for the RSS feed; default true
|
showRss = true # show the link for the RSS feed; default true
|
||||||
|
|
||||||
|
imageInArticlePreview = false # show images in article preview; default false
|
||||||
|
|
||||||
navtype = "standard" # changes the style of the pagination, available styles are: "standard", "circle"
|
navtype = "standard" # changes the style of the pagination, available styles are: "standard", "circle"
|
||||||
fontFamily = "JetBrains Mono" # changes the font, default "JetBrains Mono"
|
fontFamily = "JetBrains Mono" # changes the font, default "JetBrains Mono"
|
||||||
|
|
||||||
|
|
|
@ -257,10 +257,28 @@ h1, h2, h3, h4, h5, h6 {
|
||||||
|
|
||||||
// only hide hr in cards if they are in the article list
|
// only hide hr in cards if they are in the article list
|
||||||
// cards in list are divs, cards as in full-blown articles use the article tag
|
// cards in list are divs, cards as in full-blown articles use the article tag
|
||||||
div.card.discrete {
|
.postlistitem.card.discrete {
|
||||||
hr { display: none; }
|
hr { display: none; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.postlistitem.card {
|
||||||
|
img {
|
||||||
|
margin: 15px auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-width: 500px) {
|
||||||
|
.postlistitem.card {
|
||||||
|
img {
|
||||||
|
max-width: 250px;
|
||||||
|
float: left;
|
||||||
|
margin-right: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
overflow: auto; // clearfix
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
li {
|
li {
|
||||||
margin: 5px 0;
|
margin: 5px 0;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
{{/* pagination */}}
|
{{/* pagination */}}
|
||||||
{{ range (.Paginate $postsList).Pages }}
|
{{ range (.Paginate $postsList).Pages }}
|
||||||
<div class="card {{ if .Site.Params.discreteCards }}discrete{{ end }}">
|
<article class="card postlistitem {{ if .Site.Params.discreteCards }}discrete{{ end }}">
|
||||||
<h2>
|
<h2>
|
||||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||||
</h2>
|
</h2>
|
||||||
|
@ -21,12 +21,17 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</p>
|
</p>
|
||||||
|
{{ if .Site.Params.imageInArticlePreview }}
|
||||||
|
{{ if .Params.Image }}
|
||||||
|
<img src="{{ .Params.Image }}" />
|
||||||
|
{{ end }}
|
||||||
|
{{end}}
|
||||||
<div class="articlePreview">
|
<div class="articlePreview">
|
||||||
{{ .Summary }}
|
{{ .Summary }}
|
||||||
<a href="{{ .Permalink }}">Continue reading </a>
|
<a href="{{ .Permalink }}">Continue reading </a>
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</article>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{- partial "paginator.html" . -}}
|
{{- partial "paginator.html" . -}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue