Skip to content

Commit

Permalink
Merge pull request #14 from autotraderuk/fragments-and-background-inc…
Browse files Browse the repository at this point in the history
…ludes

Replace plugins with includes for GHP compatibility
  • Loading branch information
dploeger authored Sep 10, 2018
2 parents 515cb43 + 20b047e commit 2b1c66a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 21 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,23 +142,23 @@ To use vertical slides, do the same, but use two dashes:
Fragments allow slide elements to come one by one. This is often used in lists to subsequently show
fragments of a list during a presentation.

To use fragments, jekyll-reveal.js includes a jekyll-plugin, that simplifies the use of fragments
in markdown. To specify the current element as a fragment, use the {% fragment %}-tag like this:
Jekyll-reveal.js simplifies the reveal.js syntax. To specify the current element as a fragment, use `<fragment/>` like
this:

# Slide

* This {% fragment %}
* will {% fragment %}
* come one by one {% fragment %}
* This <fragment/>
* will <fragment/>
* come one by one <fragment/>

### Slide backgrounds

To modify the background of the current slide, jekyll-reveal.js also includes a simplification
plugin:
To modify the background of the current slide, jekyll-reveal.js simplifies the syntax to
`<background>color</background>`:

# Slide

{% background white %}
<background>white</background>

This slide has a white background

Expand Down
8 changes: 7 additions & 1 deletion _layouts/reveal.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@

<div class="slides">

{{ content }}
{% for post in site.posts reversed %}
<section data-markdown data-separator="^\n---\n$" data-separator-vertical="^\n--\n$" data-notes="^Note:">
<script type="text/template">
{{ post.content | replace:'<fragment/>','<!-- .element: class="fragment" -->' | replace:'<background>','<!-- .slide: data-background="' | replace:'<background/>','" -->' }}
</script>
</section>
{% endfor %}

</div>

Expand Down
5 changes: 3 additions & 2 deletions _posts/0000-01-03-fragments.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

It's also possible to do fragments.

- Like {% fragment %}
- This {% fragment %}
- You can use &lt;fragment/&gt; to step your list items
- like <fragment/>
- this <fragment/>
4 changes: 3 additions & 1 deletion _posts/0000-01-05-background.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Backgrounds

{% background green %}
<background>green<background/>

Or use different backgrounds.

&lt;background&gt;green&lt;background/&gt;
10 changes: 1 addition & 9 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
---
layout: reveal
title: not used. Use _config.yml!
---

{% for post in site.posts reversed %}
<section data-markdown data-separator="^\n---\n$" data-separator-vertical="^\n--\n$" data-notes="^Note:">
<script type="text/template">
{{ post.content }}
</script>
</section>
{% endfor %}
---

0 comments on commit 2b1c66a

Please sign in to comment.