Open FilouPlains opened 1 week ago
@FilouPlains Thanks for opening the issue and glad you're getting use from the project 🙏🏻 It looks like when those features were added there wasn't a way to fallback to a local version or at least to not make the remote call and fail. I will check on it. For now you may have to comment those lines out locally or in a fork and load the files you need statically instead. I'll keep you posted.
@joshed-io
Just to maintain you updated, I have made a fork of your project: https://github.com/FilouPlains/reveal-hugo/blob/master/layouts/partials/layout/javascript.html
In the file that I ping you, I added:
{{- $mermaid_location := $.Param "reveal_hugo.mermaid_cdn" | default "__fetch_cdn__" -}}
{{ if eq $mermaid_location "__fetch_mermaid_cdn__" }}
{{ $mermaid_location := resources.GetRemote "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js" }}
<script type="text/javascript" src="{{ $mermaid_location.RelPermalink }}"></script>
{{ else }}
<script type="text/javascript" src="{{ $mermaid_location }}"></script>
{{ end }}
And:
{{- $mathjax_location := $.Param "reveal_hugo.mathjax_cdn" | default "__fetch_cdn__" -}}
{{ if eq $mathjax_location "__fetch_cdn__" }}
{{ $mathjax_location := resources.GetRemote "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js" }}
<script type="text/javascript" id="MathJax-script" async src="{{ $mathjax_location.RelPermalink }}"></script>
{{ else }}
<script type="text/javascript" id="MathJax-script" async src="{{ $mathjax_location }}"></script>
{{ end }}
You can add in the hugo.toml
the next parameters:
[params.reveal_hugo]
mermaid_cdn = "path"
mathjax_cdn = "path
In order to point to the path you want to! Note that I did not test it fully offline. I am very new to hugo, so the syntax might not be that good, but I do hope you understand the idea behind what I tried to add.
Have a lovely day and I keep you in touch if the addition work or not fully offline!
reveal-hugo not working offline
Hi !
First, thanks for this extension, it helps to make presentation way easier! I was trying to make a presentation 100% offline. You never know if the Wi-Fi connection will be there during a presentation… But it is not working.
The error
It cannot load
MathJax
(and same forMermaid
).Investigation
I think it comes from there for
Mermaid
:and from here for
MathJax
:Solution?
I do not know if that me who has done something wrong. But, a workarround that I see should be to simply let the user give the path to
Mermaid
andMathJax
JS. Like that, I would be abble to point to a JS instatic/
directory! Like I am doing forMol*
orPlotly
integration for instance.