Skip to content

Commit 38187a6

Browse files
committed
Updated wasm output directories and added list and single templates
1 parent 0b71cb5 commit 38187a6

File tree

5 files changed

+22
-5
lines changed

5 files changed

+22
-5
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set(CMAKE_CXX_STANDARD 17)
55

66
if (NOT CMAKE_BUILD_TYPE MATCHES Debug)
77
# Wasm files directory
8-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/web/static/wasm)
8+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/web/static/assets/wasm)
99
endif ()
1010

1111
# Add nn directory to the build
@@ -36,7 +36,7 @@ else ()
3636
target_link_libraries(main_executable nn_lib)
3737

3838
# Set output name
39-
set_target_properties(main_executable PROPERTIES OUTPUT_NAME "wasm")
39+
set_target_properties(main_executable PROPERTIES OUTPUT_NAME "main")
4040

4141
# Release flags
4242
target_link_options(main_executable PRIVATE "SHELL:-s NO_EXIT_RUNTIME=1")

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ To get started with development:
9494
2. **Configure Build Profiles**:
9595
- **Release Profile**: For building the final WebAssembly version of the project, use the Release profile. This
9696
includes Emscripten's toolchain for WebAssembly compilation. Compiled wasm files will be located
97-
at `/web/static/wasm`
97+
at `/web/static/assets/wasm`
9898
afterward to be used by hugo server.
9999
```sh
100100
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=path/to/emscripten/cmake/Modules/Platform/Emscripten.cmake -B build/release -S .
@@ -120,4 +120,4 @@ To get started with development:
120120
5. **Web Integration** (Release profile only):
121121
- For the Release profile, include the generated JavaScript and WebAssembly files in your web project. Use the
122122
Emscripten Module API for interaction with the compiled code.
123-
- All wasm files are generated at `/web/static/wasm`. `web/static` directory is served 'as is' by hugo server.
123+
- All wasm files are generated at `/web/static/wasm`. `web/static` directory is served as-is by hugo server.

web/layouts/_default/baseof.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
3131
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
3232
crossorigin="anonymous"></script>
33-
<script src="{{ site.BaseURL }}/wasm/wasm.js" async></script>
33+
<script src="{{ site.BaseURL }}/wasm.js" async></script>
3434
</body>
3535
</html>

web/layouts/_default/list.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{{ define "main" }}
2+
<h1>{{ .Title }}</h1>
3+
{{ .Content }}
4+
{{ range .Pages }}
5+
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
6+
{{ .Summary }}
7+
{{ end }}
8+
{{ end }}

web/layouts/_default/single.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{{ define "main" }}
2+
<h1>{{ .Title }}</h1>
3+
4+
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
5+
{{ $dateHuman := .Date | time.Format ":date_long" }}
6+
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
7+
8+
{{ .Content }}
9+
{{ end }}

0 commit comments

Comments
 (0)