Add blogroll

This commit is contained in:
2024-02-11 14:40:46 +11:00
parent d83dac92a5
commit 0bafc3722a
13 changed files with 188 additions and 3 deletions

View File

@@ -0,0 +1,15 @@
require "time_math"
module Adamantium
module Actions
module Blogroll
class Index < Action
include Deps["views.blogroll.index"]
def handle(req, res)
res.render index
end
end
end
end
end

View File

@@ -0,0 +1,15 @@
require "time_math"
module Adamantium
module Actions
module Blogroll
class List < Action
include Deps["views.blogroll.list"]
def handle(req, res)
res.body = cache(key: "blogroll", content_proc: -> { list.call.to_str }, expiry: TimeMath.min.advance(Time.now, +60))
end
end
end
end
end

View File

@@ -0,0 +1,16 @@
require "time_math"
module Adamantium
module Actions
module Blogroll
class Opml < Action
include Deps["views.blogroll.opml"]
def handle(req, res)
res.content_type = "text/xml; charset=utf-8"
res.render opml, format: :xml
end
end
end
end
end