CI: fix build

Change-Id: I75432693106668382fb097939cb98f3fbc3e0eeb
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 69364f3..b71cbfa 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,7 +6,8 @@
 stages:
   - build
 
-# variables:
+variables:
+  SOURCE_FILE: "inst/rmarkdown/templates/posterdown_ids/skeleton/skeleton.Rmd"
 #  CHROME_VERSION: "114.0.5735.198-1"
 
 build-job:
@@ -56,9 +57,12 @@
     - R -e 'devtools::install()'
     - end_section installing
     - start_section render "Generating demo artifacts"
-    - R_CACHE_ROOTPATH=./cache R -e "require(rmarkdown); render('inst/rmarkdown/templates/posterdown_ids/skeleton/skeleton.Rmd', output_format='posterdown.ids::posterdown_ids', output_dir='target')"
-    - ./ci/html2pdf target/skeleton.html target/skeleton.pdf 1
-    - inkscape -b white --pdf-poppler -o target/skeleton.svg target/skeleton.pdf || true
-    - scour -i target/skeleton.svg -o target/skeleton_optimized.svg --enable-viewboxing --enable-id-stripping --shorten-ids --indent=none
+    - R_CACHE_ROOTPATH=./cache R -e "require(rmarkdown); render('$SOURCE_FILE', output_format='posterdown.ids::posterdown_ids', output_dir='target')"
+    - export SVG=target/$(basename $SOURCE_FILE .Rmd).svg
+    - export HTML=target/$(basename $SOURCE_FILE .Rmd).html
+    - export PDF=target/$(basename $SOURCE_FILE .Rmd).pdf
+    - ./ci/html2pdf $HTML $PDF 1
+    - inkscape -b white --pdf-poppler -o $SVG $PDF || true
+    - scour -i $SVG -o target/skeleton_optimized.svg --enable-viewboxing --enable-id-stripping --shorten-ids --indent=none
     - end_section render