feat: add rewrites for older versions
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
set -x
|
||||||
|
|
||||||
readonly ROOT_DIR="$(cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")" && pwd)"
|
readonly ROOT_DIR="$(cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")" && pwd)"
|
||||||
|
|
||||||
@@ -19,6 +20,8 @@ main() {
|
|||||||
|
|
||||||
rm -rf tmp/docs-build/assets
|
rm -rf tmp/docs-build/assets
|
||||||
cp -r docs-main/assets tmp/docs-build/assets
|
cp -r docs-main/assets tmp/docs-build/assets
|
||||||
|
cp docs-main/_build/app-nginx.conf.sigil tmp/docs-build/app-nginx.conf.sigil
|
||||||
|
mkdir -p tmp/docs-build/nginx.conf.d
|
||||||
|
|
||||||
make docs-build
|
make docs-build
|
||||||
mv site tmp/docs-build/docs
|
mv site tmp/docs-build/docs
|
||||||
@@ -39,6 +42,7 @@ main() {
|
|||||||
|
|
||||||
if [[ "$major" -lt 1 ]]; then
|
if [[ "$major" -lt 1 ]]; then
|
||||||
if [[ "$current_version" != "$version" ]] && [[ "$minor" -lt 28 ]]; then
|
if [[ "$current_version" != "$version" ]] && [[ "$minor" -lt 28 ]]; then
|
||||||
|
echo "rewrite ^/docs~$version/(.*)$ /docs~$current_version\$1 last;" > "tmp/docs-build/nginx.conf.d/$version.conf"
|
||||||
rm -rf "tmp/docs-build/docs~v${version}"
|
rm -rf "tmp/docs-build/docs~v${version}"
|
||||||
patch=$((patch - 1))
|
patch=$((patch - 1))
|
||||||
continue
|
continue
|
||||||
|
|||||||
38
docs/_build/app-nginx.conf.sigil
vendored
Normal file
38
docs/_build/app-nginx.conf.sigil
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
worker_processes 1;
|
||||||
|
error_log stderr;
|
||||||
|
pid nginx.pid;
|
||||||
|
daemon off;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 768;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
types_hash_max_size 2048;
|
||||||
|
include mime.types;
|
||||||
|
charset UTF-8;
|
||||||
|
server {
|
||||||
|
listen {{ $.PORT }};
|
||||||
|
server_name _;
|
||||||
|
{{ if ne $.NGINX_ROOT "" }}
|
||||||
|
root /app/www/{{ $.NGINX_ROOT }};
|
||||||
|
{{ else }}
|
||||||
|
root /app/www;
|
||||||
|
{{ end }}
|
||||||
|
index index.html;
|
||||||
|
port_in_redirect off;
|
||||||
|
|
||||||
|
include /app/www/nginx.conf.d/*.conf;
|
||||||
|
location ^~ /nginx.conf.d/ {
|
||||||
|
return 404;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
{{ if ne $.NGINX_DEFAULT_REQUEST "" }}
|
||||||
|
try_files $uri $uri/ /{{ $.NGINX_DEFAULT_REQUEST }};
|
||||||
|
{{ else }}
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
{{ end }}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user