This commit is contained in:
2023-02-26 10:11:45 +11:00
parent 55f21ac016
commit 7a8968d5be
2 changed files with 17 additions and 1 deletions

View File

@@ -22,7 +22,19 @@ module Adamantium
end
def photos?
photos.count > 0
__getobj__.photos.count { |p| !p["value"].end_with?("mp4") } > 0
end
def photos
__getobj__.photos.select { |p| !p["value"].end_with?("mp4") }
end
def videos?
__getobj__.photos.count { |p| p["value"].end_with?("mp4") } > 0
end
def videos
__getobj__.photos.select { |p| p["value"].end_with?("mp4") }
end
def prefix_emoji

View File

@@ -5,6 +5,10 @@ article class="h-entry"
= post.display_title
article class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200 prose-a:text-blue-600 prose-a:no-underline hover:prose-a:underline prose-img:rounded"
- if post.videos?
- post.videos.each do |video|
video loop muted controls
source type="video/mp4" src=video["value"]
- if post.photos?
- post.photos.each do |photo|
figure