Merge pull request #67 from erlandsona/master

Sorry if this is super boring but hoping it's helpful.
This commit is contained in:
Ryan Haskell-Glatz 2021-02-09 19:32:09 -06:00 committed by GitHub
commit 3e068adfce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -95,7 +95,7 @@ We'll cover this in more detail in the [routing section](./routing)
### using page templates
The `elm-spa add` command also accepts an optional `template` argument to for common
The `elm-spa add` command also accepts an optional `template` argument too for common
pages you might create.
```bash

View File

@ -73,7 +73,7 @@ This is less common than `req.params` and `req.query`, but can be useful for get
## Getting the current route
The `Request` type also has access to the `Route` value, so you can easily do comparisons agains the current route!
The `Request` type also has access to the `Route` value, so you can easily do comparisons against the current route!
```elm
-- "/"

View File

@ -15,14 +15,14 @@ URL | File
In this section, we'll cover the 3 kinds of routes you can find in an __elm-spa__ application.
## The homepage
The `src/Pages/Home_.elm` file is a reserved page that handles requests to `/`. The easiest way to make a new homepage is with the [`add` command](/guide/cli#adding-a-homepage) covered in the CLI section:
The `src/Pages/Home_.elm` is a reserved filename that handles requests to /. The easiest way to make a new homepage is with the [`add` command](/guide/cli#adding-a-homepage) covered in the CLI section:
```terminal
elm-spa add /
```
__Note:__ Without the trailing underscore, __elm-spa__ will treat `Home.elm` as a route to `/home`! This is called a "static route", and will be covered at the end of this sentence.
__Note:__ Without the trailing underscore, __elm-spa__ will treat `Home.elm` as a route to `/home`! This is called a "static route", and will be covered next.
## Static routes
@ -103,4 +103,4 @@ It will handle any request to `/users/___/posts/___`
If a user visits a URL that doesn't have a corresponding page, it will redirect to the `NotFound.elm` page. This is generated for you by default in the `.elm-spa/defaults/Pages` folder. When you are ready to customize it, move it into `src/Pages` and customize it like you would any other page!
In __elm-spa__, this technique is called "ejecting" a default file. Throughout the guide, we'll find more default files that we might want to control in our project.
In __elm-spa__, this technique is called "ejecting" a default file. Throughout the guide, we'll find more default files that we might want to control in our project.