Browse Source

fix(micropub): Update article posting, debug statement.

jackyalcine 9 months ago
parent
commit
66a546a420
Signed by: Jacky Alciné <yo@jacky.wtf> GPG Key ID: 537A4F904B15268D

+ 7
- 7
lib/indieweb/micropub/content.ex View File

@@ -98,13 +98,6 @@ defmodule IndieWeb.Micropub.Content do
98 98
     {:ok, Enum.join(name, " ")}
99 99
   end
100 100
 
101
-  def process_property("content", content) when is_list(content) do
102
-    Logger.info("Merging content from list into a string...")
103
-    process_property("content", Enum.join(content, "\n"))
104
-  end
105
-
106
-  def process_property("content", [content]) when is_map(content), do: process_property("content", content)
107
-
108 101
   def process_property("content", content) when is_binary(content) do
109 102
     html = Earmark.as_html!(content, %Earmark.Options{gfm: true, breaks: true, smartypants: true})
110 103
     plain = HtmlSanitizeEx.strip_tags(html)
@@ -130,6 +123,13 @@ defmodule IndieWeb.Micropub.Content do
130 123
      }}
131 124
   end
132 125
 
126
+  def process_property("content", [content]) when is_map(content), do: process_property("content", content)
127
+
128
+  def process_property("content", content) when is_list(content) do
129
+    Logger.info("Merging content from list into a string...")
130
+    process_property("content", Enum.join(content, "\n"))
131
+  end
132
+
133 133
   def process_property(_name, value), do: {:ok, value}
134 134
 
135 135
   @doc """

+ 2
- 0
lib/indieweb/webmention.ex View File

@@ -64,9 +64,11 @@ defmodule IndieWeb.Webmention do
64 64
                 URI.parse(scheme <> "://" <> host <> url) |> URI.to_string()
65 65
 
66 66
               %{host: nil, scheme: nil} == URI.parse(url) and !String.starts_with?(url, "/") ->
67
+                Logger.debug("Normalizing #{url} off of #{site}...")
67 68
                 site <> "/" <> url
68 69
 
69 70
               true ->
71
+                Logger.debug("Got a whole URI for webmention endpoint discovery at #{url}")
70 72
                 url
71 73
             end
72 74
 

+ 0
- 2
web/controllers/timeline_controller.ex View File

@@ -28,8 +28,6 @@ defmodule Koype.Web.TimelineController do
28 28
         type: Map.get(params, "type", :all)
29 29
       )
30 30
 
31
-    Apex.ap(results)
32
-
33 31
     posts =
34 32
       results.entries
35 33
       |> Koype.Template.format()

Loading…
Cancel
Save