Merge pull request 'wip of source query' (#262) from devel into main
Reviewed-on: #262
This commit is contained in:
commit
c26bf4cc46
2 changed files with 8 additions and 1 deletions
|
@ -38,7 +38,7 @@
|
|||
<aside class="block print:hidden">
|
||||
<%= raw(@settings.custom_html) %>
|
||||
</aside>
|
||||
|
||||
|
||||
<header class="my-8 block px-3 print:hidden">
|
||||
<.site_header user={@current_user} />
|
||||
</header>
|
||||
|
|
|
@ -83,6 +83,13 @@ defmodule ChiyaWeb.Indie.MicropubHandler do
|
|||
with :ok <- Micropub.verify_token(access_token),
|
||||
{:ok, slug} <- Chiya.Notes.Note.note_slug(url),
|
||||
note <- Chiya.Notes.get_public_note_by_slug_preloaded!(slug) do
|
||||
properties = %{
|
||||
"name" => [note.name],
|
||||
"content" => [note.content],
|
||||
"category" => Enum.map(note.tags, fn tag -> tag.name end),
|
||||
"published" => note.published_at
|
||||
}
|
||||
|
||||
filtered_note =
|
||||
Map.filter(note, fn {key, _val} ->
|
||||
Enum.member?(filter_properties, to_string(key))
|
||||
|
|
Loading…
Reference in a new issue