|
1 | | -# Echo Extra |
| 1 | +# echox |
2 | 2 |
|
3 | | -### Running Recipes |
| 3 | +Source for the [Echo](https://github.com/labstack/echo) documentation site — |
| 4 | +published at **[echo.labstack.com](https://echo.labstack.com)** — together with |
| 5 | +the runnable cookbook recipes the docs reference. |
4 | 6 |
|
5 | | -- Go into any cookbook folder and run `go run server.go` |
| 7 | +## Layout |
6 | 8 |
|
7 | | -### Running/Developing Website Locally |
| 9 | +| Path | What it is | |
| 10 | +| ----------- | --------------------------------------------------------------------------------------------------- | |
| 11 | +| `site/` | The docs site — [Astro](https://astro.build) + [Starlight](https://starlight.astro.build). Content lives in `site/src/content/docs/`. | |
| 12 | +| `cookbook/` | Standalone, runnable Go example apps referenced from the docs. | |
| 13 | +| `docs/` | Internal design specs. | |
8 | 14 |
|
9 | | -- Ensure that you have Node.js installed on your computer. If you don't have it, download and install it from the |
10 | | - official Node.js website (https://nodejs.org). Or you could use NVM (https://github.com/nvm-sh/nvm) to use appropriate |
11 | | - version of Node. |
12 | | -- Inside the `website` folder, install the required dependencies by running the following command `npm install`. |
13 | | -- Run the website locally by running the following command `npm start`. |
| 15 | +## Documentation site |
| 16 | + |
| 17 | +Requires [Node.js](https://nodejs.org) (LTS). |
14 | 18 |
|
15 | 19 | ```bash |
16 | | -cd website |
| 20 | +cd site |
17 | 21 | npm install |
18 | | -npm start |
| 22 | +npm run dev # dev server at http://localhost:4321 |
| 23 | +npm run build # production build to site/dist |
| 24 | +npm run preview # preview the production build |
19 | 25 | ``` |
20 | 26 |
|
21 | | -### Running/Developing Website in docker |
| 27 | +Content is Markdown/MDX under `site/src/content/docs/` (`guide/`, `middleware/`, |
| 28 | +`cookbook/`). To add a page, drop a file in the right folder — the sidebar is |
| 29 | +generated from each page's `sidebar.order` frontmatter. Every page needs a |
| 30 | +`title` and `description`. |
| 31 | + |
| 32 | +## Cookbook recipes |
22 | 33 |
|
23 | | -This will serve website on http://localhost:3000/ |
| 34 | +Each folder under `cookbook/` is a self-contained example. Run one with: |
24 | 35 |
|
25 | 36 | ```bash |
26 | | -docker run --rm -it --name echo-docs -v ${PWD}/website:/home/app -w /home/app -p 3000:3000 -u node node:lts /bin/bash -c "npm install && npm start -- --host=0.0.0.0" |
| 37 | +cd cookbook/hello-world |
| 38 | +go run . |
27 | 39 | ``` |
| 40 | + |
| 41 | +## Deployment |
| 42 | + |
| 43 | +The site auto-deploys to GitHub Pages on every push to `master` (and once daily, |
| 44 | +to refresh build-time data such as the GitHub star count) via |
| 45 | +[`.github/workflows/deploy.yaml`](.github/workflows/deploy.yaml). Dependencies |
| 46 | +are installed with `npm ci --ignore-scripts` and pinned via the committed |
| 47 | +lockfile. |
| 48 | + |
| 49 | +## License |
| 50 | + |
| 51 | +[MIT](LICENSE) |
0 commit comments