Skip to content

Commit

Permalink
Include custom theme file when copying static assets (fixes #322)
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Aug 22, 2020
1 parent 42c9392 commit a2eaad7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const write = (target, content) => {
return fs.outputFile(target, content);
};

const copyAssetsFromOptions = function (markdown) {
const copyAssetsFromOptions = async function (markdown) {
const { yamlOptions } = parseYamlFrontMatter(markdown.toString());
const options = getSlideOptions(yamlOptions);
const staticDir = getStaticDir();
Expand All @@ -44,14 +44,15 @@ const copyAssetsFromOptions = function (markdown) {
_.partialRight(_.map, asset => cp(asset, path.join(staticDir, getAssetsDir(), asset)))
)([
typeof options.scripts === 'string' ? options.scripts.split(',') : options.scripts,
typeof options.css === 'string' ? options.css.split(',') : options.css
typeof options.css === 'string' ? options.css.split(',') : options.css,
(await fs.pathExists(options.theme)) ? options.theme : null
])
);
};

const copyAssetsAndWriteFile = async (sourceDir, file, targetDir) => {
const markdown = await fs.readFile(path.join(sourceDir, file));
const awaits = copyAssetsFromOptions(markdown);
const awaits = await copyAssetsFromOptions(markdown);
let image;
while ((image = mdImageRE.exec(markdown))) {
const [, , imgPath] = image;
Expand Down

0 comments on commit a2eaad7

Please sign in to comment.