From 031c96c72d168a23cca0c609f46e019eced8bc64 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Fri, 18 Dec 2015 09:40:52 -0600 Subject: Updated slide mode --- lib/response.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/response.js b/lib/response.js index 640e83bf..375fc3f4 100644 --- a/lib/response.js +++ b/lib/response.js @@ -24,8 +24,8 @@ var Mustache = require('mustache'); var opts = { userBasePath: process.cwd(), revealBasePath: path.resolve(require.resolve('reveal.js'), '..', '..'), - template: fs.readFileSync(path.join('.', '/public/views/templates', 'reveal.html')).toString(), - templateListing: fs.readFileSync(path.join('.', '/public/views/templates', 'listing.html')).toString(), + template: fs.readFileSync(path.join('.', '/public/views/slide', 'reveal.hbs')).toString(), + templateListing: fs.readFileSync(path.join('.', '/public/views/slide', 'listing.hbs')).toString(), theme: 'css/theme/black.css', highlightTheme: 'zenburn', separator: '^(\r\n?|\n)---(\r\n?|\n)$', @@ -404,7 +404,6 @@ function publishNoteActions(req, res, next) { } } - function showPublishSlide(req, res, next) { var shortid = req.params.shortid; if (shortId.isValid(shortid)) { @@ -425,8 +424,12 @@ function showPublishSlide(req, res, next) { return; } var body = LZString.decompressFromBase64(data.rows[0].content); + var title = data.rows[0].title; + var decodedTitle = LZString.decompressFromBase64(title); + if (decodedTitle) title = decodedTitle; + title = Note.generateWebTitle(title); var text = S(body).escapeHTML().s; - render(res, text); + render(res, title, text); }); }); }); @@ -436,10 +439,11 @@ function showPublishSlide(req, res, next) { } //reveal.js render -var render = function (res, markdown) { +var render = function (res, title, markdown) { var slides = md.slidify(markdown, opts); res.end(Mustache.to_html(opts.template, { + title: title, theme: opts.theme, highlightTheme: opts.highlightTheme, slides: slides, -- cgit v1.2.3