add support for publishing

This commit is contained in:
Inhji 2023-06-01 23:22:16 +02:00
parent 37b71e3f71
commit 1bdba3b544

View file

@ -73,11 +73,17 @@ defmodule ChiyaWeb.Indie.MicropubHandler do
name = Props.get_title(p) || String.slice(content, 0..15)
tags = Props.get_tags(p) |> Enum.join(",")
published_at =
if Props.is_published?(p),
do: NaiveDateTime.local_now(),
else: nil
{:ok,
%{
content: content,
name: name,
tags_string: tags
tags_string: tags,
published_at: published_at
}}
|> dbg()
end