Product Promotion
0x5a.live
for different kinds of informations and explorations.
GitHub - slime-lang/phoenix_slime: Phoenix Template Engine for Slime
Phoenix Template Engine for Slime. Contribute to slime-lang/phoenix_slime development by creating an account on GitHub.
Visit SiteGitHub - slime-lang/phoenix_slime: Phoenix Template Engine for Slime
Phoenix Template Engine for Slime. Contribute to slime-lang/phoenix_slime development by creating an account on GitHub.
Powered by 0x5a.live ๐
Phoenix Template Engine for Slim
Powered by Slime
Usage
- Add
{:phoenix_slime, "~> 0.13.1"}
to your deps inmix.exs
. - Add the following to your Phoenix
config/config.exs
:
config :phoenix, :template_engines,
slim: PhoenixSlime.Engine,
slime: PhoenixSlime.Engine,
slimleex: PhoenixSlime.LiveViewEngine # If you want to use LiveView
An example project can be found at slime-lang/phoenix_slime_example.
Live Reloader
In my_app/config/dev.exs
, include the slim
and slime
extensions in the list of watched files. (Replace APP
with your app name.)
# Watch static and templates for browser reloading.
config :my_app, MyApp.Endpoint,
live_reload: [
patterns: [
~r{priv/static/.*(js|css|png|jpeg|jpg|gif)$},
~r{web/views/.*(ex)$},
~r{lib/APP_web/templates/.*(eex|slim|slime)$}
]
]
Generators
This library also includes two mix
tasks:
mix phx.gen.html.slime
mix phx.gen.layout.slime
The first task creates a html resource in the same way phx.gen.html
does
with the exception that all files are .slime
files instead of .eex
files.
The second task creates a new lib/APP_web/templates/layout/app.html.slime
with the
exact same content as the app.html.eex
file. Do not forget to remove the old
app.html.eex
file.
Generated files have .slime
extension by default. If you prefer .slim
, you could add the following line to your config:
config :phoenix_slime, :use_slim_extension, true
License
MIT license. Please see LICENSE for details.
Elixir Resources
are all listed below.
Made with โค๏ธ
to provide different kinds of informations and resources.