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

Allow usage front-matter data in listing template #348

Merged
merged 1 commit into from
Dec 6, 2020

Conversation

vvscode
Copy link
Contributor

@vvscode vvscode commented Nov 29, 2020

Allows to use data from file meta (front matter) in listing template

#346

@vvscode
Copy link
Contributor Author

vvscode commented Nov 29, 2020

On demo with node bin/reveal-md.js demo/ --static dist it gives

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Directory Listing</title>
    <link rel="stylesheet" href="./dist/theme/black.css" id="theme" />
  </head>

  <body>
    <ul>
          <li><a href="a.html" title="">a.html</a></li>
          <li><a href="b.html" title="">b.html</a></li>
          <li><a href="e.html" title="Custom Options With Frontmatter">e.html</a></li>
          <li><a href="sub&#x2F;c.html" title="Foobar">sub&#x2F;c.html</a></li>
          <li><a href="sub&#x2F;deep&#x2F;d.html" title="">sub&#x2F;deep&#x2F;d.html</a></li>
    </ul>
  </body>
</html>

@vvscode vvscode force-pushed the front-matter-for-listing branch from e247432 to ff244ac Compare November 29, 2020 22:55
@webpro webpro merged commit 4bc7f3e into webpro:master Dec 6, 2020
@webpro
Copy link
Owner

webpro commented Dec 6, 2020

Thanks @vvscode! It's the new feature in v4.3.0. I did refactor your implementation slightly to have a single array of files in the template. Also see https://github.com/webpro/reveal-md/blob/master/lib/template/listing.html

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.

2 participants