From ffcc44d1a73ae1191e835fa625f2f8a7e3e25bda Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 11 Oct 2023 10:31:33 -0400 Subject: Blogs list is now main page (with pagination) --- app/views/blogs/index.atom.builder | 15 +++++++++++++++ app/views/blogs/index.html.haml | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 app/views/blogs/index.atom.builder create mode 100644 app/views/blogs/index.html.haml (limited to 'app/views/blogs') diff --git a/app/views/blogs/index.atom.builder b/app/views/blogs/index.atom.builder new file mode 100644 index 0000000..dd498c8 --- /dev/null +++ b/app/views/blogs/index.atom.builder @@ -0,0 +1,15 @@ +atom_feed do |feed| + feed.title("Four Island") + feed.updated(@blogs[0].published_at) if @blogs.length > 0 + + @blogs.each do |blog| + feed.entry(blog) do |entry| + entry.title(blog.title) + entry.content(blog.body, type: 'html') + + entry.author do |author| + author.name("hatkirby") + end + end + end +end diff --git a/app/views/blogs/index.html.haml b/app/views/blogs/index.html.haml new file mode 100644 index 0000000..a1ad64c --- /dev/null +++ b/app/views/blogs/index.html.haml @@ -0,0 +1,3 @@ +- @blogs.each do |blog| + = render blog += will_paginate @blogs -- cgit 1.4.1