From 70f78ac33ba6854f46892df934258021974f1ddc Mon Sep 17 00:00:00 2001 From: Joonas Nivala Date: Wed, 18 Jun 2025 15:13:59 +0300 Subject: [PATCH 1/7] testing deployment to dev.fiqci.fi --- .github/workflows/deployment.yaml | 2 +- src/utils/url.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index 3a931d378063..52a0f9c1e38b 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -36,7 +36,7 @@ jobs: - name: Build site using Jekyll env: JEKYLL_ENV: production - run: npm run-script jekyll:build -- --baseurl ${{ github.event.repository.name }} + run: npm run-script jekyll:build - name: Upload artifact id: deployment diff --git a/src/utils/url.js b/src/utils/url.js index b9c26ddc06ed..3e9fb2119798 100644 --- a/src/utils/url.js +++ b/src/utils/url.js @@ -21,5 +21,5 @@ export const isAnchor = href => { export const prependBaseURL = href => { if (isExternal(href) || isAnchor(href)) return href - return prependToPathname(href, SITE.deployment.baseURL) + return href } From e692938dfbe2292014f56500c12f295174ed7e07 Mon Sep 17 00:00:00 2001 From: Joonas Nivala Date: Wed, 18 Jun 2025 15:15:11 +0300 Subject: [PATCH 2/7] edit branch names --- .github/workflows/deployment.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index 52a0f9c1e38b..fa29703adfe4 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -1,9 +1,9 @@ name: Build and deploy site to GitHub Pages on: push: - branches: [ "rewrite/main" ] + branches: [ "new-deployment" ] pull_request: - branches: [ "rewrite/main" ] + branches: [ "new-deployment" ] workflow_dispatch: jobs: @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v4.2.2 with: - ref: rewrite/main + ref: new-deployment - name: Install Ruby and Node.js using asdf uses: asdf-vm/actions/install@v3.0.2 From 562e430a2e552e87d57f4da22da2f3f957cb0302 Mon Sep 17 00:00:00 2001 From: Joonas Nivala Date: Wed, 18 Jun 2025 15:21:49 +0300 Subject: [PATCH 3/7] revert --- src/utils/url.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/url.js b/src/utils/url.js index 3e9fb2119798..b9c26ddc06ed 100644 --- a/src/utils/url.js +++ b/src/utils/url.js @@ -21,5 +21,5 @@ export const isAnchor = href => { export const prependBaseURL = href => { if (isExternal(href) || isAnchor(href)) return href - return href + return prependToPathname(href, SITE.deployment.baseURL) } From 9742ff471edada3273fe1867c3ab4d11352eee28 Mon Sep 17 00:00:00 2001 From: Joonas Nivala Date: Wed, 18 Jun 2025 16:20:24 +0300 Subject: [PATCH 4/7] remove basepath --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eb6036cb4cd5..54b0f8b62ad6 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "jekyll:serve": "npm run-script jekyll -- serve --config ${npm_package_config_jekyll_configFilename},${npm_package_config_jekyll_webpackConfigFilename}", "jekyll:build": "npm run-script jekyll -- build --config ${npm_package_config_jekyll_configFilename},${npm_package_config_jekyll_webpackConfigFilename}", "clean": "npm run-script jekyll -- clean --config ${npm_package_config_jekyll_configFilename},${npm_package_config_jekyll_webpackConfigFilename} && rm ${npm_package_config_jekyll_webpackConfigFilename}", - "watch": "npx concurrently --kill-others --prefix-colors ${npm_package_config_conc_colors} --passthrough-arguments 'npm:tailwindcss -- {1}' 'npm:webpack -- --mode=development {1}' 'npm:jekyll:serve -- --livereload --baseurl /dev/' -- --watch", + "watch": "npx concurrently --kill-others --prefix-colors ${npm_package_config_conc_colors} --passthrough-arguments 'npm:tailwindcss -- {1}' 'npm:webpack -- --mode=development {1}' 'npm:jekyll:serve -- --livereload' -- --watch", "build": "npm run-script tailwindcss && npm run-script webpack -- --mode=production && npm run-script jekyll:build", "start": "npm run-script tailwindcss && npm run-script webpack -- --mode=development && npm run-script jekyll:serve" }, From 703c2dada2e5dbd57b93964a01b70eb40bb9ae5e Mon Sep 17 00:00:00 2001 From: Joonas Nivala Date: Wed, 18 Jun 2025 16:21:24 +0300 Subject: [PATCH 5/7] make work with basepath "/" --- src/utils/url.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/utils/url.js b/src/utils/url.js index b9c26ddc06ed..ee5a99c2165e 100644 --- a/src/utils/url.js +++ b/src/utils/url.js @@ -1,7 +1,18 @@ const prependToPathname = (href, value) => { const url = URL.parse(href, window.location.origin) - const basepath = URL.parse(value, window.location.origin).pathname - const path = basepath.concat(url.pathname) + let basepath = URL.parse(value, window.location.origin).pathname + let pathname = url.pathname + + // Remove trailing slash from basepath (unless it's just '/') + if (basepath.length > 1 && basepath.endsWith('/')) { + basepath = basepath.slice(0, -1) + } + // Remove leading slash from pathname + if (pathname.startsWith('/')) { + pathname = pathname.slice(1) + } + + const path = basepath === '/' ? `/${pathname}` : `${basepath}/${pathname}` return new URL(path, window.location.origin).pathname } @@ -19,7 +30,7 @@ export const isAnchor = href => { } export const prependBaseURL = href => { - if (isExternal(href) || isAnchor(href)) return href + if (isExternal(href) || isAnchor(href)) return href - return prependToPathname(href, SITE.deployment.baseURL) + return prependToPathname(href, SITE.deployment.baseURL) } From 699fa6ff6d85b7ba1c4942ff4ee1df233a8cf76b Mon Sep 17 00:00:00 2001 From: Joonas Nivala Date: Wed, 18 Jun 2025 16:28:08 +0300 Subject: [PATCH 6/7] fix links --- content/_data/constants.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/_data/constants.yml b/content/_data/constants.yml index ac8437bea84f..ae6426e6b6f5 100644 --- a/content/_data/constants.yml +++ b/content/_data/constants.yml @@ -50,10 +50,10 @@ header_nav: links: about: title: Read more about FiQCI - href: /dev/about + href: /about access: title: How to get access - href: /dev/access + href: /access access_cards: - title: Quantum computers From f320ceffcbd6b17473bd25b6b14d6e58163c260c Mon Sep 17 00:00:00 2001 From: Joonas Nivala Date: Wed, 18 Jun 2025 16:36:15 +0300 Subject: [PATCH 7/7] correct branch name --- .github/workflows/deployment.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index fa29703adfe4..52a0f9c1e38b 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -1,9 +1,9 @@ name: Build and deploy site to GitHub Pages on: push: - branches: [ "new-deployment" ] + branches: [ "rewrite/main" ] pull_request: - branches: [ "new-deployment" ] + branches: [ "rewrite/main" ] workflow_dispatch: jobs: @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v4.2.2 with: - ref: new-deployment + ref: rewrite/main - name: Install Ruby and Node.js using asdf uses: asdf-vm/actions/install@v3.0.2