MathJax: Path to root
If `source` starts with `/` interpret it relative to output dir.
This commit is contained in:
parent
48808bfb75
commit
4c20ab4248
|
@ -681,10 +681,15 @@ fn make_data(
|
||||||
data.insert("mathjax_support".to_owned(), json!(true));
|
data.insert("mathjax_support".to_owned(), json!(true));
|
||||||
} else if html_config.mathjax.enable {
|
} else if html_config.mathjax.enable {
|
||||||
data.insert("mathjax_enable".to_owned(), json!(true));
|
data.insert("mathjax_enable".to_owned(), json!(true));
|
||||||
data.insert(
|
if let Some(ref source) = html_config.mathjax.source {
|
||||||
"mathjax_source".to_owned(),
|
if source.starts_with("/") {
|
||||||
json!(html_config.mathjax.source),
|
data.insert("mathjax_root".to_owned(), json!(true));
|
||||||
);
|
let (_, relative_source) = source.split_at(1);
|
||||||
|
data.insert("mathjax_source".to_owned(), json!(relative_source));
|
||||||
|
} else {
|
||||||
|
data.insert("mathjax_source".to_owned(), json!(source));
|
||||||
|
}
|
||||||
|
}
|
||||||
data.insert(
|
data.insert(
|
||||||
"mathjax_config".to_owned(),
|
"mathjax_config".to_owned(),
|
||||||
json!(html_config.mathjax.config),
|
json!(html_config.mathjax.config),
|
||||||
|
|
|
@ -67,9 +67,13 @@
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{#if mathjax_root}}
|
||||||
|
<script id="MathJax-script" async src="{{ path_to_root }}{{ mathjax_source }}/{{ mathjax_config }}.js"></script>
|
||||||
|
{{else}}
|
||||||
<script id="MathJax-script" async src="{{ mathjax_source }}/{{ mathjax_config }}.js"></script>
|
<script id="MathJax-script" async src="{{ mathjax_source }}/{{ mathjax_config }}.js"></script>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="body-container">
|
<div id="body-container">
|
||||||
|
|
Loading…
Reference in New Issue