Skip to content

Commit

Permalink
Merge pull request #27 from mrmanc/make-description-and-author-config…
Browse files Browse the repository at this point in the history
…urable

Fixes #18 by reading description and author from the site configuration
  • Loading branch information
dploeger authored Feb 5, 2019
2 parents 42ad14b + 2b6f23e commit 857bb64
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 36 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ Jekyll will assume that each post has been made on the first of January, 2001 (w

You can configure almost any reveal.js setting using the `_config.yml` settings file in the root directory.

- `title`: The title of your presentation (displayed in the browser's title bar)
- `title`: The title of your presentation (displayed in the browser's title bar, optional and defaults to your repository’s name thanks to the `jekyll-github-metadata` plugin)
- `description`: A description for your presentation (displayed in the HTML head, optional and defaults to your repository’s description thanks to the `jekyll-github-metadata` plugin)
- `author`: Your name (displayed in the HTML head)
- `reveal_theme`: The reveal.js-theme to use [default.css]
- `reveal_transition`: The reveal.js-transition to use [default]
- `reveal_theme_path`: The path to the reveal.js-theme (can be changed for custom themes) [reveal.js/css/theme/]
Expand Down
7 changes: 6 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Your presentation title
title: Jekyll and Reveal.js

# Your presentation description (optional)
description: A framework for easily creating beautiful presentations using HTML

# Your name (optional)
author: jekyll-revealjs contributors

# The Reveal theme
reveal_theme: black.css
Expand Down
68 changes: 34 additions & 34 deletions _layouts/reveal.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
<head>
<meta charset="utf-8">

<title>{{ site.title }}</title>
{% if site.title %}<title>{{ site.title }}</title>{% endif %}

<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">
<meta name="apple-mobile-web-app-capable" content="yes" />
{% if site.description %}<meta name="description" content="{{ site.description }}">{% endif %}
{% if site.author %}<meta name="author" content="{{ site.author }}">{% endif %}
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

<link rel="stylesheet" href="{{ site.reveal_path }}css/reveal.css">
<link rel="stylesheet" href="{{ site.reveal_theme_path }}{{ site.reveal_theme }}" id="theme">
{% if site.extra_css %}
{% for css_file in site.extra_css %}
<link rel="stylesheet" href="{{ css_file }}">
{% endfor %}
{% for css_file in site.extra_css %}
<link rel="stylesheet" href="{{ css_file }}">
{% endfor %}
{% endif %}

<!-- For syntax highlighting -->
{% if site.highlight_style_sheet %}
{% assign highlight_style_sheet = site.highlight_style_sheet %}
{% else %}
{% capture highlight_style_sheet %}{{ site.reveal_path }}lib/css/zenburn.css {% endcapture %}
{% endif %}
<link rel="stylesheet" href="{{ highlight_style_sheet }}">
{% if site.highlight_style_sheet %}
{% assign highlight_style_sheet = site.highlight_style_sheet %}
{% else %}
{% capture highlight_style_sheet %}{{ site.reveal_path }}lib/css/zenburn.css {% endcapture %}
{% endif %}
<link rel="stylesheet" href="{{ highlight_style_sheet }}">

<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
Expand All @@ -43,7 +43,7 @@

<div class="reveal">

<div class="slides">
<div class="slides">

{% for post in site.posts reversed %}
<section data-markdown data-separator="^\n---\n$" data-separator-vertical="^\n--\n$" data-notes="^Note:">
Expand All @@ -53,7 +53,7 @@
</section>
{% endfor %}

</div>
</div>

</div>

Expand All @@ -73,17 +73,17 @@
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: '{{ site.reveal_transition }}', // default/cube/page/concave/zoom/linear/fade/none

{% if site.reveal_options %}
{% if site.reveal_options.first.first %}
// Reveal options generated from mapping
{% for option in site.reveal_options %}
{{ option[0] }}: "{{ option[1] }}",
{% endfor %}
{% else %}
// Reveal options generated from a list of strings
{{ site.reveal_options | append:',' }}
{% endif %}
{% endif %}
{% if site.reveal_options %}
{% if site.reveal_options.first.first %}
// Reveal options generated from mapping
{% for option in site.reveal_options %}
{{ option[0] }}: "{{ option[1] }}",
{% endfor %}
{% else %}
// Reveal options generated from a list of strings
{{ site.reveal_options | append:',' }}
{% endif %}
{% endif %}
// Optional libraries used to extend on reveal.js
dependencies: [
Expand All @@ -92,15 +92,15 @@
{ src: '{{ site.reveal_path }}plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: '{{ site.reveal_path }}plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: '{{ site.reveal_path }}plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{% if site.reveal_notes_server %}
{ src: '{{ site.reveal_path }}socket.io/socket.io.js', async: true },
{ src: '{{ site.reveal_path }}plugin/notes-server/client.js', async: true }
{% else %}
{% if site.reveal_notes_server %}
{ src: '{{ site.reveal_path }}socket.io/socket.io.js', async: true },
{ src: '{{ site.reveal_path }}plugin/notes-server/client.js', async: true }
{% else %}
{ src: '{{ site.reveal_path }}plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
{% endif %}
{% if site.reveal_dependencies %}
, {{ site.reveal_dependencies }}
{% endif %}
{% endif %}
{% if site.reveal_dependencies %}
, {{ site.reveal_dependencies }}
{% endif %}
]
});

Expand Down

0 comments on commit 857bb64

Please sign in to comment.