diff --git a/.github/workflows/build-and-preview-docs.yml b/.github/workflows/build-and-preview-docs.yml index 3ea042c285d..1b80fad60f8 100644 --- a/.github/workflows/build-and-preview-docs.yml +++ b/.github/workflows/build-and-preview-docs.yml @@ -72,6 +72,7 @@ jobs: if: github.event.action != 'closed' env: HUGO_PREVIEW: 'true' + HUGO_PREVIEW_BASE_URL: https://docs.layer5.io/pr-preview/pr-${{ github.event.pull_request.number }}/ run: | npm run build:preview cat > public/robots.txt <<'EOF' @@ -145,7 +146,7 @@ jobs: with: header: pr-preview message: | - 🚀 Preview deployment: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pr-preview/pr-${{ github.event.pull_request.number }}/ + 🚀 Preview deployment: https://docs.layer5.io/pr-preview/pr-${{ github.event.pull_request.number }}/ > *Note: Preview may take a moment (GitHub Pages deployment in progress). Please wait and refresh. Track deployment [here](https://github.com/${{ github.repository }}/actions/workflows/pages/pages-build-deployment)* - name: Comment on pruned previews diff --git a/.github/workflows/hugo.yaml b/.github/workflows/hugo.yaml index 6e207e8ff7a..666df5e7c81 100644 --- a/.github/workflows/hugo.yaml +++ b/.github/workflows/hugo.yaml @@ -57,7 +57,7 @@ jobs: hugo \ --gc \ --minify \ - --baseURL "/" + --baseURL "https://docs.layer5.io/" cp CNAME public/CNAME touch public/.nojekyll - name: Deploy to GitHub Pages diff --git a/content/en/_index.md b/content/en/_index.md index cf1084b862e..13b744b3a6e 100644 --- a/content/en/_index.md +++ b/content/en/_index.md @@ -223,4 +223,4 @@ function restoreImage(imgId, originalSrc) { animate(); } - \ No newline at end of file + diff --git a/layouts/404.html b/layouts/404.html index 410580771b7..346c6e65c86 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,6 +1,19 @@ + {{- $baseHref := .Site.BaseURL -}} + {{- with getenv "HUGO_PREVIEW_BASE_URL" -}} + {{- $baseHref = . -}} + {{- end }} + + {{ partial "head.html" . }} @@ -34,4 +47,3 @@

Not found

{{ partial "scripts.html" . }} - diff --git a/layouts/partials/favicon.html b/layouts/partials/favicon.html index 5252ddc753e..2ed3555f6d3 100644 --- a/layouts/partials/favicon.html +++ b/layouts/partials/favicon.html @@ -6,4 +6,4 @@ - \ No newline at end of file +