Skip to content

Commit

Permalink
change header to heading to avoid confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbobbe committed Jan 8, 2018
1 parent 9e64e59 commit 40ea8c3
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 18 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,30 @@ A Jekyll version of the responsive, single-page "Prologue" theme by [HTML5 UP](h

There are two ways to get started:

1. Fork the GitHub [repository](https://github.com/chrisbobbe/jekyll-theme-prologue). If you want to use [GitHub Pages](https://pages.github.com/), create a branch named `gh-pages`. (NOTE: The _config.yml file in this repository has `baseurl` set for my own GitHub Pages site, so you'll want to change it or make it blank.)
1. Fork the [GitHub repository](https://github.com/chrisbobbe/jekyll-theme-prologue). If you want to use [GitHub Pages](https://pages.github.com/), create a branch named `gh-pages`. (NOTE: The _config.yml file in this repository has `baseurl` set for my own GitHub Pages site, so you'll want to change it or make it blank.)
2. Install the theme using the jekyll-theme-prologue gem. Instructions can be found [here](https://jekyllrb.com/docs/themes/#installing-a-theme).

**The following instructions apply to this theme only.**

Your `_config.yml` file **must include the following line or it will not work**: `collections: [sections]`. An optional sample config called `_sample-config.yml` ships with the gem for your convenience. If using the gem, run `open $(bundle show jekyll-theme-prologue)` to find this file, then move it to your project directory. It will do nothing until it's renamed `_config.yml` and sits in your project's root directory.
Your `_config.yml` file **must include the following line or it will not work**: `collections: [sections]`. This tells Jekyll to look in the _sections folder (which you will create) for your content. A sample config `_config.yml` is in the GitHub repository for your reference. If using the gem, run `open $(bundle show jekyll-theme-prologue)` to find this file, then optionally move it to your project's root directory. It will do nothing until you move it there.

Create a `_sections` folder in your project's root directory, or use the one provided in the GitHub repository, and start adding content.
Create a `_sections` folder in your project's root directory and start adding content. Sample content is provided in the [GitHub repository](https://github.com/chrisbobbe/jekyll-theme-prologue).

All new sections should be added as html or Markdown documents in the `_sections` folder. The following section variables can be set with frontmatter:
- `title` (required)
- `order` (required; orders the sequence of sections on the page. Section 1 displays with banner.jpg)
- `icon` (optional; see [Font Awesome](http://fontawesome.io/icons/) for icon codes)
- `auto-header` (optional; "use-title" is default, "none" for no header, or custom header text in section headings)
- `auto-header` (optional; "use-title" is default, "none" for no header, or custom header text)

To set the banner image, overwrite `assets/images/banner.jpg`. Same for `avatar.jpg`.

# Jekyll and the single-page view

**This theme is designed to include all content on a single scrollable page.** That means a few things are different from what you might expect.
**This theme is designed to include all content on a single scrollable page.** That means a few things are different from what you might expect in Jekyll.

You don't need to use Jekyll's hardcoded support for `_pages` or `_posts`, and layouts aren't provided for them. Each section (intro, about me, etc.) is built from an html or Markdown document in the `_sections` folder with corresponding [frontmatter](https://jekyllrb.com/docs/frontmatter/).
You don't need to use Jekyll's hardcoded support for `_pages` or `_posts`, and layouts aren't provided for them. Jekyll does not support multiple layout-formatted content sections per page. Each section (intro, about me, etc.) is built from an html or Markdown document in the `_sections` folder with corresponding [frontmatter](https://jekyllrb.com/docs/frontmatter/).

Since Jekyll does not support multiple layout-formatted content sections per page, this theme doesn't have a `section.html` layout in the `_layouts` folder. If you're looking to customize the templates, go to `_layouts/home.html` and `_includes/section.html`.
If you're looking to customize the templates, go to `_layouts/home.html` and `_includes/section.html`.

There shouldn't be a need to set `permalink` in frontmatter because all content appears on the same page.

Expand Down
21 changes: 19 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
# Welcome to Jekyll!
# Developer's Note: This is a sample _config.yml file offered with
# jekyll-theme-prologue for your convenience. To use it, move it to your
# project's root directory. Please note that the following lines are
# NECESSARY for Prologue to work correctly:
#
# theme: jekyll-theme-prologue
# collections: [sections]
#
# They activate the theme and tell Jekyll to find your content
# in /_sections. Note where "sections" starts with an underscore
# and where it doesn't. The social settings will make links to
# Twitter, etc.
#
# Also, be sure to customize baseurl for your site.
#
# ---------------------------------------------------------------
#
# Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
Expand All @@ -19,7 +36,7 @@ description: >- # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
# You'll want to change the baseurl; I've customized it for GitHub Pages:
# You'll want to customize baseurl for your own site:
baseurl: "/jekyll-theme-prologue" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site

Expand Down
4 changes: 2 additions & 2 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ <h1 id="title">{{ site.title}}</h1>
-->
<ul>
{% assign sections = site.sections | where_exp: 'section','section.order >= 1' %}
{% unless site.sections == null %}
{% unless sections == null %}
{% assign sections = sections | sort: 'order' %}
{% for section in sections %}
{% assign slug = section.title | slugify | default: 'untitled' %}
{% assign title = section.title | default: 'Untitled' %}
{% assign slug = section.title | slugify | default: 'untitled' %}
{% assign icon = section.icon | default: 'fa-file' %}
<li><a href="#{{ slug }}" id="{{ slug }}-link" class="skel-layers-ignoreHref"><span class="icon {{ icon }}">{{ title }}</span></a></li>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion _includes/section.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section id="{{ include.id | normalize_whitespace }}" class="{{ include.class | normalize_whitespace }}">
<div class="container">
{{ include.header }}
{{ include.heading }}
{{ include.content }}
</div>
</section>
8 changes: 4 additions & 4 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@
{% endif %}

{% if section.auto-header == 'none' %}
{% assign header = "" %}
{% assign heading = "" %}
{% elsif section.auto-header == null or section.auto-header == 'use-title' %}
{% capture header %}
{% capture heading %}
<header>
<h2>{{ title }}</h2>
</header>
{% endcapture %}
{% else %}
{% capture header %}
{% capture heading %}
<header>
<h2>{{ section.auto-header }}</h2>
</header>
{% endcapture %}
{% endif %}

{% include section.html id=slug class=class header=header content=section.content %}
{% include section.html id=slug class=class heading=heading content=section.content %}

{% endfor %}

Expand Down
4 changes: 2 additions & 2 deletions jekyll-theme-prologue.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |spec|
spec.name = "jekyll-theme-prologue"
spec.version = "0.2.2"
spec.version = "0.2.3"
spec.authors = ["HTML5 UP", "Chris Bobbe"]
spec.email = ["[email protected]"]

Expand All @@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
spec.homepage = "https://github.com/chrisbobbe/jekyll-theme-prologue"
spec.license = "CC-BY-3.0"

spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|_layouts|_includes|_sass|_sample-config.yml|LICENSE|README)}i) }
spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|_layouts|_includes|_sass|_config.yml|LICENSE|README)}i) }

spec.add_development_dependency "jekyll", "~> 3.3"
spec.add_development_dependency "bundler", "~> 1.12"
Expand Down

0 comments on commit 40ea8c3

Please sign in to comment.