From 75ce71a606640e8569e94c1c5465f0a58e5dd18a Mon Sep 17 00:00:00 2001 From: Friedjoff Trautwein Date: Fri, 3 Nov 2023 12:04:38 +0100 Subject: [PATCH] chore: improve documentation --- README.md | 14 ++++++++------ example/README.md | 10 +++++----- package.json | 1 + 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index f5e26c5..03948d5 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # next-nginx-routes -Generate Nginx routes configuration file for Next.js static HMTL export. +Generate Nginx routes configuration file for Next.js static HMTL export, also known as `output: export`. -This [NPM package](https://www.npmjs.com/package/next-nginx-routes) allows you to convert Next.js routes like: +This dependency-free [NPM package](https://www.npmjs.com/package/next-nginx-routes) provides a NPM script to convert all your Next.js routes like: ```json { @@ -21,6 +21,8 @@ location ~ ^/([^/]+?)(?:/)?$ { } ``` +Note: currently only Next.js pages router is fully supported. + ## Getting started ### Installation @@ -31,23 +33,23 @@ yarn add --dev next-nginx-routes ### Generate Nginx configuration file -Add next-nginx-routes to your export script: +Add next-nginx-routes to your build script: ```json { - "export": "next build && next export && next-nginx-routes" + "build": "next build && next-nginx-routes" } ``` And run Next.js export: ```shell -yarn run export +yarn run build ``` ### Include Nginx configuration file -Finally include the generated configuration file `next-routes.conf` and the Next.js output in your Nginx site configuration file. +Finally include the generated configuration file `next-routes.conf` in your Nginx site configuration file and make the Next.js `out` directory available to Nginx. ## Requirements diff --git a/example/README.md b/example/README.md index 63e489b..91e90fd 100644 --- a/example/README.md +++ b/example/README.md @@ -12,15 +12,15 @@ Install all dependencies: yarn install ``` -### Export +### Next.js build -Run Next.js static HTML export: +Run Next.js build and generate Nginx routes configuration file: ```shell -yarn run export +yarn run build ``` -### Build +### Docker build Build Docker image: @@ -28,7 +28,7 @@ Build Docker image: docker build -t next-nginx-routes-example . ``` -### Run +### Docker run Start Docker container and open [localhost:8080](http://localhost:8080) in your browser: diff --git a/package.json b/package.json index e264e57..57ac616 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "description": "Generate Nginx routing configuration for static Next.js projects.", "version": "1.1.1", "keywords": [ + "export", "Next.js", "Nginx", "configuration",