Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Folder linking exception with nested baseUrl #1760

Open
iomatix opened this issue Feb 10, 2025 · 2 comments
Open

[Bug] Folder linking exception with nested baseUrl #1760

iomatix opened this issue Feb 10, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@iomatix
Copy link

iomatix commented Feb 10, 2025

Describe the bug

When using Quartz with a correctly configured base URL (e.g., baseUrl: "iomatix.github.io/Elyean-Wiki-PL"), the internal links on auto-generated folder index pages are incorrect. Instead of including the full path (e.g., iomatix.github.io/Elyean-Wiki-PL/Something/Something2), the links are generated without the base segment (resulting in iomatix.github.io/Something/Something2). Refreshing the page (F5) temporarily fixes the links, but navigating from the folder index always leads to broken URLs.

To Reproduce

Steps to reproduce the behavior:

  1. Configure your Quartz site with a baseUrl set to "iomatix.github.io/Elyean-Wiki-PL".
  2. Create or navigate to a folder (for example, Something-Folder) that does not have a dedicated index file so that Quartz auto-generates one.
  3. On the auto-generated folder index page (e.g., https://iomatix.github.io/Elyean-Wiki-PL/Something-Folder), inspect the internal links.
  4. Notice that the links for nested pages omit the Elyean-Wiki-PL/ segment (e.g., they point to https://iomatix.github.io/Something/Something2 instead of https://iomatix.github.io/Elyean-Wiki-PL/Something/Something2).
  5. Refresh the folder index page and observe that while the page then displays correctly, navigating from it still produces broken links.

You can explore folders on https://iomatix.github.io/Elyean-Wiki-PL/Elyean/Zawarto%C5%9B%C4%87/Magia-i-Wiara/Wierzenia/Kult-Wielkiego-Tha/. There gonna be 404 sometimes, go back and F5 (refresh) seems to fix the issue, the link is generated correctly so it is https://iomatix.github.io/**Elyean-Wiki-PL/Elyean**/... instead of https://iomatix.github.io/**Elyean**/.

Expected behavior
All internal links should correctly include the full base path.
For example, on the folder index page, links should resolve to iomatix.github.io/Elyean-Wiki-PL/Something/Something2 without needing to refresh the page.

Screenshots and Source

Before the refresh the link from the explorer component is broken
Image

After the page refresh the link is resolved correctly
Image

You can help speed up fixing the problem by either

  1. providing a simple reproduction
  2. linking to your Quartz repository where the problem can be observed: https://github.com/iomatix/Elyean-Wiki-PL

Desktop (please complete the following information):

  • Quartz Version: 4.4.0
  • node Version: v20.9.0
  • npm version: 10.9.2
  • yarn version: 1.22.22
  • OS: Ubuntu 22.04.5 LTS
  • Browser: Tested: Edge, Safari, but I guess it's any

Additional context

Logs Fragments:

2025-02-10T01:08:24.3814967Z Current runner version: '2.322.0'
2025-02-10T01:08:24.3839799Z ##[group]Operating System
2025-02-10T01:08:24.3840669Z Ubuntu
2025-02-10T01:08:24.3841219Z 22.04.5
2025-02-10T01:08:24.3841744Z LTS
2025-02-10T01:08:24.3842322Z ##[endgroup]
2025-02-10T01:08:24.3842862Z ##[group]Runner Image
2025-02-10T01:08:24.3843404Z Image: ubuntu-22.04
2025-02-10T01:08:24.3844065Z Version: 20250202.1.0
2025-02-10T01:08:24.3845122Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20250202.1/images/ubuntu/Ubuntu2204-Readme.md
2025-02-10T01:08:24.3846800Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20250202.1
2025-02-10T01:08:24.3847862Z ##[endgroup]
2025-02-10T01:08:24.3848404Z ##[group]Runner Image Provisioner
2025-02-10T01:08:24.3848972Z 2.0.422.1
2025-02-10T01:08:24.3849582Z ##[endgroup]
2025-02-10T01:08:24.3850684Z ##[group]GITHUB_TOKEN Permissions
2025-02-10T01:08:24.3853150Z Contents: read
2025-02-10T01:08:24.3853744Z Metadata: read
2025-02-10T01:08:24.3854568Z Pages: write
2025-02-10T01:08:24.3855148Z ##[endgroup]
2025-02-10T01:08:24.3858330Z Secret source: Actions
2025-02-10T01:08:24.3859427Z Prepare workflow directory
2025-02-10T01:08:24.4162468Z Prepare all required actions
2025-02-10T01:08:24.4198593Z Getting action download info
2025-02-10T01:08:24.5692431Z Download action repository 'actions/checkout@v4' (SHA:11bd71901bbe5b1630ceea73d27597364c9af683)
2025-02-10T01:08:24.6530244Z Download action repository 'actions/setup-node@v4' (SHA:1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a)
2025-02-10T01:08:24.9270732Z Download action repository 'actions/upload-pages-artifact@v3' (SHA:56afc609e74202658d3ffba0e8f6dda462b719fa)
2025-02-10T01:08:25.1249208Z Getting action download info
2025-02-10T01:08:25.2081691Z Download action repository 'actions/upload-artifact@v4' (SHA:65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08)
2025-02-10T01:08:25.3495641Z Complete job name: build
2025-02-10T01:08:25.4334583Z ##[group]Run actions/checkout@v4
2025-02-10T01:08:25.4336096Z with:
2025-02-10T01:08:25.4336932Z   fetch-depth: 0
2025-02-10T01:08:25.4338094Z   repository: iomatix/Elyean-Wiki-PL
2025-02-10T01:08:25.4340107Z   token: ***
2025-02-10T01:08:25.4341351Z   ssh-strict: true
2025-02-10T01:08:25.4342559Z   ssh-user: git
2025-02-10T01:08:25.4343468Z   persist-credentials: true
2025-02-10T01:08:25.4344540Z   clean: true
2025-02-10T01:08:25.4345668Z   sparse-checkout-cone-mode: true
2025-02-10T01:08:25.4346809Z   fetch-tags: false
2025-02-10T01:08:25.4347764Z   show-progress: true
2025-02-10T01:08:25.4348779Z   lfs: false
2025-02-10T01:08:25.4349684Z   submodules: false
2025-02-10T01:08:25.4350660Z   set-safe-directory: true
2025-02-10T01:08:25.4352194Z ##[endgroup]
2025-02-10T01:08:25.6136669Z Syncing repository: iomatix/Elyean-Wiki-PL
2025-02-10T01:08:25.6140123Z ##[group]Getting Git version info
2025-02-10T01:08:25.6142005Z Working directory is '/home/runner/work/Elyean-Wiki-PL/Elyean-Wiki-PL'
2025-02-10T01:08:25.6145182Z [command]/usr/bin/git version
2025-02-10T01:08:25.6177192Z git version 2.48.1
2025-02-10T01:08:25.6203871Z ##[endgroup]
2025-02-10T01:08:25.6217816Z Temporarily overriding HOME='/home/runner/work/_temp/c22871da-3b9a-4194-96df-5edd1da36bba' before making global git config changes
2025-02-10T01:08:25.6220781Z Adding repository directory to the temporary git global config as a safe directory
2025-02-10T01:08:25.6229905Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/Elyean-Wiki-PL/Elyean-Wiki-PL
2025-02-10T01:08:25.6264371Z Deleting the contents of '/home/runner/work/Elyean-Wiki-PL/Elyean-Wiki-PL'
2025-02-10T01:08:25.6267523Z ##[group]Initializing the repository
2025-02-10T01:08:25.6271711Z [command]/usr/bin/git init /home/runner/work/Elyean-Wiki-PL/Elyean-Wiki-PL
2025-02-10T01:08:25.6354986Z hint: Using 'master' as the name for the initial branch. This default branch name
2025-02-10T01:08:25.6357178Z hint: is subject to change. To configure the initial branch name to use in all
2025-02-10T01:08:25.6359048Z hint: of your new repositories, which will suppress this warning, call:
2025-02-10T01:08:25.6361280Z hint:
2025-02-10T01:08:25.6362233Z hint: 	git config --global init.defaultBranch <name>
2025-02-10T01:08:25.6363422Z hint:
2025-02-10T01:08:25.6364545Z hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
2025-02-10T01:08:25.6366839Z hint: 'development'. The just-created branch can be renamed via this command:
2025-02-10T01:08:25.6368300Z hint:
2025-02-10T01:08:25.6369044Z hint: 	git branch -m <name>
2025-02-10T01:08:25.6370595Z Initialized empty Git repository in /home/runner/work/Elyean-Wiki-PL/Elyean-Wiki-PL/.git/
2025-02-10T01:08:25.6374082Z [command]/usr/bin/git remote add origin https://github.com/iomatix/Elyean-Wiki-PL
2025-02-10T01:08:25.6410482Z ##[endgroup]
2025-02-10T01:08:25.6411873Z ##[group]Disabling automatic garbage collection
2025-02-10T01:08:25.6413769Z [command]/usr/bin/git config --local gc.auto 0
2025-02-10T01:08:25.6444558Z ##[endgroup]
2025-02-10T01:08:25.6446290Z ##[group]Setting up auth
2025-02-10T01:08:25.6450846Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2025-02-10T01:08:25.6481725Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2025-02-10T01:08:25.6788417Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2025-02-10T01:08:25.6819191Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2025-02-10T01:08:25.7055570Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
2025-02-10T01:08:25.7102636Z ##[endgroup]
2025-02-10T01:08:25.7105017Z ##[group]Fetching the repository
2025-02-10T01:08:25.7113794Z [command]/usr/bin/git -c protocol.version=2 fetch --prune --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/*
2025-02-10T01:08:27.7540794Z From https://github.com/iomatix/Elyean-Wiki-PL
2025-02-10T01:08:27.7625320Z  * [new branch]      v4         -> origin/v4
2025-02-10T01:08:27.7627637Z [command]/usr/bin/git branch --list --remote origin/v4
2025-02-10T01:08:27.7628345Z   origin/v4
2025-02-10T01:08:27.7629449Z [command]/usr/bin/git rev-parse refs/remotes/origin/v4
2025-02-10T01:08:27.7641783Z 2ba8a4f1bd9baebcde8123c1de5fdf06a9fa4c1e
2025-02-10T01:08:27.7646842Z ##[endgroup]
2025-02-10T01:08:27.7647329Z ##[group]Determining the checkout info
2025-02-10T01:08:27.7648158Z ##[endgroup]
2025-02-10T01:08:27.7653267Z [command]/usr/bin/git sparse-checkout disable
2025-02-10T01:08:27.7691771Z [command]/usr/bin/git config --local --unset-all extensions.worktreeConfig
2025-02-10T01:08:27.7719989Z ##[group]Checking out the ref
2025-02-10T01:08:27.7723983Z [command]/usr/bin/git checkout --progress --force -B v4 refs/remotes/origin/v4
2025-02-10T01:08:28.0813573Z Switched to a new branch 'v4'
2025-02-10T01:08:28.0815650Z branch 'v4' set up to track 'origin/v4'.
2025-02-10T01:08:28.0835528Z ##[endgroup]
2025-02-10T01:08:28.0877872Z [command]/usr/bin/git log -1 --format=%H
2025-02-10T01:08:28.0903222Z 2ba8a4f1bd9baebcde8123c1de5fdf06a9fa4c1e
2025-02-10T01:08:28.1123976Z ##[group]Run actions/setup-node@v4
2025-02-10T01:08:28.1124280Z with:
2025-02-10T01:08:28.1124461Z   node-version: 22
2025-02-10T01:08:28.1124659Z   always-auth: false
2025-02-10T01:08:28.1124874Z   check-latest: false
2025-02-10T01:08:28.1125199Z   token: ***
2025-02-10T01:08:28.1125393Z ##[endgroup]
2025-02-10T01:08:28.2875254Z Found in cache @ /opt/hostedtoolcache/node/22.13.1/x64
2025-02-10T01:08:28.2882053Z ##[group]Environment details
2025-02-10T01:08:28.6130106Z node: v22.13.1
2025-02-10T01:08:28.6130486Z npm: 10.9.2
2025-02-10T01:08:28.6130859Z yarn: 1.22.22
2025-02-10T01:08:28.6131744Z ##[endgroup]
2025-02-10T01:08:28.6232158Z ##[group]Run npm ci
2025-02-10T01:08:28.6232587Z �[36;1mnpm ci�[0m
2025-02-10T01:08:28.6296330Z shell: /usr/bin/bash -e {0}
2025-02-10T01:08:28.6296594Z ##[endgroup]
2025-02-10T01:08:36.5065605Z 
2025-02-10T01:08:36.5073604Z added 557 packages, and audited 558 packages in 8s
2025-02-10T01:08:36.5074080Z 
2025-02-10T01:08:36.5074397Z 178 packages are looking for funding
2025-02-10T01:08:36.5074942Z   run `npm fund` for details
2025-02-10T01:08:36.5091491Z 
2025-02-10T01:08:36.5092174Z 2 vulnerabilities (1 moderate, 1 high)
2025-02-10T01:08:36.5092562Z 
2025-02-10T01:08:36.5092784Z To address all issues, run:
2025-02-10T01:08:36.5093217Z   npm audit fix
2025-02-10T01:08:36.5093439Z 
2025-02-10T01:08:36.5093659Z Run `npm audit` for details.
2025-02-10T01:08:36.5669659Z ##[group]Run npx quartz build
2025-02-10T01:08:36.5669965Z �[36;1mnpx quartz build�[0m
2025-02-10T01:08:36.5708657Z shell: /usr/bin/bash -e {0}
2025-02-10T01:08:36.5708908Z ##[endgroup]
2025-02-10T01:08:37.3442311Z 
2025-02-10T01:08:37.3442726Z  Quartz v4.4.0 
2025-02-10T01:08:37.3442958Z 
2025-02-10T01:08:38.1187027Z (node:1838) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
2025-02-10T01:08:41.2236488Z env:
2025-02-10T01:08:41.2236727Z   INPUT_PATH: public
2025-02-10T01:08:41.2236961Z ##[endgroup]
2025-02-10T01:08:41.2314779Z ##[group]Archive artifact
2025-02-10T01:08:41.2332793Z ./
2025-02-10T01:08:41.2333191Z ./index.xml
2025-02-10T01:08:41.2333587Z ./prescript.js
2025-02-10T01:08:41.2333984Z ./vault.html
2025-02-10T01:08:41.2334350Z ./Skarbiec.html
2025-02-10T01:08:41.2336393Z ./sitemap.xml
2025-02-10T01:08:41.2337035Z ./static/
2025-02-10T01:08:41.2337462Z ./static/icon.png
2025-02-10T01:08:41.2337985Z ./static/contentIndex.json
2025-02-10T01:08:41.2339252Z ./static/og-image.png
2025-02-10T01:08:41.2340383Z ./static/giscus/
2025-02-10T01:08:41.2340848Z ./static/giscus/light.css
2025-02-10T01:08:41.2341354Z ./static/giscus/dark.css
2025-02-10T01:08:41.2341802Z ./LICENSE.html
2025-02-10T01:08:41.2344371Z ./Elyean/
2025-02-10T01:08:41.2344780Z ./Elyean/Elyean.html
2025-02-10T01:08:41.2347312Z ./Elyean/Zawartość/
2025-02-10T01:08:41.2347996Z ./Elyean/Zawartość/Tryb-Strategiczny/
2025-02-10T01:08:41.2348925Z ./Elyean/Zawartość/Tryb-Strategiczny/Oddziały-i-Jednostki/
2025-02-10T01:08:41.2350162Z ./Elyean/Zawartość/Tryb-Strategiczny/Oddziały-i-Jednostki/Oddziały-i-Jednostki.html
2025-02-10T01:08:41.2351432Z ./Elyean/Zawartość/Tryb-Strategiczny/Oddziały-i-Jednostki/index.html
2025-02-10T01:08:41.2353381Z ./Elyean/Zawartość/Tryb-Strategiczny/Tryb-Strategiczny.html
2025-02-10T01:08:41.2356046Z ./Elyean/Zawartość/Tryb-Strategiczny/Budynki/
2025-02-10T01:08:41.2356939Z ./Elyean/Zawartość/Tryb-Strategiczny/Budynki/Budynki.html
2025-02-10T01:08:41.2358412Z ./Elyean/Zawartość/Tryb-Strategiczny/Budynki/index.html
2025-02-10T01:08:41.2360895Z ./Elyean/Zawartość/Tryb-Strategiczny/index.html
2025-02-10T01:08:41.2363272Z ./Elyean/Zawartość/Magia i Wiara/
2025-02-10T01:08:41.2364012Z ./Elyean/Zawartość/Magia i Wiara/Wierzenia/
2025-02-10T01:08:41.3033563Z ./tags/crystal.html
2025-02-10T01:08:41.3035472Z ./404.html
2025-02-10T01:08:41.3035783Z ./postscript.js
2025-02-10T01:08:41.3044037Z ./index.html
2025-02-10T01:08:41.3046081Z ./index.css
2025-02-10T01:08:41.3050314Z ##[endgroup]
2025-02-10T01:08:41.3117196Z ##[group]Run actions/upload-artifact@v4
2025-02-10T01:08:41.3117459Z with:
2025-02-10T01:08:41.3117642Z   name: github-pages
2025-02-10T01:08:41.3117886Z   path: /home/runner/work/_temp/artifact.tar
2025-02-10T01:08:41.3118149Z   retention-days: 1
2025-02-10T01:08:41.3118352Z   if-no-files-found: error
2025-02-10T01:08:41.3118572Z   compression-level: 6
2025-02-10T01:08:41.3118774Z   overwrite: false
2025-02-10T01:08:41.3119131Z   include-hidden-files: false
2025-02-10T01:08:41.3119358Z ##[endgroup]
2025-02-10T01:08:41.5233609Z With the provided path, there will be 1 file uploaded
2025-02-10T01:08:41.5239385Z Artifact name is valid!
2025-02-10T01:08:41.5240587Z Root directory input is valid!
2025-02-10T01:08:41.6282243Z Beginning upload of artifact content to blob storage
2025-02-10T01:08:42.2201932Z Uploaded bytes 2907927
2025-02-10T01:08:42.2385269Z Finished uploading artifact content to blob storage!
2025-02-10T01:08:42.2388747Z SHA256 hash of uploaded artifact zip is 2038b670a991a4e9b117d1b8705b04f1dd8a10ae1fc0673e98ce4624eecdd5a3
2025-02-10T01:08:42.2390387Z Finalizing artifact upload
2025-02-10T01:08:42.3047007Z Artifact github-pages.zip successfully finalized. Artifact ID 2561794110
2025-02-10T01:08:42.3049264Z Artifact github-pages has been successfully uploaded! Final size is 2907927 bytes. Artifact ID is 2561794110
2025-02-10T01:08:42.3057072Z Artifact download URL: https://github.com/iomatix/Elyean-Wiki-PL/actions/runs/13231509432/artifacts/2561794110
2025-02-10T01:08:42.3224313Z Post job cleanup.
2025-02-10T01:08:42.4879707Z Post job cleanup.
2025-02-10T01:08:42.5807953Z [command]/usr/bin/git version
2025-02-10T01:08:42.5847595Z git version 2.48.1
2025-02-10T01:08:42.5886080Z Copying '/home/runner/.gitconfig' to '/home/runner/work/_temp/d038be1d-4bf0-4280-a4eb-e81f93482a9d/.gitconfig'
2025-02-10T01:08:42.5895110Z Temporarily overriding HOME='/home/runner/work/_temp/d038be1d-4bf0-4280-a4eb-e81f93482a9d' before making global git config changes
2025-02-10T01:08:42.5896822Z Adding repository directory to the temporary git global config as a safe directory
2025-02-10T01:08:42.5908169Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/Elyean-Wiki-PL/Elyean-Wiki-PL
2025-02-10T01:08:42.5944245Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2025-02-10T01:08:42.5980003Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2025-02-10T01:08:42.6234572Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2025-02-10T01:08:42.6259349Z http.https://github.com/.extraheader
2025-02-10T01:08:42.6277099Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2025-02-10T01:08:42.6315181Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2025-02-10T01:08:42.6707213Z Cleaning up orphan processes
@iomatix iomatix added the bug Something isn't working label Feb 10, 2025
@MihailKovachev
Copy link

This happens even if your website is hosted at blahblah.github.io/WebsiteName/ and but you set baseURL to blahblah.github.io.

@MihailKovachev
Copy link

The steps to reproduce are given in #1767 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants