Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/hauke96/hugo-theme-hamburg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHauke Stieler <mail@hauke-stieler.de>2020-04-23 17:53:52 +0300
committerHauke Stieler <mail@hauke-stieler.de>2020-04-23 17:53:52 +0300
commitbbca9d220e9b68b8ce8225758969af9d766855a2 (patch)
tree38b2b10407b5d96b931bd04b2381b0b260a3c316
parent1f6388c5cc5914bc7eb8060af3a81ab2e742f7a8 (diff)
Show article image also in article list
-rw-r--r--layouts/_default/li.html33
-rw-r--r--static/css/main.css16
2 files changed, 33 insertions, 16 deletions
diff --git a/layouts/_default/li.html b/layouts/_default/li.html
index 8e47819..b453b13 100644
--- a/layouts/_default/li.html
+++ b/layouts/_default/li.html
@@ -10,20 +10,25 @@
</div>
</div>
</header>
- <div>
- {{ if (isset .Params "summary") }}
- {{ markdownify .Params.Summary }}
- {{ else }}
- {{ .Summary }}
- {{ end }}
- </div>
- <footer>
- <div class="read-more-container">
- <a class="btn btn-primary" href="{{ .Permalink }}">
- <div>
+
+ {{ if (isset .Params "summary") }}
+ <div class="li-content">
+ <div class="summary-container">
+ <p>{{ markdownify .Params.Summary }}</p>
+ <a class="btn btn-primary" href="{{ .Permalink }}">
{{ i18n "readMore" }} <span aria-hidden="true">&rarr;</span>
- </div>
- </a>
+ </a>
+ </div>
+ {{ if (isset .Params "images") }}
+ <a href="{{ .Permalink }}">
+ <img class="embedded-image" src="{{ index .Params.images 0 | absLangURL }}"/>
+ </a>
+ {{ end }}
+ </div>
+ {{ else }}
+ <div>
+ NOT FOUND
+ {{ .Summary }}
</div>
- </footer>
+ {{ end }}
</article>
diff --git a/static/css/main.css b/static/css/main.css
index 498a445..2a7be43 100644
--- a/static/css/main.css
+++ b/static/css/main.css
@@ -189,8 +189,20 @@ main {
margin-bottom: 6px;
}
-.read-more-container {
- margin-top: 10px;
+.li-content {
+ display: flex;
+}
+
+.li-content img {
+ width: 250px;
+ margin-left: 20px;
+}
+
+.summary-container {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ align-items: flex-start;
}
/* Tag list */