wip of source query

This commit is contained in:
Inhji 2023-08-14 18:53:34 +02:00
parent f8ff2a14d8
commit e2f403bbed
2 changed files with 8 additions and 1 deletions

View file

@ -38,7 +38,7 @@
<aside class="block print:hidden"> <aside class="block print:hidden">
<%= raw(@settings.custom_html) %> <%= raw(@settings.custom_html) %>
</aside> </aside>
<header class="my-8 block px-3 print:hidden"> <header class="my-8 block px-3 print:hidden">
<.site_header user={@current_user} /> <.site_header user={@current_user} />
</header> </header>

View file

@ -83,6 +83,13 @@ defmodule ChiyaWeb.Indie.MicropubHandler do
with :ok <- Micropub.verify_token(access_token), with :ok <- Micropub.verify_token(access_token),
{:ok, slug} <- Chiya.Notes.Note.note_slug(url), {:ok, slug} <- Chiya.Notes.Note.note_slug(url),
note <- Chiya.Notes.get_public_note_by_slug_preloaded!(slug) do 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 = filtered_note =
Map.filter(note, fn {key, _val} -> Map.filter(note, fn {key, _val} ->
Enum.member?(filter_properties, to_string(key)) Enum.member?(filter_properties, to_string(key))