From 628c8da8327dd2660279b00d9652abb253c3ed05 Mon Sep 17 00:00:00 2001 From: Si manglam Date: Wed, 4 Dec 2024 19:25:34 +0800 Subject: [PATCH] fix(convert): blank web page when converting multiple slides into HTML (#497) * fix(convert): Blank web page when converting multiple slides into HTML * chore(docs): add changelog * Fix typo --- CHANGELOG.md | 2 ++ manim_slides/convert.py | 1 + manim_slides/templates/revealjs.html | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc7ae4b..8110b40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 and `av<14`, as their syntax differ, but the former doesn't provide binary wheels for Python 3.9. [#494](https://github.com/jeertmans/manim-slides/pull/494) +- Fixed blank web page when converting multiple slides into HTML. + [#497](https://github.com/jeertmans/manim-slides/pull/497) (v5.1.9)= ## [v5.1.9](https://github.com/jeertmans/manim-slides/compare/v5.1.8...v5.1.9) diff --git a/manim_slides/convert.py b/manim_slides/convert.py index b693bc3..1a50152 100644 --- a/manim_slides/convert.py +++ b/manim_slides/convert.py @@ -453,6 +453,7 @@ class RevealJS(Converter): get_duration_ms=get_duration_ms, has_notes=has_notes, env=os.environ, + prefix=prefix if not self.data_uri else None, **options, ) diff --git a/manim_slides/templates/revealjs.html b/manim_slides/templates/revealjs.html index 33db2c3..14dbf8b 100644 --- a/manim_slides/templates/revealjs.html +++ b/manim_slides/templates/revealjs.html @@ -25,7 +25,7 @@ {%- if data_uri -%} {% set file = file_to_data_uri(slide_config.file) %} {%- else -%} - {% set file = assets_dir / slide_config.file.name %} + {% set file = assets_dir / (prefix(outer_loop.index0) + slide_config.file.name) %} {%- endif -%}