webpro / reveal-md

reveal.js on steroids! Get beautiful reveal.js presentations from any Markdown file
MIT License
3.75k stars 418 forks source link

Invalid path in exported html when using a custum theme #403

Open PierreRust opened 2 years ago

PierreRust commented 2 years ago

I'm using a custom theme in my presentation, and a custom css file, using the yaml front matter:

---
theme: theme/orange.css
css: theme/custom.css
---

when generating a static html export, the custom css file is defined using a relative path, but the link to the theme is absolute :

<link rel="stylesheet" href="/_assets/theme/mytheme.css" id="theme" />

<link rel="stylesheet" href="./_assets/theme/custom.css" />

That unfortunately means that when the static export is loaded from a subdirectory on a server, e.g. http://mysite/mypresentation/myslide.html the link to the custom theme will not work as it resolves to http://mysite/_assets/theme/mytheme.css. The relative link of the custom css works fine although.

I'm currently using a workaround with a custom template file but it will be nice if the export would add the relative link automatically.

And thanks for that great tool :)

lmoresi commented 2 years ago

Same issue but using

reveal-md --theme theme/custom.css

My workaround is to point back to my original repository for the css file (I'm generating a site using github actions to github pages).

I have slides embedded in web pages so there are subdirectories galore.

AmarOk1412 commented 2 years ago

Also an issue if you use a scss theme (reveal.js has .scss themes now)