Skip to content

Commit

Permalink
Trying Dynamic BaseURL again (#197)
Browse files Browse the repository at this point in the history
 Trying Dynamic BaseURL again #197
  • Loading branch information
neural-loop authored Mar 8, 2025
1 parent 515cbee commit d1d24d3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,23 @@ jobs:
- name: Install npm dependencies
run: npm install

- name: Determine Base URL
id: base_url
run: |
if [[ "${{ github.repository_owner }}.github.io" == "open-neuromorphic.github.io" ]]; then
BASE_URL="https://open-neuromorphic.org/"
else
REPO_NAME=$(echo "${{ github.repository }}" | cut -d '/' -f 2)
if [[ "${{ github.repository_owner }}" == "${{ github.repository_owner }}" ]]; then
BASE_URL="https://${{ github.repository_owner }}.github.io/${REPO_NAME}/"
else
BASE_URL="https://${{ github.repository_owner }}.github.io/"
fi
fi
echo "BASE_URL=$BASE_URL" >> $GITHUB_ENV
- name: Modify hugo.toml
run: sed -i "s|baseURL = .*|baseURL = \"$BASE_URL\"|" hugo.toml
- name: Build site
run: npm run build

Expand Down

0 comments on commit d1d24d3

Please sign in to comment.