mobilizon/lib/mix/tasks/mobilizon/site_map.ex
Thomas Citharel b5d9b82bdd
Refactor Mobilizon.Federation.ActivityPub and add typespecs
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2021-09-29 16:31:11 +02:00

23 lines
507 B
Elixir

defmodule Mix.Tasks.Mobilizon.SiteMap do
@moduledoc """
Task to generate a new Sitemap
"""
use Mix.Task
import Mix.Tasks.Mobilizon.Common
alias Mobilizon.Service.SiteMap
alias Mobilizon.Web.Endpoint
@preferred_cli_env "prod"
@shortdoc "Generates a new Sitemap"
@spec run(list(String.t())) :: :ok
def run(["generate"]) do
start_mobilizon()
with {:ok, :ok} <- SiteMap.generate_sitemap() do
shell_info("Sitemap saved to #{Endpoint.url()}/sitemap.xml")
end
end
end