mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-23 08:22:50 +00:00
Add a mix task to generate a sitemap
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
c56fb710b6
commit
634c33c959
1 changed files with 21 additions and 0 deletions
21
lib/mix/tasks/mobilizon/site_map.ex
Normal file
21
lib/mix/tasks/mobilizon/site_map.ex
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
defmodule Mix.Tasks.Mobilizon.SiteMap do
|
||||||
|
@moduledoc """
|
||||||
|
Task to generate a new Sitemap
|
||||||
|
"""
|
||||||
|
use Mix.Task
|
||||||
|
|
||||||
|
alias Mix.Tasks.Mobilizon.Common
|
||||||
|
alias Mobilizon.Service.SiteMap
|
||||||
|
alias Mobilizon.Web.Endpoint
|
||||||
|
|
||||||
|
@preferred_cli_env "prod"
|
||||||
|
|
||||||
|
@shortdoc "Generates a new Sitemap"
|
||||||
|
def run(["generate"]) do
|
||||||
|
Common.start_mobilizon()
|
||||||
|
|
||||||
|
with {:ok, :ok} <- SiteMap.generate_sitemap() do
|
||||||
|
Mix.shell().info("Sitemap saved to #{Endpoint.url()}/sitemap.xml")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue