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

Multi slides #33

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

longavailable
Copy link

Made some changes to support multiple presentations in one branch:

  • changed the default posts to slides collection;
  • added a layout for slides collection and set it as default page;
  • modified the previous reveal.html to make it work only for single file;
  • merge the previous multi-files slide to one-file slide and add another;
  • update the readme.md.

Note that, the only syntax change for [jekyll-revealjs] is that the separator for horizontal slides --- to <!--horizontal-->, vertical from -- to <!--vertical--> to avoid the conflicts with the front matter for specific slide file.

- add a 'slides' collection to make it clearer than 'posts'
- convert to absolute path
- meta and link in head
- boday
- make the head fit the front matter of a slide file
- convert '---' to '<!--horizontal->' to avoid confilt with its front matter
- convert '--' to '<!--vertical-->'
@cortexmancer
Copy link

Hey guys, why this didn't got merged?

@edgar-bonet
Copy link

This is a great addition! However, this pull request breaks the offline capability of jekyll-revealjs.

One great feature of jekyll-revealjs is that it doesn't need a server to work: you can just open _site/index.html in a browser. This means that, if you copy _site into a thumb drive, you have a presentation that works everywhere, on any computer, even without Internet access. By using absolute URLs in links, this pull request breaks this capability.

Proposed fix (click to expand)
diff --git a/_config.yml b/_config.yml
index 4766c65..a37a69e 100644
--- a/_config.yml
+++ b/_config.yml
@@ -14,7 +14,7 @@ reveal_theme: black.css
 reveal_transition: default
 
 # Path to the used theme (defaults to the Reveal.js standard theme path)
-reveal_theme_path: /reveal.js/css/theme/ 
+reveal_theme_path: ../reveal.js/css/theme/
 
 # Additional custom CSS paths
 extra_css: 
@@ -32,7 +32,7 @@ reveal_options:
 reveal_dependencies: 
 
 # Reveal.js subdirectory
-reveal_path: /reveal.js/
+reveal_path: ../reveal.js/
 
 collections:
   slides:
diff --git a/_layouts/slides.html b/_layouts/slides.html
index 486ffb9..2b5a72f 100644
--- a/_layouts/slides.html
+++ b/_layouts/slides.html
@@ -8,7 +8,7 @@ permalink: /
 	<div class="list-group-item">
 	
 		<!-- title -->
-		<a href="{{ slide.url }}">
+		<a href=".{{ slide.url }}">
 			<h4 class="list-group-item-heading">{{ slide.title }}</h4>
 		</a>
 		
@@ -26,13 +26,13 @@ permalink: /
 		<div class="tags"><div class="spacing-2x"><p>
 			Keywords:
 			{% for tag in slide.tags %}
-				<a class="tag" href="/tags/#{{ tag }}" title="{{tag}}">{{tag}}</a>
+				<a class="tag" href="tags/#{{ tag }}" title="{{tag}}">{{tag}}</a>
 				{% if tag != slide.tags.last %},{% endif %}	<!-- split with ',' -->
 			{% endfor %}
 		</p></div></div>
 		
 		<!-- excerpt -->
-		<p>{{ slide.excerpt | strip_html}} <a href="{{ slide.url }}"> ▶️ Show now</a></p>
+		<p>{{ slide.excerpt | strip_html}} <a href=".{{ slide.url }}"> ▶️ Show now</a></p>
 	</div>
 	{% endfor %}
 </div>
\ No newline at end of file

edgar-bonet added a commit to edgar-bonet/atelier-arduino that referenced this pull request Oct 6, 2024
Importing dploeger/jekyll-revealjs#33 .
This makes it possible to host multiple presentations in the same repo.

This commit is purposefully empty.
@mrmanc
Copy link
Collaborator

mrmanc commented Jan 6, 2025

Hey guys, why this didn't got merged?

It’s an interesting idea. However, it’s a breaking change to every presentation that uses this as a remote theme. Granted, that isn’t most people’s use case, but I have a number of presentations that use a downstream repo to achieve this (imported reveal.js using a different mechanism), and I’m not keen on diverging this repo from that one.

I’d need to spend a significant amount of time reviewing it and looking at ways of maintaining backward compatibility. As most of us are, I’m time-poor, so it’s not been a priority (so far).

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.

4 participants