A sitemap.xml built from your app folder's pages.
Add one route to your router, outside the :browser pipeline:
get "/sitemap.xml", Xenia.Sitemap, []It lists every page xenia_routes generated, with your endpoint's URL in
front (MyAppWeb.Endpoint.url(), or base_url: in the options):
A page without parameters is listed, unless it defines
sitemap/0returning[].A page with parameters (
[slug],[...path]) is listed only with the parameters itssitemap/0returns, one entry each:def sitemap, do: for(post <- Blog.list_posts(), do: %{slug: post.slug})A catch-all takes a list:
%{path: ["guides", "install"]}.Pages under a layout with
sitemap: falseare left out, for example a signed-in area:use Xenia.Layout, on_mount: ..., sitemap: false.
Hand-written routes aren't listed. To build your own sitemap, start from
paths/1.
Summary
Functions
The paths of the app folder's pages that belong in the sitemap, in route order, with the router's scopes applied.
The sitemap as XML: one <url> per path from paths/1, after base_url.