octopress-genesis-theme 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/config.yml +26 -8
- data/assets/includes/feed/entry.xml +30 -0
- data/assets/includes/feed/head.xml +9 -0
- data/assets/includes/index-post.html +2 -2
- data/assets/includes/search/duckduckgo.html +4 -0
- data/assets/includes/search/google.html +4 -0
- data/assets/includes/site-footer.html +2 -0
- data/assets/layouts/category-feed.html +8 -0
- data/assets/pages/feed-articles.xml +14 -0
- data/assets/pages/feed-links.xml +14 -0
- data/assets/pages/feed.xml +12 -0
- data/demo/_plugins/theme/config.yml +0 -19
- data/demo/_posts/2014-08-03-dang-that-was-fast.md +3 -2
- data/lib/octopress-genesis.rb +1 -0
- data/lib/octopress-genesis/category-generator.rb +41 -21
- data/lib/octopress-genesis/version.rb +1 -1
- data/octopress-genesis.gemspec +1 -0
- metadata +24 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32d5f7e9176584bfaa80812d9fb84ad4bb6be3dc
|
4
|
+
data.tar.gz: cb5829a501b655dac1f4a24c4039b91111100192
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f519acee6b7401d5feaacbabe2dfe4c2a863b3362db2c7e9ca944d4b4a5de5ae14a3442807d3e9db9fd814f039c6979ca1a25ac717de8dd5ef41de7b18e91a52
|
7
|
+
data.tar.gz: da333c5ad070fb023d6be6472198bbcfd2198040e1571ca25ec8d84e38367db51587c7e013e0249472ac4407fa0e518e361c0e20e3b0ef30deeed75e407a6087
|
data/assets/config.yml
CHANGED
@@ -1,22 +1,40 @@
|
|
1
1
|
# Settings for main header
|
2
2
|
header:
|
3
3
|
title: My Octopress Blog
|
4
|
-
subtitle:
|
4
|
+
subtitle:
|
5
5
|
|
6
6
|
# Links for main navigation
|
7
7
|
nav:
|
8
8
|
- { url: '/', title: 'Home' }
|
9
|
-
- { url: '/archive', title: 'Archive' }
|
10
|
-
- { url: '/feed', title: 'RSS' }
|
9
|
+
- { url: '/archive/', title: 'Archive' }
|
10
|
+
- { url: '/feed/', title: 'RSS' }
|
11
11
|
|
12
|
-
# Settings for category
|
12
|
+
# Settings for category generator
|
13
13
|
category:
|
14
|
-
|
15
|
-
|
14
|
+
title: Category
|
15
|
+
dir: 'categories'
|
16
|
+
feeds: false
|
17
|
+
|
18
|
+
# The base url for categories
|
19
|
+
# An empty string means categories will live at the root directory.
|
20
|
+
|
21
|
+
# To add per category feeds, use an array of category names you want feeds for.
|
22
|
+
# for example:
|
23
|
+
# feeds:
|
24
|
+
# - news
|
25
|
+
# - programming
|
16
26
|
|
17
27
|
post_index:
|
18
|
-
|
28
|
+
excerpt_articles: true
|
19
29
|
permalink_label: "Permalink"
|
20
30
|
read_more_label: "Continue Reading →"
|
21
31
|
|
22
|
-
|
32
|
+
feeds:
|
33
|
+
count: 10
|
34
|
+
main_feed: true
|
35
|
+
linkpost_feed: true
|
36
|
+
article_feed: true
|
37
|
+
excerpt_articles: false
|
38
|
+
|
39
|
+
center_headings: true
|
40
|
+
search: google
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<title type="html">{{ post.title_text }}</title>
|
2
|
+
{% if post.linkpost %}
|
3
|
+
<link rel="alternate" type="text/html" href="{{ post.external-url }}"/>
|
4
|
+
<link rel="related" type="text/html" href="{{ post.url | full_url }}"/>
|
5
|
+
{% else %}
|
6
|
+
<link rel="alternate" type="text/html" href="{{ post.url | full_url }}"/>
|
7
|
+
{% endif %}
|
8
|
+
<id>{{ post.id }}</id>
|
9
|
+
<published>{{ post.date_xml }}</published>
|
10
|
+
<updated>{% return post.updated_date_xml || post.date_xml %}</updated>
|
11
|
+
<author>
|
12
|
+
<name>{% return post.author || site.author %}</name>
|
13
|
+
<uri>{% return post.author_site || site.url %}</uri>
|
14
|
+
</author>
|
15
|
+
<content type="html" xml:base="{{ site.url }}" xml:lang="en">
|
16
|
+
<![CDATA[
|
17
|
+
{% if theme.feeds.excerpt_articles and post.linkpost == false %}
|
18
|
+
{{ post.excerpt | full_urls }}
|
19
|
+
|
20
|
+
{% if post.excerpted %}
|
21
|
+
<p><a href="{{ post.url | full_url }}">Continue reading →</a></p>
|
22
|
+
{% endif %}
|
23
|
+
{% else %}
|
24
|
+
{{ post.content | full_urls }}
|
25
|
+
{% if post.linkpost %}
|
26
|
+
<p><a href="{{ post.url | full_url }}">∞ Permalink</a></p>
|
27
|
+
{% endif %}
|
28
|
+
{% endif %}
|
29
|
+
]]>
|
30
|
+
</content>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<feed xmlns="http://www.w3.org/2005/Atom">
|
3
|
+
<title>{{ return theme.header.title }}</title>
|
4
|
+
<link rel="alternate" type="text/html" href="{{ site.url }}/"/>
|
5
|
+
<link rel="self" type="application/atom+xml" href="{{ page.url | remove:'index.xml' | full_url }}"/>
|
6
|
+
<id>{{ site.url }}</id>
|
7
|
+
<updated>{% return include.last_post.date_updated_xml || include.last_post.date_xml %}</updated>
|
8
|
+
<generator uri="http://octopress.org/">Octopress</generator>
|
9
|
+
<rights>Copyright © {{ site.time | date: '%Y' }}, {{ site.author | strip_html }}</rights>
|
@@ -1,8 +1,8 @@
|
|
1
|
-
{% assign post_content = (theme.
|
1
|
+
{% assign post_content = (theme.post-index.excerpt-articles ? post.excerpt : post.content) %}
|
2
2
|
{% assign excerpted = true if post_content != post.content %}
|
3
3
|
{% assign classnames = post.class | join: " " | classify if post.class %}
|
4
4
|
{% assign classnames += " excerpt" if excerpted %}
|
5
|
-
{% assign permalink_label = (excerpted ? theme.
|
5
|
+
{% assign permalink_label = (excerpted ? theme.post-index.read_more_label : theme.post-index.permalink-label) %}
|
6
6
|
|
7
7
|
<article class="entry {{ classnames }}" role="article">
|
8
8
|
<header class="entry-header">
|
@@ -0,0 +1,8 @@
|
|
1
|
+
{% assign last_post = site.categories[page.category].last %}
|
2
|
+
{% include theme:feed/head.xml last_post=last_post %}
|
3
|
+
{% for post in site.categories[page.category] limit:theme.feeds.count %}
|
4
|
+
<entry>
|
5
|
+
{% include theme:feed/entry.xml %}
|
6
|
+
</entry>
|
7
|
+
{% endfor %}
|
8
|
+
</feed>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
---
|
2
|
+
permalink: /feed/articles/
|
3
|
+
title: Articles-only Feed
|
4
|
+
feed: articles
|
5
|
+
---
|
6
|
+
{% if theme.feeds.article_feed %}
|
7
|
+
{% include theme:feed/head.xml last_post=site.articles.last %}
|
8
|
+
{% for post in site.articles limit:theme.feeds.count %}
|
9
|
+
<entry>
|
10
|
+
{% include theme:feed/entry.xml %}
|
11
|
+
</entry>
|
12
|
+
{% endfor %}
|
13
|
+
</feed>
|
14
|
+
{% else %}{% abort %}{% endif %}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
---
|
2
|
+
permalink: /feed/links/
|
3
|
+
title: Linkpost Feed
|
4
|
+
feed: linkposts
|
5
|
+
---
|
6
|
+
{% if theme.feeds.linkpost_feed %}
|
7
|
+
{% include theme:feed/head.xml last_post=site.linkposts.last %}
|
8
|
+
{% for post in site.linkposts limit:theme.feeds.count %}
|
9
|
+
<entry>
|
10
|
+
{% include theme:feed/entry.xml %}
|
11
|
+
</entry>
|
12
|
+
{% endfor %}
|
13
|
+
</feed>
|
14
|
+
{% else %}{% abort %}{% endif %}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
---
|
2
|
+
permalink: /feed/
|
3
|
+
title: Main Feed
|
4
|
+
feed: posts
|
5
|
+
---
|
6
|
+
{% include theme:feed/head.xml last_post = site.posts.last %}
|
7
|
+
{% for post in site.posts limit:theme.feeds.count %}
|
8
|
+
<entry>
|
9
|
+
{% include theme:feed/entry.xml %}
|
10
|
+
</entry>
|
11
|
+
{% endfor %}
|
12
|
+
</feed>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# Settings for main header
|
2
|
-
header:
|
3
|
-
title: My Octopress Blog
|
4
|
-
|
5
|
-
# Links for main navigation
|
6
|
-
nav:
|
7
|
-
- { url: '/', title: 'Posts' }
|
8
|
-
- { url: '/archive', title: 'Archive' }
|
9
|
-
- { url: '/feed', title: 'RSS' }
|
10
|
-
|
11
|
-
# Settings for category index generator
|
12
|
-
category:
|
13
|
-
prefix: Category
|
14
|
-
url: category
|
15
|
-
|
16
|
-
post_index:
|
17
|
-
excerpt_posts: true
|
18
|
-
|
19
|
-
center-headings: true
|
@@ -3,11 +3,12 @@ layout: theme:post
|
|
3
3
|
title: "Dang That Was Fast"
|
4
4
|
date: 2014-08-03T23:18:12-05:00
|
5
5
|
categories:
|
6
|
-
- '
|
7
|
-
- '
|
6
|
+
- 'test'
|
7
|
+
- 'news'
|
8
8
|
title-graphic: /images/panorama.jpg
|
9
9
|
class: light-title
|
10
10
|
subtitle: But was it? Was it really?
|
11
|
+
external-url: http://timecube.com
|
11
12
|
---
|
12
13
|
|
13
14
|
**The quick**, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack.
|
data/lib/octopress-genesis.rb
CHANGED
@@ -41,14 +41,33 @@ module Jekyll
|
|
41
41
|
self.data = layout.data
|
42
42
|
self.data['category'] = category
|
43
43
|
# Set the title for this page.
|
44
|
-
|
45
|
-
self.data['title'] = "#{@config['prefix']}: #{category}"
|
44
|
+
self.data['title'] = "#{@config['title']}: #{category}"
|
46
45
|
# Set the meta-description for this page.
|
47
|
-
self.data['description'] = "#{
|
46
|
+
self.data['description'] = "#{@config['title']}: #{category}"
|
48
47
|
end
|
49
48
|
|
50
49
|
end
|
51
50
|
|
51
|
+
# The CategoryFeed class creates an Atom feed for the specified category.
|
52
|
+
class CategoryFeed < CategoryIndex
|
53
|
+
|
54
|
+
# Initializes a new CategoryFeed.
|
55
|
+
#
|
56
|
+
# +base+ is the String path to the <source>.
|
57
|
+
# +category_dir+ is the String path between <source> and the category folder.
|
58
|
+
# +category+ is the category currently being processed.
|
59
|
+
def initialize(site, base, category_dir, category)
|
60
|
+
super
|
61
|
+
@name = 'index.xml'
|
62
|
+
self.process(@name)
|
63
|
+
layout = @site.layouts['theme:category-feed']
|
64
|
+
self.content = layout.content
|
65
|
+
self.data = layout.data
|
66
|
+
self.data['category'] = category
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
52
71
|
# The Site class is a built-in Jekyll class with access to global site config information.
|
53
72
|
class Site
|
54
73
|
|
@@ -66,29 +85,28 @@ module Jekyll
|
|
66
85
|
|
67
86
|
end
|
68
87
|
|
88
|
+
# write
|
89
|
+
def write_category_feed(category_dir, category)
|
90
|
+
# Create an Atom-feed for each index.
|
91
|
+
feed = CategoryFeed.new(self, self.source, File.join(category_dir,'feed'), category)
|
92
|
+
feed.render(self.layouts, site_payload)
|
93
|
+
feed.write(self.dest)
|
94
|
+
# Record the fact that this page has been added, otherwise Site::cleanup will remove it.
|
95
|
+
self.pages << feed
|
96
|
+
end
|
97
|
+
|
69
98
|
# Loops through the list of category pages and processes each one.
|
70
99
|
def write_category_indexes
|
71
100
|
if self.layouts.key? 'theme:category-index'
|
72
101
|
config = Octopress::Ink::Plugins.config['theme']['category']
|
73
|
-
|
102
|
+
slug = config['dir']
|
103
|
+
feeds = config['feeds']
|
74
104
|
self.categories.keys.each do |category|
|
75
|
-
self.write_category_index(File.join(
|
105
|
+
self.write_category_index(File.join(slug, category), category) if slug
|
106
|
+
self.write_category_feed(File.join(slug, category), category) if feeds && feeds.include?(category)
|
76
107
|
end
|
77
|
-
|
78
|
-
# Throw an exception if the layout couldn't be found.
|
79
|
-
else
|
80
|
-
raise <<-ERR
|
81
|
-
|
82
|
-
|
83
|
-
===============================================
|
84
|
-
Error for category_generator.rb plugin
|
85
|
-
-----------------------------------------------
|
86
|
-
No 'category_index.html' in source/_layouts/
|
87
|
-
Perhaps you haven't installed a theme yet.
|
88
|
-
===============================================
|
89
|
-
|
90
|
-
ERR
|
91
108
|
end
|
109
|
+
|
92
110
|
end
|
93
111
|
|
94
112
|
end
|
@@ -138,8 +156,10 @@ ERR
|
|
138
156
|
def category_link(category)
|
139
157
|
dir = @context.registers[:site].config['category_dir']
|
140
158
|
# TODO: URLize categories
|
141
|
-
|
142
|
-
|
159
|
+
slug = File.join('/',
|
160
|
+
Octopress::Ink::Plugins.config['theme']['category']['dir'],
|
161
|
+
sluggify(category))
|
162
|
+
"<a class='category' href='#{slug}/'>#{category}</a>"
|
143
163
|
end
|
144
164
|
|
145
165
|
# returns a string which is ready for urlizing.
|
data/octopress-genesis.gemspec
CHANGED
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_runtime_dependency "octopress-date-format", "~> 2.0"
|
24
24
|
spec.add_runtime_dependency "octopress-autoprefixer", "~> 1.0"
|
25
25
|
spec.add_runtime_dependency "octopress-wrap-tag", "~> 1.0"
|
26
|
+
spec.add_runtime_dependency "octopress-abort-tag", "~> 1.0"
|
26
27
|
spec.add_runtime_dependency "octopress-assign-tag", "~> 1.0"
|
27
28
|
spec.add_runtime_dependency "octopress-filter-tag", "~> 1.0"
|
28
29
|
spec.add_runtime_dependency "octopress-comment-tag", "~> 1.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-genesis-theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octopress-ink
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: octopress-abort-tag
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: octopress-assign-tag
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -234,22 +248,30 @@ files:
|
|
234
248
|
- Rakefile
|
235
249
|
- assets/config.yml
|
236
250
|
- assets/includes/archive-post.html
|
251
|
+
- assets/includes/feed/entry.xml
|
252
|
+
- assets/includes/feed/head.xml
|
237
253
|
- assets/includes/head.html
|
238
254
|
- assets/includes/index-post.html
|
239
255
|
- assets/includes/post-nav.html
|
240
256
|
- assets/includes/primary-nav.html
|
257
|
+
- assets/includes/search/duckduckgo.html
|
258
|
+
- assets/includes/search/google.html
|
241
259
|
- assets/includes/site-footer.html
|
242
260
|
- assets/includes/site-header.html
|
243
261
|
- assets/includes/social/page-header.html
|
244
262
|
- assets/includes/social/post-footer.html
|
245
263
|
- assets/includes/social/post-header.html
|
246
264
|
- assets/layouts/base.html
|
265
|
+
- assets/layouts/category-feed.html
|
247
266
|
- assets/layouts/category-index.html
|
248
267
|
- assets/layouts/default.html
|
249
268
|
- assets/layouts/page.html
|
250
269
|
- assets/layouts/paginated-posts.html
|
251
270
|
- assets/layouts/post.html
|
252
271
|
- assets/pages/archive.html
|
272
|
+
- assets/pages/feed-articles.xml
|
273
|
+
- assets/pages/feed-links.xml
|
274
|
+
- assets/pages/feed.xml
|
253
275
|
- assets/pages/index.html
|
254
276
|
- assets/stylesheets/_colors.scss
|
255
277
|
- assets/stylesheets/_entry.scss
|