From 5f860c66d300654934848aee1abe8e5c0d41836e Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 11 Oct 2023 16:25:37 -0400 Subject: Added blog archive The path to blog posts is now "blog" instead of "says", btw. --- app/views/blogs/index.atom.builder | 2 +- app/views/blogs/index.html.haml | 12 +++++++++--- app/views/blogs/summary.html.haml | 3 +++ 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 app/views/blogs/summary.html.haml (limited to 'app/views/blogs') diff --git a/app/views/blogs/index.atom.builder b/app/views/blogs/index.atom.builder index 72deba2..a05f29d 100644 --- a/app/views/blogs/index.atom.builder +++ b/app/views/blogs/index.atom.builder @@ -2,7 +2,7 @@ atom_feed do |feed| feed.title("Four Island") feed.updated(@blogs[0].published_at) if @blogs.length > 0 - @blogs.each do |blog| + @blogs.limit(10).each do |blog| feed.entry(blog, published: blog.published_at) do |entry| entry.title(blog.title) entry.content(markdown(blog.body), type: 'html') diff --git a/app/views/blogs/index.html.haml b/app/views/blogs/index.html.haml index e9639ca..75bf92f 100644 --- a/app/views/blogs/index.html.haml +++ b/app/views/blogs/index.html.haml @@ -1,3 +1,9 @@ -- @blogs.each do |blog| - = render blog, short: true -= will_paginate @blogs +#blog-archive + %h2 Blog Archive + .bubble.rounded + - @blogs.chunk {|blog| blog.published_at.strftime("%B %Y") }.each do |chunk| + %h3= chunk[0] + - chunk[1].each do |blog| + %p.archive-link + = link_to blog.title, blog + %small= blog.published_at.strftime("%-d %b %Y") diff --git a/app/views/blogs/summary.html.haml b/app/views/blogs/summary.html.haml new file mode 100644 index 0000000..e9639ca --- /dev/null +++ b/app/views/blogs/summary.html.haml @@ -0,0 +1,3 @@ +- @blogs.each do |blog| + = render blog, short: true += will_paginate @blogs -- cgit 1.4.1