File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 "configurations" : [
44 {
55 "name" : " Hugo Server" ,
6- "type" : " pwa- node" ,
6+ "type" : " node-terminal " ,
77 "request" : " launch" ,
8- "program" : " ${workspaceFolder}/node_modules/.bin/hugo" ,
9- "args" : [
10- " server" ,
11- " --bind=0.0.0.0" ,
12- " --appendPort=false" ,
13- " --baseURL=/" ,
14- " --liveReloadPort=443" ,
15- " -D"
16- ],
17- "console" : " integratedTerminal" ,
18- "preLaunchTask" : " Hugo: Check Environment"
8+ "command" : " ${workspaceFolder}/.vscode/start-hugo.sh" ,
9+ "cwd" : " ${workspaceFolder}"
1910 }
2011 ]
2112}
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Determine the base URL for Hugo server
4+ # In Codespaces, use the Codespaces URL; otherwise, use localhost
5+
6+ if [ -n " $CODESPACE_NAME " ]; then
7+ # Running in GitHub Codespaces
8+ BASE_URL=" https://${CODESPACE_NAME} -1313.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN} "
9+ echo " 🚀 Starting Hugo in Codespaces mode"
10+ echo " 📍 Base URL: $BASE_URL "
11+ else
12+ # Running locally
13+ BASE_URL=" http://localhost:1313"
14+ echo " 🚀 Starting Hugo in local mode"
15+ echo " 📍 Base URL: $BASE_URL "
16+ fi
17+
18+ # Start Hugo server with the appropriate configuration
19+ exec hugo server \
20+ --bind=0.0.0.0 \
21+ --baseURL=" $BASE_URL " \
22+ --appendPort=false \
23+ --liveReloadPort=443 \
24+ -D
Original file line number Diff line number Diff line change 1010 "panel" : " dedicated"
1111 },
1212 "problemMatcher" : []
13+ },
14+ {
15+ "label" : " Hugo: Start Server" ,
16+ "type" : " shell" ,
17+ "command" : " hugo server --bind=0.0.0.0 --appendPort=false --liveReloadPort=443 -D" ,
18+ "isBackground" : true ,
19+ "presentation" : {
20+ "reveal" : " always" ,
21+ "panel" : " dedicated"
22+ },
23+ "problemMatcher" : {
24+ "pattern" : {
25+ "regexp" : " ^$" ,
26+ "file" : 0 ,
27+ "location" : 1 ,
28+ "message" : 2
29+ },
30+ "background" : {
31+ "activeOnStart" : true ,
32+ "beginsPattern" : " ^.*Building sites.*$" ,
33+ "endsPattern" : " ^.*Web Server is available.*$"
34+ }
35+ }
1336 }
1437 ]
1538}
You can’t perform that action at this time.
0 commit comments