octopress-feeds 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0db3234960909184d71e4d5eb1d63e5059c1625
4
- data.tar.gz: 1a62792d466da0391b97962eeb681796e982b8da
3
+ metadata.gz: a967ab2b1b0362bd7c24d6c73d258e2211f9bf02
4
+ data.tar.gz: da93c88384ce140e93a74ab822f13e65b97a4f7a
5
5
  SHA512:
6
- metadata.gz: e17f533d1c37a0ad2d33b4d9e841999f453bc083f9deec84e2d7d237bdf439cf77430757eb4685784df1ae9f42f29607c3666beb7da1d36c1c6f1c480552fe42
7
- data.tar.gz: 7acce84984e6b277a5e23be6d244acbc37718576306f22ef58e4359cd9d1f1e5af403e194853189700c7e66f79632940d91826a23b96080834fb919fd8d45478
6
+ metadata.gz: d37e03cb7566d270d5efbaa940163b32e3d9844d318f3cad2c528dc875485da0153d71ff72712c716e44b52c08d644ebef70596943cd8d316e7c8aee4171a3ab
7
+ data.tar.gz: 990f1bb81175708a759f3a7a053dd287d2ac6ea384e50fcbc0c499eb9877a3d02fee8ae910021fb21db73b8fe13181bfe491b6b568bf0e2e1cf504bc104de99c
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ ### 1.1.0 (2015-01-06)
4
+
5
+ - Updated dependencies
6
+ - Fix: Works with new octopress-date-format
7
+ - Fix: Works with octopress-linkblog (optionally)
8
+
9
+ ### 1.0.0 (2014-06-09)
10
+
11
+ - Initial release
data/README.md CHANGED
@@ -4,34 +4,35 @@ Add nice RSS feeds to Octopress and Jekyll sites. Supports a standard feed, an a
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
7
+ Using Bundler:
8
8
 
9
- gem 'octopress-feed'
9
+ Add this gem to your site's Gemfile in the `:jekyll_plugins` group:
10
10
 
11
- And then execute:
11
+ group :jekyll_plugins do
12
+ gem 'octopress-feeds'
13
+ end
12
14
 
13
- $ bundle
15
+ Then install the gem with Bundler
14
16
 
15
- Or install it yourself as:
17
+ $ bundle
16
18
 
17
- $ gem install octopress-feed
19
+ Or install manually:
18
20
 
19
- ### Add gem to Jekyll
21
+ $ gem install octopress-feeds
20
22
 
21
- Add the gem to Jekyll's configuration file:
23
+ Then add the gem to your Jekyll configuration.
22
24
 
23
- ```yaml
24
- gems:
25
- - octopress-feed
26
- ```
25
+ gems:
26
+ -octopress-feeds
27
27
 
28
28
  ## Usage
29
29
 
30
- Be sure your Jekyll configuration has a `url`, a `title`, and an `author`.
30
+ Be sure your Jekyll configuration has a `url`, a `name` and an `author`. If you want your feed to have linkblogging features, be sure
31
+ to install [Octopress Linkblog](https://github.com/octopress/linkblog).
31
32
 
32
33
  ```yaml
33
34
  url: http://yoursite.com/
34
- title: My Awesome Site
35
+ name: My Awesome Site
35
36
  author: Guy McDude
36
37
  ```
37
38
 
@@ -103,7 +104,7 @@ This will create a configuration file populated with the defaults for this plugi
103
104
 
104
105
  ## Contributing
105
106
 
106
- 1. Fork it ( https://github.com/octopress/feed/fork )
107
+ 1. Fork it ( https://github.com/octopress/feeds/fork )
107
108
  2. Create your feature branch (`git checkout -b my-new-feature`)
108
109
  3. Commit your changes (`git commit -am 'Add some feature'`)
109
110
  4. Push to the branch (`git push origin my-new-feature`)
@@ -1,4 +1,4 @@
1
- <title type="html">{{ post.title_text }}</title>
1
+ <title type="html">{% return post.title_text || post.title %}</title>
2
2
  {% if post.linkpost and plugins.feeds.external_links %}
3
3
  <link rel="alternate" type="text/html" href="{{ post.external-url }}"/>
4
4
  <link rel="related" type="text/html" href="{{ post.url | full_url }}"/>
@@ -7,7 +7,7 @@
7
7
  {% endif %}
8
8
  <id>{{ post.id }}</id>
9
9
  <published>{{ post.date_xml }}</published>
10
- <updated>{% return post.updated_date_xml || post.date_xml %}</updated>
10
+ <updated>{% return post.date_updated_xml || post.date_xml %}</updated>
11
11
  <author>
12
12
  <name>{% return post.author || site.author %}</name>
13
13
  <uri>{% return post.author_site || site.url %}</uri>
@@ -3,7 +3,7 @@
3
3
  <title>{% return site.name || site.title %}</title>
4
4
  <link rel="alternate" type="text/html" href="{{ site.url }}/"/>
5
5
  <link rel="self" type="application/atom+xml" href="{{ page.url | remove:'index.xml' | full_url }}"/>
6
- <id>{{ url }}</id>
6
+ <id>{{ site.url }}</id>
7
7
  <updated>{% feed_updated_date %}</updated>
8
8
  <generator uri="http://octopress.org/">Octopress</generator>
9
9
  <rights>Copyright © {{ site.time | date: '%Y' }}, {{ site.author | strip_html }}</rights>
@@ -3,7 +3,7 @@ permalink: /feed/articles/
3
3
  title: Articles-only Feed
4
4
  feed: articles
5
5
  ---
6
- {% if plugins.feeds.articles_feed %}
6
+ {% if site.articles && plugins.feeds.articles_feed %}
7
7
  {% include feeds:head.xml %}
8
8
  {% for post in site.articles limit:plugins.feeds.count %}
9
9
  <entry>
@@ -3,7 +3,7 @@ permalink: /feed/links/
3
3
  title: Linkpost Feed
4
4
  feed: linkposts
5
5
  ---
6
- {% if plugins.feeds.linkposts_feed %}
6
+ {% if site.linkposts && plugins.feeds.linkposts_feed %}
7
7
  {% include feeds:head.xml %}
8
8
  {% for post in site.linkposts limit:plugins.feeds.count %}
9
9
  <entry>
@@ -1,7 +1,5 @@
1
1
  module Octopress
2
- module Ink
3
- module Feeds
4
- VERSION = "1.0.0"
5
- end
2
+ module Feeds
3
+ VERSION = "1.1.0"
6
4
  end
7
5
  end
@@ -1,55 +1,52 @@
1
1
  require 'octopress-feeds/version'
2
2
  require 'octopress-ink'
3
+ require 'octopress-include-tag'
4
+ require 'octopress-abort-tag'
5
+ require 'octopress-return-tag'
6
+ require 'octopress-date-format'
3
7
 
4
- Octopress::Ink.add_plugin({
5
- name: "Octopress Feeds",
6
- slug: "feeds",
7
- assets_path: File.expand_path(File.join(File.dirname(__FILE__), "../assets")),
8
- type: "plugin",
9
- version: Octopress::Ink::Feeds::VERSION,
10
- description: "A nice RSS feed for Octopress and Jekyll sites.",
11
- website: "https://github.com/octopress/feeds"
12
- })
8
+ begin
9
+ require 'octopress-linkblog'
10
+ rescue LoadError; end
13
11
 
14
12
  module Octopress
15
- module Ink
16
- module Tags
17
- class FeedTag < Liquid::Tag
18
- def render(context)
19
- tags = []
20
-
21
- Ink.plugin('feeds').pages.dup.map do |p|
22
- if p.filename == 'main-feed.xml' && !p.disabled?
23
- tag(p.page)
24
- end
13
+ module Feeds
14
+ class FeedTag < Liquid::Tag
15
+ def render(context)
16
+ tags = []
17
+
18
+ Ink.plugin('feeds').pages.dup.map do |p|
19
+ if p.filename == 'main-feed.xml' && !p.disabled?
20
+ tag(p.page)
25
21
  end
26
22
  end
23
+ end
27
24
 
28
- def tag(page)
29
- url = page.url.sub(/index\.xml/, '')
30
- "<link href='#{url}' rel='alternate' title='#{page.data['title']}: #{Ink.site.config['name']}' type='application/atom+xml'>"
31
- end
25
+ def tag(page)
26
+ url = page.url.sub(/index\.xml/, '')
27
+ "<link href='#{url}' rel='alternate' title='#{page.data['title']}: #{Octopress.site.config['name']}' type='application/atom+xml'>"
32
28
  end
29
+ end
33
30
 
34
- class FeedUpdatedTag < Liquid::Tag
35
- def render(context)
36
- feed = context.environments.first['page']['feed'] || 'posts'
37
-
38
- case feed
39
- when 'articles'
40
- post = Ink.articles.last
41
- when 'linkposts'
42
- post = Ink.linkposts.last
43
- else
44
- post = Ink.site.posts.last
45
- end
46
-
47
- if post.data['updated']
48
- post.data['updated_date_xml']
49
- else
50
- post.data['date_xml']
51
- end
31
+ class FeedUpdatedTag < Liquid::Tag
32
+ def render(context)
33
+ feed = context.environments.first['page']['feed'] || 'posts'
34
+ site = context.environments.first['site']
35
+
36
+ case feed
37
+ when 'articles'
38
+ posts = site['articles']
39
+ when 'linkposts'
40
+ posts = site['linkposts']
41
+ else
42
+ posts = site['posts']
52
43
  end
44
+
45
+ post = posts.sort_by{ |p|
46
+ p.data['date_updated'] || p.data['date']
47
+ }.last
48
+
49
+ post.data['date_updated_xml'] || post.data['date_xml']
53
50
  end
54
51
  end
55
52
  end
@@ -57,6 +54,17 @@ end
57
54
 
58
55
 
59
56
 
60
- Liquid::Template.register_tag('feed_tag', Octopress::Ink::Tags::FeedTag)
61
- Liquid::Template.register_tag('feed_updated_date', Octopress::Ink::Tags::FeedUpdatedTag)
57
+ Liquid::Template.register_tag('feed_tag', Octopress::Feeds::FeedTag)
58
+ Liquid::Template.register_tag('feed_updated_date', Octopress::Feeds::FeedUpdatedTag)
59
+
60
+ Octopress::Ink.add_plugin({
61
+ name: "Octopress Feeds",
62
+ slug: "feeds",
63
+ gem: "octopress-feeds",
64
+ path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
65
+ type: "plugin",
66
+ version: Octopress::Feeds::VERSION,
67
+ description: "RSS feeds supporting link-blogging for Octopress and Jekyll sites.",
68
+ website: "https://github.com/octopress/feeds"
69
+ })
62
70
 
metadata CHANGED
@@ -1,15 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-feeds
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
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-06-09 00:00:00.000000000 Z
11
+ date: 2015-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: octopress-ink
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 1.0.0.rc
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.0.0.rc
27
+ - !ruby/object:Gem::Dependency
28
+ name: octopress-abort-tag
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: octopress-return-tag
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: octopress-date-format
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
13
69
  - !ruby/object:Gem::Dependency
14
70
  name: bundler
15
71
  requirement: !ruby/object:Gem::Requirement
@@ -53,19 +109,47 @@ dependencies:
53
109
  - !ruby/object:Gem::Version
54
110
  version: '0'
55
111
  - !ruby/object:Gem::Dependency
56
- name: octopress-ink
112
+ name: clash
57
113
  requirement: !ruby/object:Gem::Requirement
58
114
  requirements:
59
115
  - - ">="
60
116
  - !ruby/object:Gem::Version
61
- version: 1.0.0.rc.8
62
- type: :runtime
117
+ version: '0'
118
+ type: :development
63
119
  prerelease: false
64
120
  version_requirements: !ruby/object:Gem::Requirement
65
121
  requirements:
66
122
  - - ">="
67
123
  - !ruby/object:Gem::Version
68
- version: 1.0.0.rc.8
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: octopress-linkblog
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: pry-byebug
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
69
153
  description: A nice RSS feeds for Octopress and Jekyll sites.
70
154
  email:
71
155
  - brandon@imathis.com
@@ -73,12 +157,9 @@ executables: []
73
157
  extensions: []
74
158
  extra_rdoc_files: []
75
159
  files:
76
- - ".gitignore"
77
- - ".travis.yml"
78
- - Gemfile
160
+ - CHANGELOG.md
79
161
  - LICENSE.txt
80
162
  - README.md
81
- - Rakefile
82
163
  - assets/config.yml
83
164
  - assets/includes/entry.xml
84
165
  - assets/includes/head.xml
@@ -87,24 +168,6 @@ files:
87
168
  - assets/pages/main-feed.xml
88
169
  - lib/octopress-feeds.rb
89
170
  - lib/octopress-feeds/version.rb
90
- - octopress-feeds.gemspec
91
- - test/Gemfile
92
- - test/_config.yml
93
- - test/_expected/2014/05/26/awesome-link.html
94
- - test/_expected/2014/05/26/some-great-post-idea.html
95
- - test/_expected/feed/articles/index.xml
96
- - test/_expected/feed/index.xml
97
- - test/_expected/feed/links/index.xml
98
- - test/_includes/head.html
99
- - test/_layouts/post.html
100
- - test/_octopress.yml
101
- - test/_plugins/feeds/config.yml
102
- - test/_posts/2014-05-26-some-great-post-idea.markdown
103
- - test/_posts/2014-05-27-awesome-link.markdown
104
- - test/_templates/page
105
- - test/_templates/post
106
- - test/test.rb
107
- - test/test_suite.rb
108
171
  homepage: https://github.com/octopress/feeds
109
172
  licenses:
110
173
  - MIT
@@ -129,21 +192,4 @@ rubygems_version: 2.2.2
129
192
  signing_key:
130
193
  specification_version: 4
131
194
  summary: A nice RSS feeds for Octopress and Jekyll sites.
132
- test_files:
133
- - test/Gemfile
134
- - test/_config.yml
135
- - test/_expected/2014/05/26/awesome-link.html
136
- - test/_expected/2014/05/26/some-great-post-idea.html
137
- - test/_expected/feed/articles/index.xml
138
- - test/_expected/feed/index.xml
139
- - test/_expected/feed/links/index.xml
140
- - test/_includes/head.html
141
- - test/_layouts/post.html
142
- - test/_octopress.yml
143
- - test/_plugins/feeds/config.yml
144
- - test/_posts/2014-05-26-some-great-post-idea.markdown
145
- - test/_posts/2014-05-27-awesome-link.markdown
146
- - test/_templates/page
147
- - test/_templates/post
148
- - test/test.rb
149
- - test/test_suite.rb
195
+ test_files: []
data/.gitignore DELETED
@@ -1,23 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- *.bundle
19
- *.so
20
- *.o
21
- *.a
22
- mkmf.log
23
- _site
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.0.0
4
- - 1.9.3
5
- script: cd test && bundle exec ruby test.rb
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in octopress_feed.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,2 +0,0 @@
1
- require "bundler/gem_tasks"
2
-
@@ -1,26 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'octopress-feeds/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "octopress-feeds"
8
- spec.version = Octopress::Ink::Feeds::VERSION
9
- spec.authors = ["Brandon Mathis"]
10
- spec.email = ["brandon@imathis.com"]
11
- spec.summary = %q{A nice RSS feeds for Octopress and Jekyll sites.}
12
- spec.description = %q{A nice RSS feeds for Octopress and Jekyll sites.}
13
- spec.homepage = "https://github.com/octopress/feeds"
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_development_dependency "bundler", "~> 1.6"
22
- spec.add_development_dependency "rake"
23
- spec.add_development_dependency "octopress"
24
-
25
- spec.add_runtime_dependency "octopress-ink", ">= 1.0.0.rc.8"
26
- end
data/test/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- group :octopress do
4
- gem 'octopress'
5
- gem 'pry-debugger'
6
- gem 'octopress-ink', path: '../../ink'
7
- gem 'octopress-feeds', path: '../'
8
- end
data/test/_config.yml DELETED
@@ -1,9 +0,0 @@
1
- exclude:
2
- - Gemfile*
3
- - test*.rb
4
- gems:
5
- - octopress-feeds
6
- url: http://octopress.org/
7
- author: Bob McDiggity
8
- title: Some awesome Jekyll site
9
- timezone: America/Chicago
@@ -1,3 +0,0 @@
1
- <head><link href='http://octopress.org/feed/' rel='alternate' title='Main Feed: Some awesome Jekyll site' type='application/atom+xml'></head>
2
- <p>This contains all knowledge.</p>
3
-
@@ -1,3 +0,0 @@
1
- <head><link href='http://octopress.org/feed/' rel='alternate' title='Main Feed: Some awesome Jekyll site' type='application/atom+xml'></head>
2
- <p>totally sweet stuff.</p>
3
-
@@ -1,36 +0,0 @@
1
-
2
- <?xml version="1.0" encoding="utf-8"?>
3
- <feed xmlns="http://www.w3.org/2005/Atom">
4
- <title>Some awesome Jekyll site</title>
5
- <link rel="alternate" type="text/html" href="http://octopress.org//"/>
6
- <link rel="self" type="application/atom+xml" href="http://octopress.org/feed/articles/"/>
7
- <id></id>
8
- <updated>2014-05-26T22:29:13-05:00</updated>
9
- <generator uri="http://octopress.org/">Octopress</generator>
10
- <rights>Copyright © 2014, Bob McDiggity</rights>
11
-
12
- <entry>
13
- <title type="html">Some Great Post Idea</title>
14
-
15
- <link rel="alternate" type="text/html" href="http://octopress.org/2014/05/26/some-great-post-idea.html"/>
16
-
17
- <id>/2014/05/26/some-great-post-idea</id>
18
- <published>2014-05-26T22:29:13-05:00</published>
19
- <updated>2014-05-26T22:29:13-05:00</updated>
20
- <author>
21
- <name>Bob McDiggity</name>
22
- <uri>http://octopress.org/</uri>
23
- </author>
24
- <content type="html" xml:base="http://octopress.org/" xml:lang="en">
25
- <![CDATA[
26
-
27
- <p>totally sweet stuff.</p>
28
-
29
-
30
-
31
- ]]>
32
- </content>
33
- </entry>
34
-
35
- </feed>
36
-
@@ -1,60 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <feed xmlns="http://www.w3.org/2005/Atom">
3
- <title>Some awesome Jekyll site</title>
4
- <link rel="alternate" type="text/html" href="http://octopress.org//"/>
5
- <link rel="self" type="application/atom+xml" href="http://octopress.org/feed/"/>
6
- <id></id>
7
- <updated>2014-06-01T22:45:41-05:00</updated>
8
- <generator uri="http://octopress.org/">Octopress</generator>
9
- <rights>Copyright © 2014, Bob McDiggity</rights>
10
-
11
- <entry>
12
- <title type="html">Awesome Link →</title>
13
-
14
- <link rel="alternate" type="text/html" href="http://timecube.com"/>
15
- <link rel="related" type="text/html" href="http://octopress.org/2014/05/26/awesome-link.html"/>
16
-
17
- <id>/2014/05/26/awesome-link</id>
18
- <published>2014-05-26T22:45:41-05:00</published>
19
- <updated>2014-06-01T22:45:41-05:00</updated>
20
- <author>
21
- <name>Bob McDiggity</name>
22
- <uri>http://octopress.org/</uri>
23
- </author>
24
- <content type="html" xml:base="http://octopress.org/" xml:lang="en">
25
- <![CDATA[
26
-
27
- <p>This contains all knowledge.</p>
28
-
29
-
30
- <p><a href="http://octopress.org/2014/05/26/awesome-link.html">&infin; Permalink</a></p>
31
-
32
-
33
- ]]>
34
- </content>
35
- </entry>
36
-
37
- <entry>
38
- <title type="html">Some Great Post Idea</title>
39
-
40
- <link rel="alternate" type="text/html" href="http://octopress.org/2014/05/26/some-great-post-idea.html"/>
41
-
42
- <id>/2014/05/26/some-great-post-idea</id>
43
- <published>2014-05-26T22:29:13-05:00</published>
44
- <updated>2014-05-26T22:29:13-05:00</updated>
45
- <author>
46
- <name>Bob McDiggity</name>
47
- <uri>http://octopress.org/</uri>
48
- </author>
49
- <content type="html" xml:base="http://octopress.org/" xml:lang="en">
50
- <![CDATA[
51
-
52
- <p>totally sweet stuff.</p>
53
-
54
-
55
-
56
- ]]>
57
- </content>
58
- </entry>
59
-
60
- </feed>
@@ -1,39 +0,0 @@
1
-
2
- <?xml version="1.0" encoding="utf-8"?>
3
- <feed xmlns="http://www.w3.org/2005/Atom">
4
- <title>Some awesome Jekyll site</title>
5
- <link rel="alternate" type="text/html" href="http://octopress.org//"/>
6
- <link rel="self" type="application/atom+xml" href="http://octopress.org/feed/links/"/>
7
- <id></id>
8
- <updated>2014-06-01T22:45:41-05:00</updated>
9
- <generator uri="http://octopress.org/">Octopress</generator>
10
- <rights>Copyright © 2014, Bob McDiggity</rights>
11
-
12
- <entry>
13
- <title type="html">Awesome Link →</title>
14
-
15
- <link rel="alternate" type="text/html" href="http://timecube.com"/>
16
- <link rel="related" type="text/html" href="http://octopress.org/2014/05/26/awesome-link.html"/>
17
-
18
- <id>/2014/05/26/awesome-link</id>
19
- <published>2014-05-26T22:45:41-05:00</published>
20
- <updated>2014-06-01T22:45:41-05:00</updated>
21
- <author>
22
- <name>Bob McDiggity</name>
23
- <uri>http://octopress.org/</uri>
24
- </author>
25
- <content type="html" xml:base="http://octopress.org/" xml:lang="en">
26
- <![CDATA[
27
-
28
- <p>This contains all knowledge.</p>
29
-
30
-
31
- <p><a href="http://octopress.org/2014/05/26/awesome-link.html">&infin; Permalink</a></p>
32
-
33
-
34
- ]]>
35
- </content>
36
- </entry>
37
-
38
- </feed>
39
-
@@ -1 +0,0 @@
1
- <head>{% feed_tag %}</head>
@@ -1,2 +0,0 @@
1
- {% include 'head.html' | full_urls %}
2
- {{ content }}
data/test/_octopress.yml DELETED
@@ -1,11 +0,0 @@
1
- # Default extension for new posts and pages
2
- post_ext: markdown
3
- page_ext: html
4
-
5
- # Default templates for posts and pages
6
- # Found in _templates/
7
- post_layout: post
8
- page_layout: page
9
-
10
- # Format titles with titlecase?
11
- titlecase: true
@@ -1,3 +0,0 @@
1
- articles_feed: true
2
- linkposts_feed: true
3
-
@@ -1,6 +0,0 @@
1
- ---
2
- layout: post
3
- title: "Some Great Post Idea"
4
- date: 2014-05-26T22:29:13-05:00
5
- ---
6
- totally sweet stuff.
@@ -1,9 +0,0 @@
1
- ---
2
- layout: post
3
- title: "Awesome Link"
4
- date: 2014-05-26T22:45:41-05:00
5
- external-url: http://timecube.com
6
- updated: 2014-06-01T22:45:41-05:00
7
- ---
8
-
9
- This contains all knowledge.
data/test/_templates/page DELETED
@@ -1,4 +0,0 @@
1
- ---
2
- layout: {{ layout }}
3
- title: {{ title }}
4
- ---
data/test/_templates/post DELETED
@@ -1,5 +0,0 @@
1
- ---
2
- layout: {{ layout }}
3
- title: {{ title }}
4
- date: {{ date }}
5
- ---
data/test/test.rb DELETED
@@ -1,8 +0,0 @@
1
- require './test_suite'
2
- ENV['JEKYLL_ENV'] = 'test'
3
-
4
- @failures = []
5
- build
6
- test_dirs('Site build', '_site', '_expected')
7
-
8
- print_results
data/test/test_suite.rb DELETED
@@ -1,182 +0,0 @@
1
- require 'colorator'
2
- require 'find'
3
-
4
- # This is a makeshift integration test-suite.
5
- # It is unapologetically pragmatic.
6
-
7
-
8
- # Build Jekyll
9
- #
10
- def build(options={})
11
- config = ['_config.yml'] << options[:config]
12
-
13
- if options[:config]
14
- options[:config].each do |name, file|
15
- case name
16
- when :jekyll
17
- config << "_configs/#{file}"
18
- when :octopress
19
- FileUtils.cp "_configs/#{file}", "_octopress.yml"
20
- else
21
- FileUtils.cp "_configs/#{file}", "_plugins/#{name}/config.yml"
22
- end
23
- end
24
- end
25
-
26
- cmd = "rm -rf site && bundle exec jekyll build --config #{config.join(',')}"
27
-
28
- `#{cmd}`
29
-
30
- if options[:config]
31
- options[:config].each do |name, file|
32
- case name
33
- when :jekyll
34
- next
35
- when :octopress
36
- `rm _octopress.yml`
37
- else
38
- `rm _plugins/#{name}/config.yml`
39
- end
40
- end
41
- end
42
- end
43
-
44
-
45
- # Find all files in a given directory
46
- #
47
- def dir_files(dir)
48
- Find.find(dir).to_a.reject!{|f| File.directory?(f) }
49
- end
50
-
51
- # Recursively diff two directories
52
- #
53
- # This will walk through dir1 and diff matching paths in dir2
54
- #
55
- def test_dirs(desc, dir1, dir2)
56
-
57
- test_missing_files(desc, dir1, dir2)
58
-
59
- dir_files(dir1).each do |file|
60
- file2 = file.sub(dir1, dir2)
61
- if File.exist?(file2)
62
- if diff = diff_file(file, file2)
63
- @failures << {
64
- desc: "#{desc}\nDiff of file: #{file.sub(dir1+'/', '')}\n",
65
- result: format_diff(diff)
66
- }
67
- pout 'F'.red
68
- else
69
- pout '.'.green
70
- end
71
- end
72
- end
73
- end
74
-
75
- def format_diff(diff)
76
- "#{diff.gsub(/\A.+?\n/,'').gsub(/^[^><].+/,'---').gsub(/^>.+/){|m|
77
- m.green
78
- }.gsub(/^(<.+?)$/){ |m|
79
- m.red
80
- }}"
81
- end
82
-
83
- # List differences between files in two directories
84
- #
85
- def test_missing_files(desc, dir1, dir2)
86
- files1 = dir_files(dir1).map {|f| f.sub(dir1,'') }
87
- files2 = dir_files(dir2).map {|f| f.sub(dir2,'') }
88
-
89
- missing = []
90
-
91
- (files2 - files1).each do |file|
92
- missing << File.join(dir1, file)
93
- end
94
-
95
- (files1 - files2).each do |file|
96
- missing << File.join(dir2, file)
97
- end
98
-
99
- if !missing.empty?
100
- @failures << {
101
- desc: "#{desc}\nMissing files:\n",
102
- result: " - " + missing.join("\n - ")
103
- }
104
-
105
- pout 'F'.red
106
- else
107
- pout '.'.green
108
- end
109
- end
110
-
111
- # Diff two files
112
- #
113
- def diff_file(file1, file2)
114
- diff = `diff #{file1} #{file2}`
115
- if diff.size > 0
116
- diff
117
- else
118
- false
119
- end
120
- end
121
-
122
- # Test command output
123
- #
124
- # Input: options hash, format:
125
- # {
126
- # desc: description of task
127
- # cmd: system command to be run, (String or Array)
128
- # expect: expected output from command
129
- # }
130
- #
131
- def test_cmd(options)
132
- if cmd = options[:cmd]
133
- cmd = [cmd] unless cmd.is_a? Array
134
-
135
- # In debug mode command output is printed
136
- #
137
- if options[:debug]
138
- system cmd.join('; ')
139
- else
140
- output = `#{cmd.join('; ')}`.gsub(/#{Dir.pwd}\/*/,'').strip
141
-
142
- # Remove character color codes
143
- output = output.gsub("\e",'').gsub(/\[\d+m/,'').gsub("\[0m",'')
144
- end
145
- if options[:expect] && options[:expect].strip == output
146
- pout '.'.green
147
- elsif options[:expect]
148
- pout 'F'.red
149
- @failures << {
150
- desc: options[:desc]+"\n",
151
- result: <<-HERE
152
- expected: #{(options[:expect] || '').strip.green}
153
- result: #{(output || '').strip.red}
154
- HERE
155
- }
156
- end
157
- end
158
- end
159
-
160
-
161
- # Print a single character without a newline
162
- #
163
- def pout(str)
164
- print str
165
- $stdout.flush
166
- end
167
-
168
- # Ouptut nicely formatted failure messages
169
- #
170
- def print_results
171
- if !@failures.empty?
172
- @failures.each do |test|
173
- pout "\nFailed: #{test[:desc]}"
174
- puts test[:result]
175
- # print a newline for easier reading
176
- puts ""
177
- end
178
- abort
179
- else
180
- puts "All passed!".green
181
- end
182
- end