Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chrismccord/phoenix_haml
Phoenix Template Engine for Haml
https://github.com/chrismccord/phoenix_haml
Last synced: 7 days ago
JSON representation
Phoenix Template Engine for Haml
- Host: GitHub
- URL: https://github.com/chrismccord/phoenix_haml
- Owner: chrismccord
- License: mit
- Created: 2014-08-03T01:17:27.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-12-18T04:19:10.000Z (almost 5 years ago)
- Last Synced: 2024-10-13T09:52:51.583Z (26 days ago)
- Language: Elixir
- Size: 46.9 KB
- Stars: 158
- Watchers: 10
- Forks: 42
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Phoenix Template Engine for Haml. (Framework Components)
- fucking-awesome-elixir - phoenix_haml - Phoenix Template Engine for Haml. (Framework Components)
- awesome-elixir - phoenix_haml - Phoenix Template Engine for Haml. (Framework Components)
README
# Phoenix Template Engine for Haml
> Powered by [Calliope](https://github.com/nurugger07/calliope)
## Usage
1. Add `{:phoenix_haml, "~> 0.2"}` to your deps in `mix.exs`.
If you generated your app from the Phoenix master branch,
add phoenix_haml's master branch to your deps instead.
`{:phoenix_haml, github: "chrismccord/phoenix_haml"}`
2. Add the following to your Phoenix `config/config.exs````elixir
config :phoenix, :template_engines,
haml: PhoenixHaml.Engine
```
3. Use the `.html.haml` extensions for your templates.## Optional
Add haml extension to Phoenix live reload in `config/dev.exs`
```elixir
config :hello_phoenix, HelloPhoenix.Endpoint,
live_reload: [
patterns: [
~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$},
~r{web/views/.*(ex)$},
~r{web/templates/.*(eex|haml)$}
]
]
```## Generators
### Generate Resource
Generates a Phoenix resource similar to ```mix phoenix.gen.html``` except it generates
haml templates.```
mix phoenix_haml.gen.html User users name:string age:integer
```### Generate Layout
Generates a haml layout template, replacing the eex version.
```
mix phoenix_haml.gen.layout
```