parent
d3746d8117
commit
189e2b6052
5 changed files with 22 additions and 53 deletions
|
|
@ -48,18 +48,15 @@ For Astro development:
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
For the Nginx preview:
|
For a production-style Astro preview:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run build
|
npm run build
|
||||||
```
|
npm run preview
|
||||||
|
|
||||||
```bash
|
|
||||||
docker compose up
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Then open:
|
Then open:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
http://localhost:8080/
|
http://localhost:4321/
|
||||||
```
|
```
|
||||||
|
|
|
||||||
20
README.md
20
README.md
|
|
@ -56,20 +56,32 @@ npm run render:layout
|
||||||
|
|
||||||
## Local Preview
|
## Local Preview
|
||||||
|
|
||||||
Build the Astro output first:
|
Run Astro locally while editing:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
Then open Astro's local URL, usually:
|
||||||
|
|
||||||
|
```text
|
||||||
|
http://localhost:4321/
|
||||||
|
```
|
||||||
|
|
||||||
|
For a production-style Astro preview, build the static output first:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
Then serve `dist/` with Docker:
|
Then serve `dist/` with Astro preview:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose up
|
npm run preview
|
||||||
```
|
```
|
||||||
|
|
||||||
Then open:
|
Then open:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
http://localhost:8080/
|
http://localhost:4321/
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
services:
|
|
||||||
website:
|
|
||||||
image: nginx:alpine
|
|
||||||
ports:
|
|
||||||
- "${PORT:-8080}:80"
|
|
||||||
volumes:
|
|
||||||
- .:/usr/share/nginx/html:ro
|
|
||||||
- ./docker/default.conf.template:/etc/nginx/templates/default.conf.template:ro
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
|
|
||||||
server_name _;
|
|
||||||
root /usr/share/nginx/html/dist;
|
|
||||||
index index.html;
|
|
||||||
|
|
||||||
location ~ /\. {
|
|
||||||
return 404;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
try_files $uri $uri/ =404;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /assets/ {
|
|
||||||
alias /usr/share/nginx/html/dist/assets/;
|
|
||||||
try_files $uri =404;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /css/ {
|
|
||||||
alias /usr/share/nginx/html/dist/css/;
|
|
||||||
try_files $uri =404;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /js/ {
|
|
||||||
alias /usr/share/nginx/html/dist/js/;
|
|
||||||
try_files $uri =404;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -37,7 +37,6 @@ is kept in `website/`, while Astro emits the served site into `dist/`.
|
||||||
- `scripts/copy-static-assets.mjs` - copies `assets/`, `css/`, and `js/` into `dist/`
|
- `scripts/copy-static-assets.mjs` - copies `assets/`, `css/`, and `js/` into `dist/`
|
||||||
- `scripts/extract-content.mjs` - extracts dated post pages into `content/`
|
- `scripts/extract-content.mjs` - extracts dated post pages into `content/`
|
||||||
- `scripts/extract-theme-css.mjs` - extracts repeated inline CSS into `css/theme.css` and `css/site.css`
|
- `scripts/extract-theme-css.mjs` - extracts repeated inline CSS into `css/theme.css` and `css/site.css`
|
||||||
- `docker/` and `compose.yaml` - local static server preview
|
|
||||||
- `.forgejo/` - deployment automation
|
- `.forgejo/` - deployment automation
|
||||||
|
|
||||||
## Shared Layout
|
## Shared Layout
|
||||||
|
|
@ -80,15 +79,15 @@ Then open Astro's local URL, usually:
|
||||||
http://localhost:4321
|
http://localhost:4321
|
||||||
```
|
```
|
||||||
|
|
||||||
For the Nginx preview, build first:
|
For a production-style Astro preview, build first:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run build
|
npm run build
|
||||||
docker compose up
|
npm run preview
|
||||||
```
|
```
|
||||||
|
|
||||||
Then open:
|
Then open:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
http://localhost:8080
|
http://localhost:4321
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue