From 086fa12105364d344b1041c0c419b881ee9221df Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Dec 2025 18:22:32 +0000 Subject: [PATCH 1/7] Initial plan From f619d6dd05d1c05b47bcd4c5069a325e445d22b4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Dec 2025 18:27:26 +0000 Subject: [PATCH 2/7] Fix CSS loading in Codespaces by binding Hugo to 0.0.0.0 and configuring liveReloadPort Co-authored-by: rrrutledge <9609562+rrrutledge@users.noreply.github.com> --- .devcontainer/devcontainer.json | 6 ++++++ .vscode/launch.json | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 757a5009a6..446639d0a8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -25,6 +25,12 @@ } }, "forwardPorts": [1313], + "portsAttributes": { + "1313": { + "label": "Hugo Server", + "onAutoForward": "openBrowser" + } + }, "remoteUser": "vscode", "postCreateCommand": "npm install; cd /tmp && wget -O hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.133.1/hugo_extended_0.133.1_linux-amd64.deb && sudo dpkg -i hugo.deb && rm hugo.deb && npm init -y && npm install hugo-bin@latest && hugo version && echo 'Hugo server ready to run! Use the Run and Debug view to start the server.'" } diff --git a/.vscode/launch.json b/.vscode/launch.json index 2cf6a98ccf..57fbc212d4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,15 +8,16 @@ "program": "${workspaceFolder}/node_modules/.bin/hugo", "args": [ "server", + "--bind=0.0.0.0", "--appendPort=false", "--baseURL=/", + "--liveReloadPort=443", "-D" ], "console": "integratedTerminal", "preLaunchTask": "Hugo: Check Environment", "serverReadyAction": { - "pattern": "Web Server is available at //localhost:(\\d+)/", - "uriFormat": "http://localhost:%s/", + "pattern": "Web Server is available at", "action": "openExternally" } } From a66f0e9dd74f05b21f2ec939466950e34d6f9ba7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Dec 2025 18:28:50 +0000 Subject: [PATCH 3/7] Remove serverReadyAction - let Codespaces handle browser opening automatically Co-authored-by: rrrutledge <9609562+rrrutledge@users.noreply.github.com> --- .vscode/launch.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 57fbc212d4..1a061c1ad9 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -15,11 +15,7 @@ "-D" ], "console": "integratedTerminal", - "preLaunchTask": "Hugo: Check Environment", - "serverReadyAction": { - "pattern": "Web Server is available at", - "action": "openExternally" - } + "preLaunchTask": "Hugo: Check Environment" } ] } \ No newline at end of file From 7526abe52488283a3378a13d5be641a1f73d4f43 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Dec 2025 20:34:32 +0000 Subject: [PATCH 4/7] Fix CSS loading by setting proper baseURL for Codespaces using environment variables Co-authored-by: rrrutledge <9609562+rrrutledge@users.noreply.github.com> --- .vscode/launch.json | 15 +++------------ .vscode/start-hugo.sh | 24 ++++++++++++++++++++++++ .vscode/tasks.json | 23 +++++++++++++++++++++++ 3 files changed, 50 insertions(+), 12 deletions(-) create mode 100755 .vscode/start-hugo.sh diff --git a/.vscode/launch.json b/.vscode/launch.json index 1a061c1ad9..b7691fa217 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -3,19 +3,10 @@ "configurations": [ { "name": "Hugo Server", - "type": "pwa-node", + "type": "node-terminal", "request": "launch", - "program": "${workspaceFolder}/node_modules/.bin/hugo", - "args": [ - "server", - "--bind=0.0.0.0", - "--appendPort=false", - "--baseURL=/", - "--liveReloadPort=443", - "-D" - ], - "console": "integratedTerminal", - "preLaunchTask": "Hugo: Check Environment" + "command": "${workspaceFolder}/.vscode/start-hugo.sh", + "cwd": "${workspaceFolder}" } ] } \ No newline at end of file diff --git a/.vscode/start-hugo.sh b/.vscode/start-hugo.sh new file mode 100755 index 0000000000..7ceb7d834b --- /dev/null +++ b/.vscode/start-hugo.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Determine the base URL for Hugo server +# In Codespaces, use the Codespaces URL; otherwise, use localhost + +if [ -n "$CODESPACE_NAME" ]; then + # Running in GitHub Codespaces + BASE_URL="https://${CODESPACE_NAME}-1313.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}" + echo "🚀 Starting Hugo in Codespaces mode" + echo "📍 Base URL: $BASE_URL" +else + # Running locally + BASE_URL="http://localhost:1313" + echo "🚀 Starting Hugo in local mode" + echo "📍 Base URL: $BASE_URL" +fi + +# Start Hugo server with the appropriate configuration +exec hugo server \ + --bind=0.0.0.0 \ + --baseURL="$BASE_URL" \ + --appendPort=false \ + --liveReloadPort=443 \ + -D diff --git a/.vscode/tasks.json b/.vscode/tasks.json index cad81e1d6d..668ca413f3 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -10,6 +10,29 @@ "panel": "dedicated" }, "problemMatcher": [] + }, + { + "label": "Hugo: Start Server", + "type": "shell", + "command": "hugo server --bind=0.0.0.0 --appendPort=false --liveReloadPort=443 -D", + "isBackground": true, + "presentation": { + "reveal": "always", + "panel": "dedicated" + }, + "problemMatcher": { + "pattern": { + "regexp": "^$", + "file": 0, + "location": 1, + "message": 2 + }, + "background": { + "activeOnStart": true, + "beginsPattern": "^.*Building sites.*$", + "endsPattern": "^.*Web Server is available.*$" + } + } } ] } \ No newline at end of file From b982be6fbbe2292ced92811c195f23bf6e233942 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Dec 2025 20:39:24 +0000 Subject: [PATCH 5/7] Make 'hugo server' work automatically in both Codespaces and local environments Co-authored-by: rrrutledge <9609562+rrrutledge@users.noreply.github.com> --- .devcontainer/devcontainer.json | 2 +- .devcontainer/hugo-wrapper.sh | 50 +++++++++++++++++++++++++++++++++ .vscode/start-hugo.sh | 2 +- .vscode/tasks.json | 23 --------------- CODESPACES.md | 18 +++++++++++- README.md | 10 +++++-- hugo-server.sh | 24 ++++++++++++++++ package.json | 2 +- 8 files changed, 101 insertions(+), 30 deletions(-) create mode 100755 .devcontainer/hugo-wrapper.sh create mode 100755 hugo-server.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 446639d0a8..aa3c1ebe8a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -32,5 +32,5 @@ } }, "remoteUser": "vscode", - "postCreateCommand": "npm install; cd /tmp && wget -O hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.133.1/hugo_extended_0.133.1_linux-amd64.deb && sudo dpkg -i hugo.deb && rm hugo.deb && npm init -y && npm install hugo-bin@latest && hugo version && echo 'Hugo server ready to run! Use the Run and Debug view to start the server.'" + "postCreateCommand": "npm install; cd /tmp && wget -O hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.133.1/hugo_extended_0.133.1_linux-amd64.deb && sudo dpkg -i hugo.deb && rm hugo.deb && npm init -y && npm install hugo-bin@latest && sudo mv /usr/local/bin/hugo /usr/local/bin/hugo-real && sudo cp ${containerWorkspaceFolder}/.devcontainer/hugo-wrapper.sh /usr/local/bin/hugo && sudo chmod +x /usr/local/bin/hugo && hugo version && echo 'Hugo server ready! You can now run: hugo server'" } diff --git a/.devcontainer/hugo-wrapper.sh b/.devcontainer/hugo-wrapper.sh new file mode 100755 index 0000000000..f3a26886bc --- /dev/null +++ b/.devcontainer/hugo-wrapper.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash + +# Hugo Wrapper Script for Codespaces +# This script wraps the hugo command to automatically set the correct baseURL in Codespaces + +# Path to the real hugo binary +HUGO_BIN="/usr/local/bin/hugo-real" + +# Check if we're running 'hugo server' command +if [[ "$1" == "server" ]]; then + # Check if we're in GitHub Codespaces + if [ -n "$CODESPACE_NAME" ]; then + # Construct the Codespaces URL + BASE_URL="https://${CODESPACE_NAME}-1313.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}" + + # Check if --baseURL is already provided in arguments + has_baseurl=false + for arg in "$@"; do + if [[ "$arg" == --baseURL=* ]] || [[ "$arg" == "--baseURL" ]]; then + has_baseurl=true + break + fi + done + + # If no baseURL is provided, add our Codespaces URL + if [ "$has_baseurl" = false ]; then + echo "🚀 Running Hugo in Codespaces mode" + echo "📍 Base URL: $BASE_URL" + + # Check if --bind is already provided + has_bind=false + for arg in "$@"; do + if [[ "$arg" == --bind=* ]] || [[ "$arg" == "--bind" ]]; then + has_bind=true + break + fi + done + + # Build the command with automatic Codespaces configuration + if [ "$has_bind" = false ]; then + exec "$HUGO_BIN" "$@" --baseURL="$BASE_URL" --bind=0.0.0.0 --appendPort=false --liveReloadPort=443 + else + exec "$HUGO_BIN" "$@" --baseURL="$BASE_URL" --appendPort=false --liveReloadPort=443 + fi + fi + fi +fi + +# If not 'hugo server' in Codespaces, or baseURL was already provided, just run hugo normally +exec "$HUGO_BIN" "$@" diff --git a/.vscode/start-hugo.sh b/.vscode/start-hugo.sh index 7ceb7d834b..344cd87444 100755 --- a/.vscode/start-hugo.sh +++ b/.vscode/start-hugo.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Determine the base URL for Hugo server # In Codespaces, use the Codespaces URL; otherwise, use localhost diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 668ca413f3..cad81e1d6d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -10,29 +10,6 @@ "panel": "dedicated" }, "problemMatcher": [] - }, - { - "label": "Hugo: Start Server", - "type": "shell", - "command": "hugo server --bind=0.0.0.0 --appendPort=false --liveReloadPort=443 -D", - "isBackground": true, - "presentation": { - "reveal": "always", - "panel": "dedicated" - }, - "problemMatcher": { - "pattern": { - "regexp": "^$", - "file": 0, - "location": 1, - "message": 2 - }, - "background": { - "activeOnStart": true, - "beginsPattern": "^.*Building sites.*$", - "endsPattern": "^.*Web Server is available.*$" - } - } } ] } \ No newline at end of file diff --git a/CODESPACES.md b/CODESPACES.md index a864917c21..8a977910ef 100644 --- a/CODESPACES.md +++ b/CODESPACES.md @@ -26,12 +26,28 @@ The Codespace will take a minute or two to set up. You'll see a loading screen w ### Step 4: Run the Hugo Server -Once the Codespace is loaded: +Once the Codespace is loaded, you can start the Hugo server using any of these methods: + +**Option A: Command Line (Recommended and Easiest)** + +1. Open the terminal (Terminal → New Terminal if not already open) +2. Run: `hugo server` + +That's it! In Codespaces, the `hugo server` command automatically detects the environment and configures everything correctly. + +**Option B: Using the Run and Debug Panel** 1. Click the "Run and Debug" icon in the left sidebar (it looks like a play button with a bug) 2. At the top of the Run and Debug panel, click on the dropdown and select "Hugo Server" 3. Click the green play button to start the Hugo server +**Option C: Using npm** + +1. Open the terminal (Terminal → New Terminal) +2. Run: `npm start` + +All methods work correctly in Codespaces and will automatically configure the proper URL so that CSS and assets load correctly. + ### Step 5: View the Website Preview When the Hugo server starts: diff --git a/README.md b/README.md index b82a4c8ab8..535ac31fd1 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,16 @@ GitHub Codespaces provides an easy way to work on the website without installing 3. Select the "Codespaces" tab 4. Click "Create codespace on master" 5. Wait for the codespace to load (this may take a minute) -6. Once loaded, click the "Run and Debug" icon in the sidebar (or press F5) -7. Select "Hugo Server" from the dropdown menu and click the play button -8. When prompted, click "Open in Browser" to view the website +6. Start the Hugo server using **any of these methods**: + - Run `hugo server` in the terminal (recommended - works automatically in Codespaces!) + - Run `npm start` in the terminal + - Click the "Run and Debug" icon in the sidebar (or press F5), select "Hugo Server" and click the play button +7. When prompted, click "Open in Browser" to view the website The website will be displayed in a new browser tab, and any changes you make will automatically update in real-time. +**Note**: In Codespaces, `hugo server` automatically detects the environment and configures the correct URL, so CSS and assets load properly from the Codespaces forwarded URL. + For a more detailed guide with screenshots, please see our [Codespaces documentation](CODESPACES.md). ### Local Installation diff --git a/hugo-server.sh b/hugo-server.sh new file mode 100755 index 0000000000..a6ff976900 --- /dev/null +++ b/hugo-server.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# Hugo Server Starter for Codespaces and Local Development +# This script automatically detects the environment and starts Hugo with the correct configuration + +if [ -n "$CODESPACE_NAME" ]; then + # Running in GitHub Codespaces + BASE_URL="https://${CODESPACE_NAME}-1313.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}" + echo "🚀 Starting Hugo in Codespaces mode" + echo "📍 Base URL: $BASE_URL" +else + # Running locally + BASE_URL="http://localhost:1313" + echo "🚀 Starting Hugo in local mode" + echo "📍 Base URL: $BASE_URL" +fi + +# Start Hugo server with the appropriate configuration +exec hugo server \ + --bind=0.0.0.0 \ + --baseURL="$BASE_URL" \ + --appendPort=false \ + --liveReloadPort=443 \ + -D diff --git a/package.json b/package.json index 60650de656..a3deec74b8 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "scripts": { "build": "hugo", "build:preview": "hugo --baseURL \"${DEPLOY_PRIME_URL:-/}\" --buildDrafts --buildFuture", - "start": "hugo server" + "start": ".vscode/start-hugo.sh" }, "devDependencies": { "autoprefixer": "^10.3.4", From b409214137cd9906055c148a43efbe44758992fd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Dec 2025 20:40:52 +0000 Subject: [PATCH 6/7] Remove duplicate script and fix npm start path Co-authored-by: rrrutledge <9609562+rrrutledge@users.noreply.github.com> --- hugo-server.sh | 24 ------------------------ package.json | 2 +- 2 files changed, 1 insertion(+), 25 deletions(-) delete mode 100755 hugo-server.sh diff --git a/hugo-server.sh b/hugo-server.sh deleted file mode 100755 index a6ff976900..0000000000 --- a/hugo-server.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -# Hugo Server Starter for Codespaces and Local Development -# This script automatically detects the environment and starts Hugo with the correct configuration - -if [ -n "$CODESPACE_NAME" ]; then - # Running in GitHub Codespaces - BASE_URL="https://${CODESPACE_NAME}-1313.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}" - echo "🚀 Starting Hugo in Codespaces mode" - echo "📍 Base URL: $BASE_URL" -else - # Running locally - BASE_URL="http://localhost:1313" - echo "🚀 Starting Hugo in local mode" - echo "📍 Base URL: $BASE_URL" -fi - -# Start Hugo server with the appropriate configuration -exec hugo server \ - --bind=0.0.0.0 \ - --baseURL="$BASE_URL" \ - --appendPort=false \ - --liveReloadPort=443 \ - -D diff --git a/package.json b/package.json index a3deec74b8..d1d8943f25 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "scripts": { "build": "hugo", "build:preview": "hugo --baseURL \"${DEPLOY_PRIME_URL:-/}\" --buildDrafts --buildFuture", - "start": ".vscode/start-hugo.sh" + "start": "./.vscode/start-hugo.sh" }, "devDependencies": { "autoprefixer": "^10.3.4", From 8804f0d10518b0a65f4c923f5789b515746f1d89 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Dec 2025 20:46:00 +0000 Subject: [PATCH 7/7] Add debugging and improve Codespaces environment detection Co-authored-by: rrrutledge <9609562+rrrutledge@users.noreply.github.com> --- .devcontainer/debug-codespaces.sh | 34 +++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 2 +- .vscode/start-hugo.sh | 24 ++++++++++++++++++++-- CODESPACES.md | 5 +++++ 4 files changed, 62 insertions(+), 3 deletions(-) create mode 100755 .devcontainer/debug-codespaces.sh diff --git a/.devcontainer/debug-codespaces.sh b/.devcontainer/debug-codespaces.sh new file mode 100755 index 0000000000..94d6a20bf7 --- /dev/null +++ b/.devcontainer/debug-codespaces.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# Debug script to check Codespaces environment +echo "=== Codespaces Environment Debug ===" +echo "CODESPACE_NAME: ${CODESPACE_NAME:-NOT SET}" +echo "GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN: ${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN:-NOT SET}" +echo "" + +if [ -n "$CODESPACE_NAME" ]; then + if [ -n "$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN" ]; then + CONSTRUCTED_URL="https://${CODESPACE_NAME}-1313.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}" + else + CONSTRUCTED_URL="https://${CODESPACE_NAME}-1313.app.github.dev" + fi + echo "Constructed Codespaces URL: $CONSTRUCTED_URL" +else + echo "Not running in Codespaces (CODESPACE_NAME not set)" +fi + +echo "" +echo "=== Hugo Binary Location ===" +which hugo +ls -la $(which hugo) 2>/dev/null || echo "Hugo not found" + +echo "" +echo "=== Hugo Version ===" +hugo version 2>/dev/null || echo "Hugo command failed" + +if [ -f "/usr/local/bin/hugo-real" ]; then + echo "" + echo "=== Hugo-real found ===" + ls -la /usr/local/bin/hugo-real + /usr/local/bin/hugo-real version +fi diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index aa3c1ebe8a..52ad66f7a6 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -32,5 +32,5 @@ } }, "remoteUser": "vscode", - "postCreateCommand": "npm install; cd /tmp && wget -O hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.133.1/hugo_extended_0.133.1_linux-amd64.deb && sudo dpkg -i hugo.deb && rm hugo.deb && npm init -y && npm install hugo-bin@latest && sudo mv /usr/local/bin/hugo /usr/local/bin/hugo-real && sudo cp ${containerWorkspaceFolder}/.devcontainer/hugo-wrapper.sh /usr/local/bin/hugo && sudo chmod +x /usr/local/bin/hugo && hugo version && echo 'Hugo server ready! You can now run: hugo server'" + "postCreateCommand": "npm install && cd /tmp && wget -O hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.133.1/hugo_extended_0.133.1_linux-amd64.deb && sudo dpkg -i hugo.deb && rm hugo.deb && npm init -y && npm install hugo-bin@latest && sudo mv /usr/local/bin/hugo /usr/local/bin/hugo-real && sudo cp /workspaces/innersourcecommons.org/.devcontainer/hugo-wrapper.sh /usr/local/bin/hugo && sudo chmod +x /usr/local/bin/hugo && hugo version && echo 'Hugo server ready! You can now run: hugo server'" } diff --git a/.vscode/start-hugo.sh b/.vscode/start-hugo.sh index 344cd87444..39d76fa7e4 100755 --- a/.vscode/start-hugo.sh +++ b/.vscode/start-hugo.sh @@ -5,9 +5,17 @@ if [ -n "$CODESPACE_NAME" ]; then # Running in GitHub Codespaces - BASE_URL="https://${CODESPACE_NAME}-1313.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}" + # Construct the Codespaces URL using the CODESPACE_NAME and port forwarding domain + if [ -n "$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN" ]; then + BASE_URL="https://${CODESPACE_NAME}-1313.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}" + else + # Fallback: construct using the standard pattern + BASE_URL="https://${CODESPACE_NAME}-1313.app.github.dev" + fi echo "🚀 Starting Hugo in Codespaces mode" echo "📍 Base URL: $BASE_URL" + echo "📍 CODESPACE_NAME: $CODESPACE_NAME" + echo "📍 GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN: ${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN:-not set, using default}" else # Running locally BASE_URL="http://localhost:1313" @@ -16,7 +24,19 @@ else fi # Start Hugo server with the appropriate configuration -exec hugo server \ +# Use the actual hugo binary path to ensure we're not calling a wrapper +HUGO_CMD="hugo" + +# Check if hugo-real exists (wrapper might be installed) +if [ -x "/usr/local/bin/hugo-real" ]; then + HUGO_CMD="/usr/local/bin/hugo-real" + echo "📍 Using hugo-real binary" +elif command -v hugo &> /dev/null; then + HUGO_CMD="hugo" + echo "📍 Using standard hugo binary" +fi + +exec $HUGO_CMD server \ --bind=0.0.0.0 \ --baseURL="$BASE_URL" \ --appendPort=false \ diff --git a/CODESPACES.md b/CODESPACES.md index 8a977910ef..66dfbcb61c 100644 --- a/CODESPACES.md +++ b/CODESPACES.md @@ -88,6 +88,11 @@ When the Hugo server starts: If you encounter any issues: +- **CSS not loading (assets loading from localhost:1313)**: This means the Codespace environment wasn't detected properly. Try these steps: + 1. Stop the Hugo server (Ctrl+C in the terminal or stop debugging) + 2. Run `.devcontainer/debug-codespaces.sh` in the terminal to check your environment + 3. Make sure you see the "Running in Codespaces mode" message when starting Hugo + 4. If the environment variables are not set, try rebuilding the container (see below) - **Hugo server not starting**: Try restarting the Codespace by clicking on the menu in the bottom left corner and selecting "Codespaces: Stop Current Codespace" and then restarting it. - **Changes not showing**: Make sure you've saved your files and that the Hugo server is running. - **Port not forwarding**: Click the "Ports" tab at the bottom of the Codespace and make sure port 1313 is forwarded.