From 7de405da1f5b039b67eaacf6eb5a2488ec3e576a Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Thu, 5 Dec 2024 11:55:58 -0500 Subject: [PATCH] Update v0.3.0 guide --- guides/upgrading/v0.3.0.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/guides/upgrading/v0.3.0.md b/guides/upgrading/v0.3.0.md index 73553dc4..09229c27 100644 --- a/guides/upgrading/v0.3.0.md +++ b/guides/upgrading/v0.3.0.md @@ -2,22 +2,31 @@ ## Add `Beacon.Plug` to your Router -In your application's `router.ex`, first find the pipeline used for your beacon_site. It is usually `:browser` but you can check: +In your application's `router.ex` file, first find where your sites are defined: ```elixir -scope "/" do +scope "/", MyAppWeb do pipe_through :browser beacon_site "/", site: :my_site end ``` -In the above case we can see the pipeline is `:browser`. Still in the router, look for that pipeline and add `plug Beacon.Plug`: +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`: ```elixir -pipeline :browser do - ... +pipeline :beacon do plug Beacon.Plug end ``` -Now the `Beacon.Plug` will ensure consistent rendering, particularly important when Page Variants are used. \ No newline at end of file +And add that pipeline into the existing scope: + +```elixir +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.