Generates a layout.ex in the app folder: a frame around every page in
its folder and below.
$ mix xenia.gen.layout "(auth)" --persistent --on-mount MyAppWeb.Auth:require_user
* creating lib/my_app_web/app/(auth)/layout.ex
* creating lib/my_app_web/app/(auth)/persistent.ex
Pass . for the root layout, which frames every page. It wraps them in
your app's <Layouts.app>, the place for it once pages come from the
folder.
Options
--persistent- also generate the layout'spersistent.ex: a LiveView (use Xenia.Persistent) that stays alive while the user moves between the layout's pages. The frame places it with{@persistent}. With an existinglayout.ex, onlypersistent.exis created; add{@persistent}to that frame yourself.--on-mount- anon_mounthook for every page under the layout, such as an authentication check:MyAppWeb.AuthorMyAppWeb.Auth:require_user. Refused below alive.ex, where switching pages mounts nothing.--moduleand--persistent-module- the module names. By default they mirror the folders:MyAppWeb.App.AuthLayoutandMyAppWeb.App.AuthPersistentLive.--root- the app folder,lib/my_app_web/appby default--web-moduleand--web-path-MyAppWebandlib/my_app_webby default--force- overwrite existing files