Update README with Phoenix live-reload config change (#57)
Co-authored-by: Mitchell Hanberg <mitch@mitchellhanberg.com>
This commit is contained in:
parent
73c3c45f27
commit
7d1e436ac6
2 changed files with 17 additions and 1 deletions
|
@ -104,6 +104,14 @@ See the [documentation](https://hexdocs.pm/temple/Temple.Engine.html#content) fo
|
|||
# config.exs
|
||||
config :phoenix, :template_engines, exs: Temple.Engine
|
||||
|
||||
# config/dev.exs
|
||||
config :your_app, YourAppWeb.Endpoint,
|
||||
live_reload: [
|
||||
patterns: [
|
||||
~r"lib/your_app_web/templates/.*(exs)$"
|
||||
]
|
||||
]
|
||||
|
||||
# your_app_web.ex
|
||||
def view do
|
||||
quote do
|
||||
|
|
|
@ -10,6 +10,14 @@ defmodule Temple.Engine do
|
|||
# config.exs
|
||||
config :phoenix, :template_engines, exs: Temple.Engine
|
||||
|
||||
# config/dev.exs
|
||||
config :your_app, YourAppWeb.Endpoint,
|
||||
live_reload: [
|
||||
patterns: [
|
||||
~r"lib/your_app_web/templates/.*(exs)$"
|
||||
]
|
||||
]
|
||||
|
||||
# your_app_web.ex
|
||||
def view do
|
||||
quote location: :keep do
|
||||
|
@ -21,7 +29,7 @@ defmodule Temple.Engine do
|
|||
|
||||
## Usage
|
||||
|
||||
Temple templates use the `.exs` extension, because they are written with pure Elixir!
|
||||
Temple templates use the `.exs` extension, because they are written with pure Elixir!
|
||||
|
||||
`assigns` (@conn, etc) are handled the same as normal `Phoenix.HTML.Engine` templates.
|
||||
|
||||
|
|
Reference in a new issue