diff --git a/lib/response.js b/lib/response.js
index a9abd1d41..cda484e71 100755
--- a/lib/response.js
+++ b/lib/response.js
@@ -13,6 +13,7 @@ var moment = require('moment')
var config = require('./config')
var logger = require('./logger')
var models = require('./models')
+var utils = require('./utils')
// public
var response = {
@@ -574,6 +575,7 @@ function showPublishSlide (req, res, next) {
updatetime: updatetime,
url: origin,
body: markdown,
+ theme: utils.isRevealTheme(meta.slideOptions.theme),
meta: JSON.stringify(extracted.meta),
useCDN: config.usecdn,
owner: note.owner ? note.owner.id : null,
diff --git a/lib/utils.js b/lib/utils.js
index d9289dca5..247f85f25 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -1,4 +1,6 @@
'use strict'
+const fs = require('fs')
+const path = require('path')
exports.isSQLite = function isSQLite (sequelize) {
return sequelize.options.dialect === 'sqlite'
@@ -23,3 +25,10 @@ exports.getImageMimeType = function getImageMimeType (imagePath) {
return undefined
}
}
+
+exports.isRevealTheme = function isRevealTheme (theme) {
+ if (fs.existsSync(path.join(__dirname, '..', 'public', 'build', 'reveal.js', 'css', 'theme', theme + '.css'))) {
+ return theme
+ }
+ return undefined
+}
diff --git a/public/views/slide.ejs b/public/views/slide.ejs
index 26c38bba5..7ff5016e6 100644
--- a/public/views/slide.ejs
+++ b/public/views/slide.ejs
@@ -30,7 +30,11 @@
<% } %>
+ <% if(typeof theme !== 'undefined' && theme) { %>
+
+ <% } else { %>
+ <% } %>