From 6081093f2dd8dd31733ff64aab62b487b4e0542e Mon Sep 17 00:00:00 2001 From: Benoit Donneaux Date: Fri, 24 May 2024 12:27:23 +0200 Subject: [PATCH] Overwrite baseurl for preview Signed-off-by: Benoit Donneaux --- .gitea/workflows/jekyll.yaml | 4 ++++ src/index.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/jekyll.yaml b/.gitea/workflows/jekyll.yaml index 65ca373..86a8b14 100644 --- a/.gitea/workflows/jekyll.yaml +++ b/.gitea/workflows/jekyll.yaml @@ -44,6 +44,10 @@ jobs: - name: Build Jekyll site id: build_site run: | + # Overwrite the baseurl for previewonly + if [ "${{ gitea.event }}" = 'pull_request' ]; then + sed -i -r -e 's/^baseurl:\s*"([^"]*)"/baseurl: "\1\/${{ gitea.event.pull_request.number }}"/' _config.yml + fi docker-compose run --rm -v "${JOB_CONTAINER_NAME}:/site" -w /site \ jekyll build --verbose continue-on-error: true diff --git a/src/index.html b/src/index.html index 9ce4766..41d676b 100644 --- a/src/index.html +++ b/src/index.html @@ -5,7 +5,7 @@ author_profile: false header: overlay_color: "#000" overlay_filter: "0.4" - overlay_image: /assets/images/overlay.jpg + overlay_image: {{ /assets/images/overlay.jpg | relative_url }} actions: - label: "Download" url: "https://tahoe-lafs.org/downloads"