mirror of https://github.com/status-im/codimd.git
Update to support slideOptions in the YAML metadata
This commit is contained in:
parent
7ea56c78a2
commit
b367e110b6
|
@ -237,6 +237,8 @@ module.exports = function (sequelize, DataTypes) {
|
||||||
_meta.robots = meta.robots;
|
_meta.robots = meta.robots;
|
||||||
if (meta.GA && (typeof meta.GA == "string" || typeof meta.GA == "number"))
|
if (meta.GA && (typeof meta.GA == "string" || typeof meta.GA == "number"))
|
||||||
_meta.GA = meta.GA;
|
_meta.GA = meta.GA;
|
||||||
|
if (meta.slideOptions && (typeof meta.slideOptions == "object"))
|
||||||
|
_meta.slideOptions = meta.slideOptions;
|
||||||
}
|
}
|
||||||
return _meta;
|
return _meta;
|
||||||
}
|
}
|
||||||
|
|
|
@ -555,6 +555,7 @@ function showPublishSlide(req, res, next) {
|
||||||
title: title,
|
title: title,
|
||||||
description: meta.description,
|
description: meta.description,
|
||||||
slides: slides,
|
slides: slides,
|
||||||
|
slideOptions: JSON.stringify(meta.slideOptions || {}),
|
||||||
GA: meta.GA,
|
GA: meta.GA,
|
||||||
useCDN: config.usecdn
|
useCDN: config.usecdn
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,10 +44,13 @@ var defaultOptions = {
|
||||||
dependencies: deps
|
dependencies: deps
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// options from yaml meta
|
||||||
|
var options = JSON.parse($("#options").text());
|
||||||
|
|
||||||
// options from URL query string
|
// options from URL query string
|
||||||
var queryOptions = Reveal.getQueryHash() || {};
|
var queryOptions = Reveal.getQueryHash() || {};
|
||||||
|
|
||||||
var options = extend(defaultOptions, queryOptions);
|
var options = extend(defaultOptions, options, queryOptions);
|
||||||
Reveal.initialize(options);
|
Reveal.initialize(options);
|
||||||
|
|
||||||
viewAjaxCallback = function () {
|
viewAjaxCallback = function () {
|
||||||
|
|
|
@ -50,6 +50,8 @@
|
||||||
<div class="slides"><%- slides %></div>
|
<div class="slides"><%- slides %></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="options" class="hidden"><%- slideOptions %></div>
|
||||||
|
|
||||||
<script type="text/x-mathjax-config">
|
<script type="text/x-mathjax-config">
|
||||||
MathJax.Hub.Config({ messageStyle: "none", skipStartupTypeset: true ,tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']], processEscapes: true }});
|
MathJax.Hub.Config({ messageStyle: "none", skipStartupTypeset: true ,tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']], processEscapes: true }});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue