From a3995bf898c38ed755a3e1bd60b3b4aaf27670ec Mon Sep 17 00:00:00 2001 From: Lars Henrik Mai Date: Wed, 9 Apr 2014 17:41:17 +0200 Subject: add custom blog article summary generator that truncates to first pararaph --- source/_article_summary.html.erb | 5 +++++ source/index.html.erb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 source/_article_summary.html.erb (limited to 'source') diff --git a/source/_article_summary.html.erb b/source/_article_summary.html.erb new file mode 100644 index 0000000..fbb4cfd --- /dev/null +++ b/source/_article_summary.html.erb @@ -0,0 +1,5 @@ +<% article = article_summary %> +
+

<%= link_to article.title, article %> <%= article.date.strftime('%b %e') %>

+ <%= article.summary %> +
diff --git a/source/index.html.erb b/source/index.html.erb index 98486b6..dbef3db 100644 --- a/source/index.html.erb +++ b/source/index.html.erb @@ -20,7 +20,7 @@ title: sublab - Ein Hackerspace in Leipzig

[ Neues aus dem sublab]

- <%= partial "article", collection: blog.articles[0..4] %> + <%= partial "article_summary", collection: blog.articles[0..4] %>

<%= link_to "Alle News", "/news.html" %>

-- cgit v1.2.1