Skip to content

Commit 8e8e33b

Browse files
committed
Fix baseurl to include preview path for correct asset/link URLs
1 parent 8762bd0 commit 8e8e33b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/fork-preview.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ jobs:
5050
5151
- name: Build with Jekyll
5252
run: |
53-
# Build with baseurl for GitHub Pages
54-
bundle exec jekyll build --baseurl "/${{ github.event.repository.name }}"
53+
# Build with baseurl including preview path for correct asset/link URLs
54+
bundle exec jekyll build --baseurl "/${{ github.event.repository.name }}/preview/${{ steps.branch.outputs.safe }}"
5555
env:
5656
JEKYLL_ENV: production
5757

.github/workflows/pr-preview.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ jobs:
5151

5252
- name: Build with Jekyll
5353
run: |
54-
# Build with baseurl as the fork owner's username for GitHub Pages
55-
bundle exec jekyll build --baseurl "/${{ github.event.pull_request.head.repo.name }}"
54+
# Build with baseurl including pr path for correct asset/link URLs
55+
bundle exec jekyll build --baseurl "/${{ github.event.pull_request.head.repo.name }}/pr-${{ github.event.pull_request.number }}"
5656
env:
5757
JEKYLL_ENV: production
5858

0 commit comments

Comments
 (0)