Refactor app in to its own slice
This commit is contained in:
11
slices/main/templates/blogroll/index.html.slim
Normal file
11
slices/main/templates/blogroll/index.html.slim
Normal file
@@ -0,0 +1,11 @@
|
||||
- context.content_for(:title, "Blogroll | ")
|
||||
div class="mb-4 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200"
|
||||
h1 Blogroll
|
||||
|
||||
div class="h-feed mb-12 max-w-prose mx-auto prose dark:prose-invert"
|
||||
p Here's the list of all the sites & blogs I enjoy reading, taken directly from my RSS aggregator!
|
||||
p
|
||||
a href="/blogroll/opml" Get the OPML
|
||||
div class="grow" hx-get="/blogroll/list" hx-trigger="load"
|
||||
|
||||
|
13
slices/main/templates/blogroll/list.html.slim
Normal file
13
slices/main/templates/blogroll/list.html.slim
Normal file
@@ -0,0 +1,13 @@
|
||||
- blogroll.each do |blog|
|
||||
div class="flex mb-4"
|
||||
img loading="lazy" class="w-8 h-8 rounded mx-0 my-0 mr-4" src=blog[:icon]
|
||||
div
|
||||
div
|
||||
= "#{blog[:title]} — ("
|
||||
a href=blog[:url] RSS
|
||||
= " | "
|
||||
a href=blog[:html_url] Website
|
||||
= ")"
|
||||
div
|
||||
small Categories:
|
||||
small = " #{blog[:categories].join(",")}"
|
16
slices/main/templates/blogroll/opml.xml.builder
Normal file
16
slices/main/templates/blogroll/opml.xml.builder
Normal file
@@ -0,0 +1,16 @@
|
||||
# xml.instruct! "xml-stylesheet", {href: "/assets/style.xslt", type: "text/xsl"}
|
||||
xml.opml("xmlns:frss" => "https://freshrss.org/opml", version: "2.0") do
|
||||
xml.head do |head|
|
||||
head.title "Daniel Nitsikopoulos's RSS subscriptions"
|
||||
head.link "https://dnitza.com/blogroll/opml"
|
||||
head.lastBuildDate Time.now.rfc2822
|
||||
head.pubDate Time.now.rfc2822
|
||||
head.ttl 1800
|
||||
end
|
||||
|
||||
xml.body do
|
||||
blogroll.each do |blog|
|
||||
xml.outline(text: blog[:title], type: "rss", xmlUrl: blog[:url], htmlUrl: blog[:html_url])
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user