@@ -9,6 +9,7 @@ folders=(
99 " examples/3d/ofxAssimpBoneControlExample"
1010# "examples/3d/ofxAssimpAdvancedExample" #broken currently
1111 " examples/3d/ofNodeExample"
12+ " examples/3d/multiTexture3dExample"
1213 " examples/3d/modelNoiseExample"
1314# gl
1415 " examples/gl/shadowsExample"
@@ -17,18 +18,31 @@ folders=(
1718 " examples/gl/vboMeshDrawInstancedExample"
1819# math
1920 " examples/math/noise1dOctaveExample"
21+ " examples/math/particlesExample"
22+ " examples/math/periodicSignalsExample"
23+ " examples/math/trigonometryExample"
24+ " examples/math/trigonometricMotionExample"
25+
2026 # Add more paths as needed
2127)
2228
2329cur_root=$( pwd) ;
30+ script_path=" $( cd " $( dirname " $0 " ) " && pwd) "
31+
2432cd $cur_root ;
2533mkdir -p out
2634out_folder=" $cur_root /out"
2735
36+ outPaths=" "
37+ outThumbs=" "
38+
2839# Iterate through the folder paths
2940for folder in " ${folders[@]} " ; do
3041 # Check if the folder exists
3142 if [ -d " $folder " ]; then
43+
44+ parent_folder=$( dirname " $folder " )
45+ parent_folder_name=$( basename " $parent_folder " )
3246
3347 # Change to the directory
3448 cd $folder
@@ -41,7 +55,27 @@ for folder in "${folders[@]}"; do
4155 echo " Couldn't build emscripten example: $folder "
4256 else
4357 folder_name=$( basename " $folder " )
44- cp -r " bin/em/$folder_name " " $out_folder /"
58+ mkdir -p " $out_folder /$parent_folder_name "
59+ cp -r " bin/em/$folder_name " " $out_folder /$parent_folder_name /"
60+
61+ thumb_png=" $folder_name .png"
62+ thumb_gif=" $folder_name .gif"
63+ thumb_jpg=" $folder_name .jpg"
64+
65+ if [ -e " $thumb_png " ]; then
66+ cp -r $thumb_png " $out_folder /$parent_folder_name /$folder_name /"
67+ outThumbs+=" $thumb_png ,"
68+ elif [ -e " $thumb_gif " ]; then
69+ cp -r $thumb_gif " $out_folder /$parent_folder_name /$folder_name /"
70+ outThumbs+=" $thumb_gif ,"
71+ elif [ -e " $thumb_jpg " ]; then
72+ cp -r $thumb_jpg " $out_folder /$parent_folder_name /$folder_name /"
73+ outThumbs+=" $thumb_jpg ,"
74+ else
75+ outThumbs+=" of.png,"
76+ fi
77+
78+ outPaths+=" $parent_folder_name /$folder_name ,"
4579 fi
4680
4781 cd $cur_root
@@ -51,6 +85,21 @@ for folder in "${folders[@]}"; do
5185done
5286
5387cd $cur_root ;
88+
89+ # Remove the trailing comma
90+ outPaths=${outPaths% ,}
91+ outThumbs=${outThumbs% ,}
92+
93+ htmlFile=" $out_folder /index.html"
94+
95+ echo " outPaths is $outPaths "
96+ echo " html is $htmlFile "
97+
98+ # Replace the placeholder in the template file
99+ cp -r $script_path /index.html $htmlFile
100+ sed -i " s|REPLACE_ME|$outPaths |g" $htmlFile
101+ sed -i " s|REPLACE_FILES|$outThumbs |g" $htmlFile
102+
54103DO_UPLOAD=" false"
55104
56105if [[ " $GH_ACTIONS " = true && " ${GH_BRANCH} " == " master" && -z " ${GH_HEAD_REF} " ]]; then
0 commit comments