diff --git a/roles/web-app-littlejs/filter_plugins/littlejs.py b/roles/web-app-littlejs/filter_plugins/littlejs.py index 36c9304e..b4217c15 100644 --- a/roles/web-app-littlejs/filter_plugins/littlejs.py +++ b/roles/web-app-littlejs/filter_plugins/littlejs.py @@ -19,9 +19,8 @@ def littlejs_href(example, protocol, domain): if is_project: return f"{protocol}://{domain}/examples/{file}/" - # Short examples: internal wrapper - return f"{protocol}://{domain}/examples/shorts/base.html?file={file}" - + # Non-full shorts: use custom runner without example browser overhead + return f"{protocol}://{domain}/examples/shorts/run.html?file={file}" class FilterModule(object): def filters(self): diff --git a/roles/web-app-littlejs/tasks/01_core.yml b/roles/web-app-littlejs/tasks/01_core.yml index b80bcd06..d2e5bec6 100644 --- a/roles/web-app-littlejs/tasks/01_core.yml +++ b/roles/web-app-littlejs/tasks/01_core.yml @@ -17,6 +17,15 @@ - docker compose build - docker compose up +- name: "Render LittleJS run.html for shorts" + template: + src: "html/run.html.j2" + dest: "{{ LITTLEJS_RUN_HOST_ABS }}" + mode: "0644" + notify: + - docker compose build + - docker compose up + - name: "flush docker compose for '{{ application_id }}'" meta: flush_handlers diff --git a/roles/web-app-littlejs/templates/Dockerfile.j2 b/roles/web-app-littlejs/templates/Dockerfile.j2 index f1abfbee..18393582 100644 --- a/roles/web-app-littlejs/templates/Dockerfile.j2 +++ b/roles/web-app-littlejs/templates/Dockerfile.j2 @@ -1,4 +1,3 @@ -# roles/web-app-littlejs/templates/Dockerfile.j2 FROM nginx:alpine # Static LittleJS assets – engine builds + examples @@ -7,3 +6,6 @@ COPY ./{{ LITTLEJS_APP_REL }}/dist /usr/share/nginx/html/dist # Custom Infinito.Nexus landing page with Bootstrap menu and tiles COPY ./{{ LITTLEJS_INDEX_HOST_REL }} /usr/share/nginx/html/index.html + +# Custom runner for non-full LittleJS shorts examples +COPY ./{{ LITTLEJS_RUN_HOST_REL }} /usr/share/nginx/html/examples/shorts/run.html diff --git a/roles/web-app-littlejs/templates/html/run.html.j2 b/roles/web-app-littlejs/templates/html/run.html.j2 new file mode 100644 index 00000000..5a536f2a --- /dev/null +++ b/roles/web-app-littlejs/templates/html/run.html.j2 @@ -0,0 +1,69 @@ + + +
+ +