Skip to content
Rob Denton edited this page Aug 10, 2014 · 2 revisions

Overview

This repo is the home of content for rgpages.github.io and, more importantly, pages.registerguard.com.

Content is generated via a Jekyll content-management system. It's a very simple blog setup, comparable to Wordpress, but scaled back even further.

Each post is created in the _posts folder and automatically displayed on the index, which is all we really care about since we just want a collection of links to our specialized content.

New posts

See here for more info.

Each post file looks something like this:

---
layout:   "post"
title:    "River run: Jet boat tour"
slug:     "jet-boat-tour"
date:     "2014-08-09"
category: "Production"
---

You'll notice their is no actual content, only what is known as "head-matter" in Jekyll. This is non-content metadata essentially. But it can be used as a variable and printed out as content.

The title is whatever you want it to be called, the slug is the name of the repo as it appears in the url. Date is the date you want it to display and category is either production or template (for now, could add more categories in the future).

That data is then called by the index with prints out the Github url and pages url using the slug. The index also looks for an image called default.png in the repo associated with the slug.

Therefore, all the user has to do each time there is a new repo is copy another post and update the post head matter. And make sure there is a default.png in the repo.

index.html

All the magic the user sees is in the index.html file.

---
layout: default
---

<div class="home">

  <h1>Posts</h1>
  
  <ul class="posts">
    {% for post in site.posts %}
      {% if post.category == "Production" %}
        <li>
          <span class="post-date">{{ post.date | date: "%b %-d, %Y" }}</span>
          <a class="post-link" href="http://pages.registerguard.com/{{ post.slug }}/">{{ post.title }}</a>
          <br>
          <a href="http://github.com/rgpages/{{ post.slug }}/">View on Github</a>.
          <a href="http://pages.registerguard.com/{{ post.slug }}">
            {% if post.postimage %}
              <img src="http://pages.registerguard.com/{{ post.slug }}/{{ post.postimage }}" width="100%" style="border:1px solid black">
            {% else %}
              <img src="http://pages.registerguard.com/{{ post.slug }}/default.png" width="100%" style="border:1px solid black">
            {% endif %}
          </a>
        </li>
      {% endif %}
    {% endfor %}
  </ul>

  <p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | prepend: site.baseurl }}">via RSS</a></p>

</div>

Each post.slug simply calls some of that head matter in the post. The post.postimage is an optional head matter attribute to link to a gif or other kind of image instead of default.png.

Clone this wiki locally