Update docs.

This commit is contained in:
Dillon Kearns 2021-05-18 11:23:49 -07:00
parent fff155bc21
commit 29aefaf9c3
2 changed files with 24 additions and 4 deletions

View File

@ -1,8 +1,27 @@
# What is elm-pages
`elm-pages` is a framework for building an Elm single-page app with pre-rendered HTML pages.
It has a built-in file-based router, and a `DataSource` API to help you bring in typed Elm data that's baked in to the page (no loading spinners).
Some of the core features include
- Pre-render routes to HTML
- Hydrate to a full Elm app, with client-side navigation after initial load
- A file-based router
- `DataSource`s allow you to pull data in to a given page and have it available before load
- File-based routing
- `DataSource`s allow you to pull HTTP or file data to a given page and have it available before load
- Dev server with hot reloading (including when you modify a file that is used as a `DataSource`)
- A nice type-safe API for SEO
- Generate files, like RSS, sitemaps, podcast feeds, or any other strings you can output with pure Elm
## When should I use elm-pages?
`elm-pages` is designed to help you build a site with great SEO. It's a really good fit for sites that are based on content, such as:
- eCommerce
- Blogs
- Marketing sites
- Restaurant or other brochure sites
- Portfolios
It might not be the right choice for mostly dynamic apps. If you want file-based routing for a mostly dynamic Elm single-page app, the [`elm-spa`](https://elm-spa.dev/) framework could be a good fit.

View File

@ -2,9 +2,10 @@
## CLI commands
- `elm-pages dev` - Run a dev server
- `elm-pages init my-project` - Create a fresh `elm-pages` site in a new folder called `my-project/`
- `elm-pages dev` - Start the `elm-pages` dev server
- `elm-pages add Slide.Number_` Generate scaffolding for a new Page Template
- `elm-pages build` - run a full production build
- `elm-pages build` - generate a full production build in the `dist/` folder. You'll often want to use a CDN service like [Netlify](http://netlify.com/) or [Vercel](https://vercel.com/) to deploy these generated static files
## The dev server