StandardRB

This commit is contained in:
2024-02-21 21:48:44 +11:00
parent 0a14ae1204
commit 6f663722ab
37 changed files with 43 additions and 41 deletions

View File

@@ -9,6 +9,5 @@ module Adamantium
slice :main, at: "/" slice :main, at: "/"
slice :admin, at: "/admin" slice :admin, at: "/admin"
slice :micropub, at: "/micropub" slice :micropub, at: "/micropub"
end end
end end

View File

@@ -9,7 +9,7 @@ module Adamantium
youtube.com youtube.com
bsky.app bsky.app
bsky.social bsky.social
github.com] github.com].freeze
def call(content) def call(content)
links = URI::DEFAULT_PARSER.extract(content) links = URI::DEFAULT_PARSER.extract(content)

View File

@@ -8,7 +8,7 @@ module Adamantium
return cached_content if cached_content return cached_content if cached_content
rendered_content = content_proc.() rendered_content = content_proc.call
data = JSON.generate(expire: expiry.to_i, content: rendered_content) data = JSON.generate(expire: expiry.to_i, content: rendered_content)

View File

@@ -3,6 +3,5 @@
module Main module Main
class Action < Adamantium::Action class Action < Adamantium::Action
end end
end end

View File

@@ -1,4 +1,3 @@
module Main module Main
class Routes < Hanami::Routes class Routes < Hanami::Routes
root to: "site.home" root to: "site.home"

View File

@@ -1,5 +1,5 @@
# xml.instruct! "xml-stylesheet", {href: "/assets/style.xslt", type: "text/xsl"} # xml.instruct! "xml-stylesheet", {href: "/assets/style.xslt", type: "text/xsl"}
xml.opml("xmlns:frss" => "https://freshrss.org/opml", version: "2.0") do xml.opml("xmlns:frss" => "https://freshrss.org/opml", :version => "2.0") do
xml.head do |head| xml.head do |head|
head.title "Daniel Nitsikopoulos's RSS subscriptions" head.title "Daniel Nitsikopoulos's RSS subscriptions"
head.link "https://dnitza.com/blogroll/opml" head.link "https://dnitza.com/blogroll/opml"

View File

@@ -1,8 +1,7 @@
module Main module Main
module Views module Views
module Blogroll module Blogroll
class Index< Main::View class Index < Main::View
end end
end end
end end

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Blogroll module Blogroll
class List< Main::View class List < Main::View
config.layout = false config.layout = false
include Deps[blogroll_list: "queries.blogroll.index"] include Deps[blogroll_list: "queries.blogroll.index"]
@@ -13,7 +13,7 @@ module Main
url: feed["url"], url: feed["url"],
html_url: feed["htmlUrl"], html_url: feed["htmlUrl"],
icon: feed["iconUrl"], icon: feed["iconUrl"],
categories: feed["categories"].map {|cat| cat["label"]} categories: feed["categories"].map { |cat| cat["label"] }
} }
end end
end end

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Blogroll module Blogroll
class Opml< Main::View class Opml < Main::View
include Deps[blogroll_list: "queries.blogroll.index"] include Deps[blogroll_list: "queries.blogroll.index"]
expose :blogroll do |blogroll_result| expose :blogroll do |blogroll_result|
@@ -11,7 +11,7 @@ module Main
url: feed["url"], url: feed["url"],
html_url: feed["htmlUrl"], html_url: feed["htmlUrl"],
icon: feed["iconUrl"], icon: feed["iconUrl"],
categories: feed["categories"].map {|cat| cat["label"]} categories: feed["categories"].map { |cat| cat["label"] }
} }
end end
end end

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Bookmarks module Bookmarks
class Index< Main::View class Index < Main::View
include Deps["repos.post_repo"] include Deps["repos.post_repo"]
expose :bookmarks do |query:| expose :bookmarks do |query:|
@@ -10,6 +10,12 @@ module Main
end end
end end
expose :bookmarks_by_tag do
post_repo.bookmark_listing(query: query).map do |bookmark|
Decorators::Bookmarks::Decorator.new bookmark
end
end
expose :q do |query:| expose :q do |query:|
query query
end end

View File

@@ -3,7 +3,7 @@ require "ogpr"
module Main module Main
module Views module Views
module Bookmarks module Bookmarks
class Metadata< Main::View class Metadata < Main::View
include Deps["repos.post_repo"] include Deps["repos.post_repo"]
config.layout = nil config.layout = nil

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Bookmarks module Bookmarks
class Show< Main::View class Show < Main::View
include Deps["repos.post_repo"] include Deps["repos.post_repo"]
expose :bookmark do |slug:| expose :bookmark do |slug:|

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Books module Books
class Index< Main::View class Index < Main::View
include Deps["repos.post_repo"] include Deps["repos.post_repo"]
private_expose :books do private_expose :books do

View File

@@ -1,6 +1,6 @@
module Main module Main
module Views module Views
class Error< Main::View class Error < Main::View
end end
end end
end end

View File

@@ -3,7 +3,7 @@ require "builder"
module Main module Main
module Views module Views
module Feeds module Feeds
class Rss< Main::View class Rss < Main::View
include Deps["repos.post_repo"] include Deps["repos.post_repo"]
expose :posts do expose :posts do

View File

@@ -3,7 +3,7 @@ require "builder"
module Main module Main
module Views module Views
module Feeds module Feeds
class StatusesRss< Main::View class StatusesRss < Main::View
include Deps["repos.post_repo"] include Deps["repos.post_repo"]
expose :posts do expose :posts do

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module More module More
class Index< Main::View class Index < Main::View
end end
end end
end end

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Movies module Movies
class Index< Main::View class Index < Main::View
include Deps["repos.movie_repo"] include Deps["repos.movie_repo"]
expose :movies do expose :movies do

View File

@@ -1,6 +1,6 @@
module Main module Main
module Views module Views
class NotFound< Main::View class NotFound < Main::View
end end
end end
end end

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Pages module Pages
class Show< Main::View class Show < Main::View
include Deps["repos.page_repo", renderer: "renderers.markdown"] include Deps["repos.page_repo", renderer: "renderers.markdown"]
expose :page_content do |page| expose :page_content do |page|

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Photos module Photos
class Index< Main::View class Index < Main::View
include Deps["repos.post_repo"] include Deps["repos.post_repo"]
expose :photos do expose :photos do

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Places module Places
class Index< Main::View class Index < Main::View
include Deps["repos.post_repo"] include Deps["repos.post_repo"]
expose :places do expose :places do

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Places module Places
class MapPage< Main::View class MapPage < Main::View
include Deps["repos.post_repo"] include Deps["repos.post_repo"]
config.layout = "map" config.layout = "map"

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Podcasts module Podcasts
class Index< Main::View class Index < Main::View
include Deps["repos.podcast_repo", "repos.podcast_scrobble_repo"] include Deps["repos.podcast_repo", "repos.podcast_scrobble_repo"]
expose :podcasts do expose :podcasts do

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Posts module Posts
class Archive< Main::View class Archive < Main::View
include Deps["repos.post_repo"] include Deps["repos.post_repo"]
expose :year do |year:| expose :year do |year:|

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Posts module Posts
class Index< Main::View class Index < Main::View
include Deps["repos.post_repo"] include Deps["repos.post_repo"]
expose :posts do |post_query| expose :posts do |post_query|

View File

@@ -3,7 +3,7 @@ require "time_math"
module Main module Main
module Views module Views
module Posts module Posts
class Show< Main::View class Show < Main::View
include Deps["repos.post_repo", "repos.movie_repo"] include Deps["repos.post_repo", "repos.movie_repo"]
expose :post do |slug:| expose :post do |slug:|

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Posts module Posts
class TopTracks< Main::View class TopTracks < Main::View
config.layout = false config.layout = false
expose :name do |track:| expose :name do |track:|

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module RecentlyPlayed module RecentlyPlayed
class Index< Main::View class Index < Main::View
config.layout = false config.layout = false
include Deps["queries.posts.recently_played"] include Deps["queries.posts.recently_played"]

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Site module Site
class Home< Main::View class Home < Main::View
include Deps["repos.post_repo", renderer: "renderers.markdown"] include Deps["repos.post_repo", renderer: "renderers.markdown"]
expose :home_content do expose :home_content do

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Statuses module Statuses
class Index< Main::View class Index < Main::View
include Deps["repos.post_repo"] include Deps["repos.post_repo"]
expose :posts do expose :posts do

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Tags module Tags
class Index< Main::View class Index < Main::View
include Deps["repos.tag_repo"] include Deps["repos.tag_repo"]
expose :tag_groups do expose :tag_groups do

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Tags module Tags
class Show< Main::View class Show < Main::View
include Deps[ include Deps[
"repos.post_tag_repo", "repos.post_tag_repo",
"repos.tag_repo" "repos.tag_repo"

View File

@@ -3,7 +3,7 @@ require "time_math"
module Main module Main
module Views module Views
module Timemachine module Timemachine
class Show< Main::View class Show < Main::View
include Deps[ include Deps[
"repos.post_repo", "repos.post_repo",
"repos.movie_repo", "repos.movie_repo",

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Trips module Trips
class Index< Main::View class Index < Main::View
include Deps["repos.trip_repo"] include Deps["repos.trip_repo"]
expose :trip_years do expose :trip_years do

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Trips module Trips
class Show< Main::View class Show < Main::View
include Deps[ include Deps[
"repos.trip_repo" "repos.trip_repo"
] ]

View File

@@ -1,7 +1,7 @@
module Main module Main
module Views module Views
module Workouts module Workouts
class Index< Main::View class Index < Main::View
include Deps["repos.workout_repo"] include Deps["repos.workout_repo"]
expose :workouts_by_year do expose :workouts_by_year do