Host web build at /kobo subpath: index.html + back link
- KOBO_EXEFILE -> index.html so the game can be reached at https://lindholm.dev/kobo/ without an explicit filename. Sibling artifacts follow suit (index.js / .wasm / .data); install rule and build-web.sh serve hint updated to match. - web/shell.html: small "← lindholm.dev" link top-left. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
0677b2cbca
commit
7ac9875d11
@ -90,7 +90,9 @@ if(EMSCRIPTEN)
|
|||||||
# Config/scores live under /home which we mount as IDBFS for persistence
|
# Config/scores live under /home which we mount as IDBFS for persistence
|
||||||
# (see Module.preRun in the HTML shell / build-web.sh).
|
# (see Module.preRun in the HTML shell / build-web.sh).
|
||||||
set(KOBO_BUNDLE_STYLE "web")
|
set(KOBO_BUNDLE_STYLE "web")
|
||||||
set(KOBO_EXEFILE "kobodl.html")
|
# index.html so the game can be served from a clean subpath URL
|
||||||
|
# (e.g. https://lindholm.dev/kobo/ — no explicit filename).
|
||||||
|
set(KOBO_EXEFILE "index.html")
|
||||||
set(KOBO_DATA_DIR "/data")
|
set(KOBO_DATA_DIR "/data")
|
||||||
set(KOBO_SCORE_DIR "/home/scores")
|
set(KOBO_SCORE_DIR "/home/scores")
|
||||||
set(KOBO_CONFIG_DIR "/home")
|
set(KOBO_CONFIG_DIR "/home")
|
||||||
@ -253,12 +255,12 @@ elseif(KOBO_BUNDLE_STYLE STREQUAL "simple")
|
|||||||
install(DIRECTORY data/gfx data/sfx DESTINATION KoboDeluxe)
|
install(DIRECTORY data/gfx data/sfx DESTINATION KoboDeluxe)
|
||||||
install(FILES COPYING COPYING.LIB README ChangeLog TODO DESTINATION KoboDeluxe)
|
install(FILES COPYING COPYING.LIB README ChangeLog TODO DESTINATION KoboDeluxe)
|
||||||
elseif(KOBO_BUNDLE_STYLE STREQUAL "web")
|
elseif(KOBO_BUNDLE_STYLE STREQUAL "web")
|
||||||
# Emscripten emits kobodl.html / .js / .wasm / .data — install all four.
|
# Emscripten emits index.html / .js / .wasm / .data — install all four.
|
||||||
install(TARGETS kobodl RUNTIME DESTINATION web)
|
install(TARGETS kobodl RUNTIME DESTINATION web)
|
||||||
install(FILES
|
install(FILES
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/kobodl.js
|
${CMAKE_CURRENT_BINARY_DIR}/index.js
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/kobodl.wasm
|
${CMAKE_CURRENT_BINARY_DIR}/index.wasm
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/kobodl.data
|
${CMAKE_CURRENT_BINARY_DIR}/index.data
|
||||||
DESTINATION web OPTIONAL)
|
DESTINATION web OPTIONAL)
|
||||||
else()
|
else()
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|||||||
@ -42,7 +42,7 @@ socketserver.TCPServer(('', 8000), H).serve_forever()
|
|||||||
emcmake cmake -DCMAKE_BUILD_TYPE=Release "$HERE"
|
emcmake cmake -DCMAKE_BUILD_TYPE=Release "$HERE"
|
||||||
cmake --build . -j
|
cmake --build . -j
|
||||||
echo
|
echo
|
||||||
echo "Built: $BUILD/kobodl.html"
|
echo "Built: $BUILD/index.html"
|
||||||
echo "Serve: ./build-web.sh serve (then open http://localhost:8000/kobodl.html)"
|
echo "Serve: ./build-web.sh serve (then open http://localhost:8000/)"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@ -11,9 +11,15 @@
|
|||||||
canvas { background: #000; image-rendering: pixelated; outline: none;
|
canvas { background: #000; image-rendering: pixelated; outline: none;
|
||||||
max-width: 100%; max-height: 100vh; }
|
max-width: 100%; max-height: 100vh; }
|
||||||
#status { padding: 8px; font-size: 13px; }
|
#status { padding: 8px; font-size: 13px; }
|
||||||
|
#back { position: fixed; top: 10px; left: 12px; z-index: 10;
|
||||||
|
color: #888; text-decoration: none; font-size: 13px;
|
||||||
|
padding: 4px 8px; border: 1px solid #333; border-radius: 3px;
|
||||||
|
background: rgba(0,0,0,0.6); }
|
||||||
|
#back:hover { color: #ddd; border-color: #666; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<a id="back" href="https://lindholm.dev">← lindholm.dev</a>
|
||||||
<div id="wrap">
|
<div id="wrap">
|
||||||
<canvas id="canvas" tabindex="-1" oncontextmenu="event.preventDefault()"></canvas>
|
<canvas id="canvas" tabindex="-1" oncontextmenu="event.preventDefault()"></canvas>
|
||||||
<div id="status">Loading…</div>
|
<div id="status">Loading…</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user