add support for publishing #92
1 changed files with 7 additions and 1 deletions
|
@ -73,11 +73,17 @@ defmodule ChiyaWeb.Indie.MicropubHandler do
|
||||||
name = Props.get_title(p) || String.slice(content, 0..15)
|
name = Props.get_title(p) || String.slice(content, 0..15)
|
||||||
tags = Props.get_tags(p) |> Enum.join(",")
|
tags = Props.get_tags(p) |> Enum.join(",")
|
||||||
|
|
||||||
|
published_at =
|
||||||
|
if Props.is_published?(p),
|
||||||
|
do: NaiveDateTime.local_now(),
|
||||||
|
else: nil
|
||||||
|
|
||||||
{:ok,
|
{:ok,
|
||||||
%{
|
%{
|
||||||
content: content,
|
content: content,
|
||||||
name: name,
|
name: name,
|
||||||
tags_string: tags
|
tags_string: tags,
|
||||||
|
published_at: published_at
|
||||||
}}
|
}}
|
||||||
|> dbg()
|
|> dbg()
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue