mix tayori.install (Tayori v0.1.0)

Copy Markdown View Source

Installs Tayori in a Phoenix application.

$ mix igniter.install tayori

or, with Tayori already in the deps, mix tayori.install. Igniter shows each change as a diff before it writes, and running the task again changes nothing:

  • the router mounts the admin at /admin/news and the public page at /changelog (tayori_admin/2, tayori_page/2);
  • the migration of Tayori's tables (mix tayori.gen.migration);
  • assets/js/app.js imports the Tayori hook and adds it to the LiveSocket;
  • assets/css/app.css imports kotoba.css and tayori.css, and the Sumi theme as a comment;
  • the application starts Tayori after the repo and the PubSub, with oban: Oban when the app has Oban (Tayori.Jobs);
  • lib/my_app_web/tayori_resolver.ex, the resolver, which lets no one in the admin until you say who your admins are.

Then put {Tayori.Live, MyAppWeb.TayoriResolver} in the on_mount of your live_session, and the news button and panel in your layout: see the Quickstart.