forked from daattali/beautiful-jekyll
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
125 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
layout: default | ||
show-avatar: false | ||
--- | ||
|
||
<h2 class="post_title">{{page.title}}:</h2> | ||
|
||
<div class="posts-list"> | ||
{% for post in site.posts %} | ||
{% for tag in post.tags %} | ||
{% if tag == page.tag %} | ||
<article class="post-preview"> | ||
<a href="{{ post.url | prepend: site.baseurl }}"> | ||
<h3 class="post-title">{{ post.title }}</h3> | ||
|
||
{% if post.subtitle %} | ||
<h4 class="post-subtitle"> | ||
{{ post.subtitle }} | ||
</h4> | ||
{% endif %} | ||
</a> | ||
|
||
<p class="post-meta"> | ||
Posted on {{ post.date | date: "%B %-d, %Y" }} | ||
</p> | ||
|
||
<div class="post-entry"> | ||
{{ post.content | strip_html | xml_escape | truncatewords: 50 }} | ||
<a href="{{ post.url | prepend: site.baseurl }}" class="post-read-more">[Read More]</a> | ||
</div> | ||
|
||
<div class="blog-tags"> | ||
Tags: | ||
{% for tag in post.tags %} | ||
<a href="/tag/{{ tag }}">{{ tag }}</a> | ||
{% endfor %} | ||
</div> | ||
</article> | ||
{% endif %} | ||
{% endfor %} | ||
{% endfor %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module Jekyll | ||
class TagIndex < Page | ||
def initialize(site, base, dir, tag) | ||
@site = site | ||
@base = base | ||
@dir = dir | ||
@name = 'index.html' | ||
self.process(@name) | ||
self.read_yaml(File.join(base, '_layouts'), 'tag_index.html') | ||
self.data['tag'] = tag | ||
tag_title_prefix = site.config['tag_title_prefix'] || 'Posts Tagged “' | ||
tag_title_suffix = site.config['tag_title_suffix'] || '”' | ||
self.data['title'] = "#{tag_title_prefix}#{tag}#{tag_title_suffix}" | ||
end | ||
end | ||
class TagGenerator < Generator | ||
safe true | ||
def generate(site) | ||
if site.layouts.key? 'tag_index' | ||
dir = site.config['tag_dir'] || 'tag' | ||
site.tags.keys.each do |tag| | ||
write_tag_index(site, File.join(dir, tag), tag) | ||
end | ||
end | ||
end | ||
def write_tag_index(site, dir, tag) | ||
index = TagIndex.new(site, site.source, dir, tag) | ||
index.render(site.layouts, site.site_payload) | ||
index.write(site.dest) | ||
site.pages << index | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
--- | ||
layout: post | ||
title: First post! | ||
tags: [random, exciting-stuff] | ||
--- | ||
|
||
This is my first post, how exciting! | ||
This is my first post, how exciting! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
--- | ||
layout: post | ||
title: Pirates arrrr | ||
tags: [pirates, random] | ||
--- | ||
|
||
Piracy is typically an act of robbery or criminal violence at sea. The term can include acts committed on land, in the air, or in other major bodies of water or on a shore. It does not normally include crimes committed against persons traveling on the same vessel as the perpetrator (e.g. one passenger stealing from others on the same vessel). The term has been used throughout history to refer to raids across land borders by non-state agents. | ||
Piracy is typically an act of robbery or criminal violence at sea. The term can include acts committed on land, in the air, or in other major bodies of water or on a shore. It does not normally include crimes committed against persons traveling on the same vessel as the perpetrator (e.g. one passenger stealing from others on the same vessel). The term has been used throughout history to refer to raids across land borders by non-state agents. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
--- | ||
layout: post | ||
title: Dear diary | ||
tags: [random, diary, school] | ||
--- | ||
|
||
What is it with that Mary girl? Dragging me to school every day. As if I had a choice. What you don't hear in those nursery rhymes is that she starves me if I don't go to school with her; it's the only way I can stay alive! I'm thinking about being adopted by Little Bo Peep, sure I may get lost, but anything is better than being with Mary and those little brats at school (shudder, shudder). | ||
What is it with that Mary girl? Dragging me to school every day. As if I had a choice. What you don't hear in those nursery rhymes is that she starves me if I don't go to school with her; it's the only way I can stay alive! I'm thinking about being adopted by Little Bo Peep, sure I may get lost, but anything is better than being with Mary and those little brats at school (shudder, shudder). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters