Skip to content

Commit

Permalink
docs: update Igniter methods to install beacon (#747)
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrocp authored Feb 10, 2025
1 parent f269283 commit f392bff
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 41 deletions.
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,7 @@ Replace `my_app` and `my_site` with the names you want to generate and follow th

If you already have a Phoenix project with Phoenix LiveView then you can just add Beacon into that project.

First add the [Igniter](https://hex.pm/packages/igniter) dependency into your project:

```elixir
defp deps do
[
{:igniter, "~> 0.5"}
]
end
```

Run `mix deps.get` and now you'll be able to execute either one of the installers below:
Similar to starting a new project, you can install Beacon and BeaconLiveAdmin and generate a new site:

- Using latest published [beacon](https://hex.pm/packages/beacon) and [beacon_live_admin](https://hex.pm/packages/beacon_live_admin) packages:

Expand All @@ -80,7 +70,7 @@ beacon@github:BeaconCMS/beacon,beacon_live_admin@github:BeaconCMS/beacon_live_ad
--beacon.site my_site
```

Replace `my_app` and `my_site` with the names you want to generate and follow the prompts.
Replace `my_site` with the names you want to generate and follow the prompts.
</details>

To finish, install dependencies, run the server, and open http://localhost:4000 to see the default home page or http://localhost:4000/admin to manage your new site.
Expand Down
39 changes: 11 additions & 28 deletions guides/introduction/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,55 +21,38 @@ Currently, only PostgreSQL is supported.

Check out the official [Elixir install guide](https://elixir-lang.org/install.html) for more info.

## Install as a new application
3. Either install as a new application or add into an existing application

If you're starting a new project, you can follow these steps to generate a new Phoenix application with Beacon and Beacon LiveAdmin installed.
Otherwise, skip to the next section to install Beacon in an existing application.

1. Update Hex
Firstly update Hex:

```sh
mix local.hex
```

2. Install or update Phoenix and Igniter Installers
Then install or update Phoenix and Igniter Installers

```sh
mix archive.install hex phx_new
mix archive.install hex igniter_new
```

Check out the official [Phoenix install guide](https://hexdocs.pm/phoenix/installation.html) for more info.
Now choose one of the methods below:

3. Generate the new application
### Install as a new application

If you're starting a new project, you can follow these steps to generate a new Phoenix application with Beacon and Beacon LiveAdmin installed.

Run the following to generate a new app:

```sh
mix igniter.new my_app --install beacon,beacon_live_admin --with phx.new
```

Replace `my_app` with the name of your application and follow the prompts.

## Install in an existing application

Follow these steps to install Beacon and Beacon LiveAdmin in an existing Phoenix application.

1. Add the [Igniter](https://hex.pm/packages/igniter) dependency in your project `mix.exs` file:

```elixir
defp deps do
[
{:igniter, "~> 0.5"}
]
end
```

2. Install dependencies

```sh
mix deps.get
```
### Install in an existing application

3. Install Beacon and Beacon LiveAdmin
Run the following to install Beacon and Beacon LiveAdmin in an existing Phoenix application.

```sh
mix igniter.install beacon,beacon_live_admin
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ defmodule Beacon.MixProject do
{:solid, "~> 0.14"},
{:tailwind, "~> 0.2"},
{:esbuild, "~> 0.5"},
{:igniter, "~> 0.5"},
{:igniter, "~> 0.5", optional: true},

# Dev, Test, Docs
{:credo, "~> 1.6", only: [:dev, :test], runtime: false},
Expand Down

0 comments on commit f392bff

Please sign in to comment.