summaryrefslogtreecommitdiffstats
path: root/blog
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2016-09-23 23:13:11 +0200
committerHarald Eilertsen <haraldei@anduin.net>2016-09-23 23:13:11 +0200
commit1cff80663610b68ec9a31a74d2aabf68184cb6ff (patch)
treec18d0d676620fc8e895b1009c397eeace6cecc01 /blog
parent8bbd13c073a968374367edd73e08af5144baf3e7 (diff)
downloadnorsk-urskog-main-1cff80663610b68ec9a31a74d2aabf68184cb6ff.tar.gz
norsk-urskog-main-1cff80663610b68ec9a31a74d2aabf68184cb6ff.tar.bz2
norsk-urskog-main-1cff80663610b68ec9a31a74d2aabf68184cb6ff.zip
Add support for page/post-images.
Add "page-image: imagepath" to the page or post front matter, and the image will be shown in the appropriate size for where the post is shown.
Diffstat (limited to 'blog')
-rw-r--r--blog/_includes/post-excerpt.html3
-rw-r--r--blog/_layouts/post.html3
2 files changed, 6 insertions, 0 deletions
diff --git a/blog/_includes/post-excerpt.html b/blog/_includes/post-excerpt.html
index 125e984..52704e7 100644
--- a/blog/_includes/post-excerpt.html
+++ b/blog/_includes/post-excerpt.html
@@ -2,6 +2,9 @@
<article class="post">
{% include post-header.html post = post %}
<section class="post-body">
+ {% if post.page-image %}
+ {{ post.page-image | img: "magick:resize:290x" }}
+ {% endif %}
{{ post.excerpt }}
<p><a href="{{ post.url | prepend: site.baseurl }}">{% t global.read_more %}</a></p>
diff --git a/blog/_layouts/post.html b/blog/_layouts/post.html
index cb33296..555bdc6 100644
--- a/blog/_layouts/post.html
+++ b/blog/_layouts/post.html
@@ -5,6 +5,9 @@ layout: default
<article class="post">
{% include post-header.html post = page %}
<section class="post-body">
+ {% if page.page-image %}
+ {{ page.page-image | img: "magick:resize:590x" }}
+ {% endif %}
{{ content }}
</section>
<footer>