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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d44474e2d922073c99ef5837f3d6a516ce9116fa
4
- data.tar.gz: 9b74336892b62ea103047bb62f71e373b4099414
3
+ metadata.gz: 32d5f7e9176584bfaa80812d9fb84ad4bb6be3dc
4
+ data.tar.gz: cb5829a501b655dac1f4a24c4039b91111100192
5
5
  SHA512:
6
- metadata.gz: 4c8e7718cf9bf8b7ee291af3a82e8b6fe76f981cef5fd1f19dfdf729d8a35d8b64230ce2c5ec553847d74796158d66ddcfcc85493567ecc126706b9c5d2c5ebe
7
- data.tar.gz: b54e9dc8daca7c709576a228d7160c182cfa804a73e359b0c6897b6ba81c0fd3b16036ad9fb3ae072ddfab2978d5ebd8048edb6be123614e656b7bc8b24a03ed
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: A clever subtitle (optional)
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 index generator
12
+ # Settings for category generator
13
13
  category:
14
- prefix: Category
15
- url: category
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
- excerpt_posts: true
28
+ excerpt_articles: true
19
29
  permalink_label: "Permalink"
20
30
  read_more_label: "Continue Reading →"
21
31
 
22
- center-headings: true
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 &rarr;</a></p>
22
+ {% endif %}
23
+ {% else %}
24
+ {{ post.content | full_urls }}
25
+ {% if post.linkpost %}
26
+ <p><a href="{{ post.url | full_url }}">&infin; 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.post_index.excerpt_posts ? post.excerpt : post.content) %}
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.post_index.read_more_label : theme.post_index.permalink_label) %}
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,4 @@
1
+ <form class='site-search' action="http://www.duckduckgo.com/" method="get">
2
+ <input type="hidden" name="sites" value="{{ site.url | strip_url_protocol }}">
3
+ <input class="search-input" type="text" name="q" results="0" placeholder="Search&hellip;" accesskey="/">
4
+ </form>
@@ -0,0 +1,4 @@
1
+ <form class='site-search' action="https://google.com/search" method="get">
2
+ <input type="hidden" name="q" value="site:{{ site.url | strip_url_protocol }}">
3
+ <input class="search-input" type="text" name="q" results="0" placeholder="Search&hellip;" accesskey="/">
4
+ </form>
@@ -9,4 +9,6 @@
9
9
  {% endfor %}
10
10
  </nav>
11
11
  {% endif %}
12
+ {% capture search_template %}theme:search/{{ theme.search }}.html{% endcapture %}
13
+ {% include search_template %}
12
14
  </footer>
@@ -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
- - 'hi'
7
- - 'guys'
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.
@@ -4,6 +4,7 @@ require 'octopress-autoprefixer'
4
4
  require 'octopress-date-format'
5
5
  require 'octopress-comment-tag'
6
6
  require 'octopress-wrap-tag'
7
+ require 'octopress-abort-tag'
7
8
  require 'octopress-assign-tag'
8
9
  require 'octopress-return-tag'
9
10
  require 'octopress-include-tag'
@@ -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
- prefix = 'Category'
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'] = "#{prefix}: #{category}"
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
- url = config['url']
102
+ slug = config['dir']
103
+ feeds = config['feeds']
74
104
  self.categories.keys.each do |category|
75
- self.write_category_index(File.join(url, category), category) if url
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
- url = File.join('/', Octopress::Ink::Plugins.config['theme']['category']['url'], sluggify(category))
142
- "<a class='category' href='#{url}/'>#{category}</a>"
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.
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Genesis
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -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.2
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-08-31 00:00:00.000000000 Z
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