Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions .github/workflows/test-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
name: Test deployment
name: Test build

on:
pull_request:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
- master

jobs:
test-deploy:
name: Test deployment
test-build:
name: Test build (docs site)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: 24
cache: yarn
cache: npm
cache-dependency-path: site/package-lock.json

- name: Install dependencies
run: yarn install --frozen-lockfile
working-directory: website
- name: Test build website
run: yarn build
working-directory: website
run: npm ci --ignore-scripts
working-directory: site
- name: Test build
run: npm run build
working-directory: site
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ test:
go test -race ./...

serve:
docker run --rm -it --name echo-docs -v ${CURDIR}/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"
cd site && npm install && npm run dev

.PHONY: test serve
52 changes: 38 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,51 @@
# Echo Extra
# echox

### Running Recipes
Source for the [Echo](https://github.com/labstack/echo) documentation site —
published at **[echo.labstack.com](https://echo.labstack.com)** — together with
the runnable cookbook recipes the docs reference.

- Go into any cookbook folder and run `go run server.go`
## Layout

### Running/Developing Website Locally
| Path | What it is |
| ----------- | --------------------------------------------------------------------------------------------------- |
| `site/` | The docs site — [Astro](https://astro.build) + [Starlight](https://starlight.astro.build). Content lives in `site/src/content/docs/`. |
| `cookbook/` | Standalone, runnable Go example apps referenced from the docs. |
| `docs/` | Internal design specs. |

- Ensure that you have Node.js installed on your computer. If you don't have it, download and install it from the
official Node.js website (https://nodejs.org). Or you could use NVM (https://github.com/nvm-sh/nvm) to use appropriate
version of Node.
- Inside the `website` folder, install the required dependencies by running the following command `npm install`.
- Run the website locally by running the following command `npm start`.
## Documentation site

Requires [Node.js](https://nodejs.org) (LTS).

```bash
cd website
cd site
npm install
npm start
npm run dev # dev server at http://localhost:4321
npm run build # production build to site/dist
npm run preview # preview the production build
```

### Running/Developing Website in docker
Content is Markdown/MDX under `site/src/content/docs/` (`guide/`, `middleware/`,
`cookbook/`). To add a page, drop a file in the right folder — the sidebar is
generated from each page's `sidebar.order` frontmatter. Every page needs a
`title` and `description`.

## Cookbook recipes

This will serve website on http://localhost:3000/
Each folder under `cookbook/` is a self-contained example. Run one with:

```bash
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"
cd cookbook/hello-world
go run .
```

## Deployment

The site auto-deploys to GitHub Pages on every push to `master` (and once daily,
to refresh build-time data such as the GitHub star count) via
[`.github/workflows/deploy.yaml`](.github/workflows/deploy.yaml). Dependencies
are installed with `npm ci --ignore-scripts` and pinned via the committed
lockfile.

## License

[MIT](LICENSE)
20 changes: 0 additions & 20 deletions website/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion website/.nvmrc

This file was deleted.

3 changes: 0 additions & 3 deletions website/babel.config.js

This file was deleted.

7 changes: 0 additions & 7 deletions website/docs/cookbook/_category_.json

This file was deleted.

25 changes: 0 additions & 25 deletions website/docs/cookbook/auto-tls.md

This file was deleted.

17 changes: 0 additions & 17 deletions website/docs/cookbook/cors.md

This file was deleted.

82 changes: 0 additions & 82 deletions website/docs/cookbook/crud.md

This file was deleted.

12 changes: 0 additions & 12 deletions website/docs/cookbook/embed-resources.md

This file was deleted.

47 changes: 0 additions & 47 deletions website/docs/cookbook/file-download.md

This file was deleted.

34 changes: 0 additions & 34 deletions website/docs/cookbook/file-upload.md

This file was deleted.

17 changes: 0 additions & 17 deletions website/docs/cookbook/graceful-shutdown.md

This file was deleted.

Loading
Loading