Skip to content

Commit

Permalink
Merge pull request #40 from jim-taylor-business/home_improvements
Browse files Browse the repository at this point in the history
Homepage, progressive enhancement, error handling and more
  • Loading branch information
jim-taylor-business committed Feb 25, 2024
2 parents ad873c4 + 0f12751 commit 61a0786
Show file tree
Hide file tree
Showing 38 changed files with 4,267 additions and 1,276 deletions.
42 changes: 30 additions & 12 deletions CONTRIBUTING.md
@@ -1,29 +1,47 @@
## Contributing

### Local development
### Tools and environment

If you don't have `cargo-leptos` installed you can install it with:
Install `cargo-leptos` with:

`cargo install --locked cargo-leptos`
`cargo install cargo-leptos`

Install `taplo` with:

`cargo install taplo-cli`

Install `machete` with:

`cargo install cargo-machete`

Then run:

`pnpm i`

to install daisyUI.
to install Tailwind and daisyUI.

Then do:
You can run your own local instance of Lemmy or run the UI with a test instance provided by the Lemmy community.

`cargo leptos watch`
Ensure that the version of the Lemmy API you are using in the UI is compatible with the instance you are using.

and goto http://localhost:1237
This project does yet not handle multiple versions of the Lemmy API gracefully. Changing the API version will cause compilation errors in this project and errors when communicating with your Lemmy instance.

Any changes you make while coding will require a page refresh.
Create the environment variables to point to your instance and specify Tailwind version (defaults shown here):

### Formatting
```
export LEPTOS_TAILWIND_VERSION=v3.4.1
export LEMMY_UI_LEPTOS_LEMMY_HOST=localhost:8536
export LEMMY_UI_LEPTOS_LEMMY_HTTPS=false
```

Run `./format.sh`
Compile and run with:

### Tooling / IDE setup
`cargo leptos watch`

and browse to `http://localhost:1237` to see the UI.

Any changes you make while coding might require a page refresh as the automatic reload may become detached.

### Formatting

See the [leptos tailwind example](https://github.com/leptos-rs/leptos/tree/main/examples/tailwind) for tooling, and additional IDE help.
Code submissions need to follow strict formatting guidelines. Run `./format.sh` or use the commands within to automate this process.

0 comments on commit 61a0786

Please sign in to comment.