Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy assets specified in YAML Front matter for a static build #279

Merged
merged 2 commits into from Nov 8, 2019

Conversation

jnv
Copy link
Contributor

@jnv jnv commented Oct 30, 2019

This is a follow-up to #265 which got recently closed.

I was unable to reproduce the issue with linking. I am on macOS 10.15 with Node v10.17.0 (I have also tried v12.12.0 with the same result).

My suspicion is that maybe we are not awaiting for the whole array of promises from copyAssetsAndWriteFile to resolve, so I have added Promise.all around the return value. Other than that I have rebased the PR, removed unnecessary async, and added an example to demo folder. Most of the hard work has been already done by @lukaszkostrzewa, I would just like to help to get this fix through.

@webpro
Copy link
Owner

webpro commented Oct 31, 2019

Thanks @jnv!

What I'm seeing now is that the "tomorrow-night-bright" highlight styles are copied properly, but the theme is not actually used in the exported version (it still uses the default "zenburn"). The "night" theme is also available in the export, but not used.

@jnv
Copy link
Contributor Author

jnv commented Nov 1, 2019

@webpro Thanks for checking that out. Maybe I am missing something or there's another issue, as I cannot reproduce that problem either.

I have converted demo/e.md like this:

cd reveal-md
rm -rf _static
reveal-md demo/e.md --static

I do get the correct highlight theme in the generated _static folder:
image

And the generated e.html file has correct references to CSS, this is what's inside the <head>:

    <title>Custom Options With Frontmatter</title>
    <link rel="stylesheet" href="./css/reveal.css" />
    <link rel="stylesheet" href="./css/theme/night.css" id="theme" />
    <link rel="stylesheet" href="./css/highlight/tomorrow-night-bright.css" />

So both the theme and highlight theme are correctly linked in my case. I have no idea why it's not working in your case; what OS and Node version are you using? Maybe I can try to create similar testing conditions. Or maybe there's some caching? 🤔

@webpro webpro merged commit 7bbe1a8 into webpro:master Nov 8, 2019
@webpro
Copy link
Owner

webpro commented Nov 8, 2019

I'm sorry @jnv, when executing reveal-md with your new code, I was still using the global reveal-md in my $PATH 🤦‍♂️

Let's see later if we can simplify copyAssetsFromOptions a bit, but I'm merging this now so people can use it. Thanks!

@jnv jnv deleted the copy-frontmatter branch November 8, 2019 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants