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