add indieweb endpoint meta tags

This commit is contained in:
Inhji 2023-05-28 22:35:36 +02:00
parent 8b96fda262
commit 76185e3b57
3 changed files with 26 additions and 2 deletions

View file

@ -18,7 +18,8 @@ config :chiya, ChiyaWeb.Endpoint,
layout: false
],
pubsub_server: Chiya.PubSub,
live_view: [signing_salt: "OJncEkwy"]
live_view: [signing_salt: "OJncEkwy"],
user_agent: "Chiya/0.x +https://inhji.de"
# Configures the mailer
#
@ -63,6 +64,18 @@ config :waffle,
# Configure Timezones with :tz
config :elixir, :time_zone_database, Tz.TimeZoneDatabase
config :chiya, :indie,
token_endpoint: "https://tokens.indieauth.com/token",
auth_endpoint: "https://indieauth.com/auth",
supported_scopes: [
# Micropub scopes
"create",
"update",
"delete",
"undelete",
"media"
]
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{config_env()}.exs"

View file

@ -10,6 +10,10 @@
<.favicon />
<link rel="authorization_endpoint" href={@auth_endpoint} />
<link rel="token_endpoint" href={@token_endpoint} />
<link rel="micropub" href={~p"/indie/micropub"} />
<%= for identity <- @identities do %>
<link rel="me" href={identity.url} />
<% end %>

View file

@ -1,9 +1,16 @@
defmodule ChiyaWeb.GlobalAssigns do
import Plug.Conn
@token_endpoint Application.compile_env!(:chiya, [:indie, :token_endpoint])
@auth_endpoint Application.compile_env!(:chiya, [:indie, :auth_endpoint])
def fetch_settings(conn, _opts) do
settings = Chiya.Site.get_settings()
assign(conn, :settings, settings)
conn
|> assign(:token_endpoint, @token_endpoint)
|> assign(:auth_endpoint, @auth_endpoint)
|> assign(:settings, settings)
end
def fetch_identities(conn, _opts) do