Skip to content

Commit 55874f6

Browse files
Fix logo paths in Logo.svelte and build.py
1 parent 6af199a commit 55874f6

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ jobs:
6767
working-directory: ./afterpython/_website
6868

6969
- name: Build website
70-
run: ap build
70+
run: |
71+
echo "Repository name: ${{ github.event.repository.name }}"
72+
echo "BASE_PATH: $BASE_PATH"
73+
ap build
7174
env:
7275
BASE_PATH: '/${{ github.event.repository.name }}'
7376

afterpython/_website/src/lib/components/Logo.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { resolve } from '$app/paths';
2+
import { asset, resolve } from '$app/paths';
33
44
type LogoProps = {
55
class?: string;
@@ -25,11 +25,11 @@
2525
2626
// Try formats in priority order: svg -> png -> jpg -> jpeg
2727
if (currentSrc.endsWith('/logo.svg')) {
28-
img.src = '/logo.png';
28+
img.src = asset(`/logo.png`);
2929
} else if (currentSrc.endsWith('/logo.png')) {
30-
img.src = '/logo.jpg';
30+
img.src = asset(`/logo.jpg`);
3131
} else if (currentSrc.endsWith('/logo.jpg')) {
32-
img.src = '/logo.jpeg';
32+
img.src = asset(`/logo.jpeg`);
3333
} else {
3434
// All formats failed, hide the logo
3535
hasLogo = false;
@@ -40,7 +40,7 @@
4040
{#if hasLogo}
4141
<a href={resolve('/')} class="flex items-center {className}">
4242
<img
43-
src={resolve(`/logo.svg`)}
43+
src={asset(`/logo.svg`)}
4444
alt="Logo"
4545
class="{sizeClasses[size]} w-auto"
4646
onerror={handleImageError}

afterpython/cli/commands/build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ def build(ctx, dev: bool, execute: bool):
161161
# NOTE: needs to set BASE_URL so that the project website can link to the content pages correctly at e.g. localhost:5173/doc
162162
# BASE_PATH is set by the GitHub Actions workflow
163163
base_path = os.getenv("BASE_PATH", "")
164+
click.echo(f"Using BASE_PATH: {base_path}")
164165
build_env = {**node_env, "BASE_URL": f"{base_path}/{content_type}"}
165166
result = subprocess.run(
166167
[

0 commit comments

Comments
 (0)