View Source Upgrading to v0.3.0
Add Beacon.Plug
to your Router
In your application's router.ex
file, first find where your sites are defined:
scope "/", MyAppWeb do
pipe_through :browser
beacon_site "/", site: :my_site
end
In the above case we can see the site :my_site
is inside a scope piped through :browser
,
so let's add a new :beacon
pipeline with the Beacon.Plug
:
pipeline :beacon do
plug Beacon.Plug
end
And add that pipeline into the existing scope:
scope "/", MyAppWeb do
pipe_through [:browser, :beacon] # <- add the pipeline here
beacon_site "/", site: :my_site
end
Now the Beacon.Plug
will ensure consistent rendering, particularly important when Page Variants are used.