Generates a page.ex in the app folder, which makes its folder a route.
$ mix xenia.gen.page reports/sales
* creating lib/my_app_web/app/reports/sales/page.ex
The folder follows the app-folder conventions: (group) folders stay out
of the URL, [id] is a parameter and [...path] a catch-all. Quote such
paths in your shell:
$ mix xenia.gen.page "(auth)/runbooks/[id]"
What you get:
- a LiveView with
use Xenia.Page, drawn inside the layouts above it. Parameters are assigned inmount/3. - under a
live.ex, a module with onlyrender/1: thelive.exowns the state and the events of the pages below it.
The module name mirrors the folders, MyAppWeb.App.Reports.SalesPage.
The page is routed the next time the router compiles. A path that would
conflict with an existing page is refused.
Options
--module- the module name--root- the app folder,lib/my_app_web/appby default--web-moduleand--web-path-MyAppWebandlib/my_app_webby default--force- overwrite an existing file