feat(post): add cover caption metadata
This commit is contained in:
@@ -62,6 +62,10 @@ module Volumen
|
||||
metadata["cover_alt"]
|
||||
end
|
||||
|
||||
def cover_caption
|
||||
metadata["cover_caption"]
|
||||
end
|
||||
|
||||
def fediverse_creator
|
||||
value = metadata["fediverse_creator"]
|
||||
return nil if value.nil?
|
||||
@@ -133,6 +137,7 @@ module Volumen
|
||||
"fediverse_creator" => fediverse_creator,
|
||||
"cover" => cover,
|
||||
"cover_alt" => cover_alt,
|
||||
"cover_caption" => cover_caption,
|
||||
"reading_time" => reading_time,
|
||||
"translations" => translations,
|
||||
"url" => "/api/volumen/posts/#{slug}"
|
||||
|
||||
@@ -395,6 +395,7 @@ module Volumen
|
||||
"excerpt" => presence(http_params["excerpt"]),
|
||||
"cover" => presence(http_params["cover"]),
|
||||
"cover_alt" => presence(http_params["cover_alt"]),
|
||||
"cover_caption" => presence(http_params["cover_caption"]),
|
||||
"draft" => http_params["draft"] == "on",
|
||||
"all_langs" => http_params["all_langs"] == "on"
|
||||
}
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
</div>
|
||||
<input type="text" id="cover-alt-input" name="cover_alt" value="<%= h(@post.cover_alt) %>"
|
||||
placeholder="ALT text (describe the image for accessibility)">
|
||||
<input type="text" id="cover-caption-input" name="cover_caption" value="<%= h(@post.cover_caption) %>"
|
||||
placeholder="Caption (e.g. 'Generated by AI', shown in popup)">
|
||||
<img id="cover-preview" class="cover-preview" alt="" hidden>
|
||||
<input type="file" id="cover-file" accept="image/*" hidden>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user