Show OG metadata for bookmarks

This commit is contained in:
2023-02-11 14:49:36 +11:00
parent f704340577
commit b05ead7328
10 changed files with 78 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
require "ogpr"
module Adamantium
module Views
module Bookmarks
class Metadata < View
include Deps["repos.post_repo"]
config.layout = nil
expose :description do |og_data|
og_data.description
end
expose :title do |og_data|
og_data.title
end
expose :image do |og_data|
og_data.image
end
private_expose :og_data do |id:|
url = post_repo.find!(id).url
Ogpr.fetch(url)
end
end
end
end
end