jekyll-tagging 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.3.0 [2012-02-03]
2
+
3
+ * Feed per tag feature added.
4
+
1
5
  == 0.2.0 [2011-03-10]
2
6
 
3
7
  * Added support for pretty tag page URLs.
data/README.rdoc CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  By Arne Eilermann <mailto:eilermann@lavabit.com> and Jens Wille <mailto:jens.wille@uni-koeln.de>
4
4
 
5
- jekyll-tagging is a Jekyll plugin, to add a tag cloud and per tag pages to your Jekyll generated Website.
5
+ jekyll-tagging is a Jekyll plugin, to add a tag cloud and per tag pages plus feeds to your Jekyll generated Website.
6
6
 
7
7
  == Usage
8
8
 
9
9
  Install it:
10
10
 
11
- sudo gem install jekyll-tagging
11
+ gem install jekyll-tagging
12
12
 
13
13
  Add the following to your <tt>_plugins/ext.rb</tt> file:
14
14
 
@@ -21,6 +21,14 @@ And in your <tt>_config.yml</tt> you have to define your layout used to generate
21
21
 
22
22
  Now you got a new filter called <tt>tag_cloud</tt> which you can use with the <tt>site</tt> object as argument in your layout to get a cloud of all your site's tags. The tags are linked to their related tag page. Furthermore, you got a <tt>tags</tt> filter which you can feed withe a <tt>post</tt> or a <tt>site</tt> object to get a link list of all its tags.
23
23
 
24
+ You can optionally define a per tag Atom/RSS feed. In your <tt>_config.yml</tt> define the following:
25
+
26
+ tag_feed_layout: tag_feed
27
+ tag_feed_dir: tag
28
+
29
+ (<tt>tag_page_dir</tt> and <tt>tag_feed_dir</tt> can have the same value.)
30
+
31
+
24
32
  === Example tag page layout
25
33
 
26
34
  ---
@@ -36,11 +44,38 @@ Now you got a new filter called <tt>tag_cloud</tt> which you can use with the <t
36
44
  <div id="tag-cloud">
37
45
  {{ site | tag_cloud }}
38
46
  </div>
47
+
48
+
49
+ === Example layout of an Atom feed
50
+
51
+ ---
52
+ layout: nil
53
+ ---
54
+ <?xml version="1.0" encoding="utf-8"?>
55
+ <feed xmlns="http://www.w3.org/2005/Atom">
56
+ <title>Your Title - {{ page.tag }}</title>
57
+ <link href="http://example.com{{ page.url }}" rel="self"/>
58
+ <link href="http://example.com/tag/{{ page.tag }}.html"/>
59
+ <updated>{{ site.time | date_to_xmlschema }}</updated>
60
+ <id>http://example.com/tag/{{ page.tag }}.html</id>
61
+ <author>
62
+ <name>Author Here</name>
63
+ </author>
64
+ {% for post in page.posts %}
65
+ <entry>
66
+ <title>{{ post.title }}</title>
67
+ <link href="http://example.com{{ post.url }}"/>
68
+ <updated>{{ post.date | date_to_xmlschema }}</updated>
69
+ <id>http://example.com{{ post.id }}</id>
70
+ <content type="html">{{ post.content | xml_escape }}</content>
71
+ </entry>
72
+ {% endfor %}
73
+ </feed>
39
74
 
40
75
  == Links
41
76
 
42
77
  <b></b>
43
- Documentation:: <http://rdoc.info/github/pattex/jekyll-tagging>
78
+ Documentation:: <http://rubydoc.info/gems/jekyll-tagging/frames>
44
79
  Source code:: <http://github.com/pattex/jekyll-tagging>
45
80
  RubyGem:: <http://rubygems.org/gems/jekyll-tagging>
46
81
 
@@ -48,7 +83,8 @@ RubyGem:: <http://rubygems.org/gems/jekyll-tagging>
48
83
 
49
84
  === The MIT License
50
85
 
51
- Copyright (c) 2010 Arne Eilermann
86
+ Copyright (c) 2010-2011 University of Cologne,
87
+ Albertus-Magnus-Platz, 50923 Cologne, Germany
52
88
 
53
89
  Permission is hereby granted, free of charge, to any person obtaining a copy
54
90
  of this software and associated documentation files (the "Software"), to deal
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- require %q{lib/jekyll/tagging/version}
1
+ require File.expand_path(%q{../lib/jekyll/tagging/version}, __FILE__)
2
2
 
3
3
  begin
4
4
  require 'hen'
@@ -8,20 +8,16 @@ begin
8
8
  :name => %q{jekyll-tagging},
9
9
  :version => Jekyll::Tagging::VERSION,
10
10
  :summary => %q{Jekyll plugin to automatically generate a tag cloud and tag pages.},
11
- :files => FileList['lib/**/*.rb'].to_a,
12
- :extra_files => FileList['[A-Z]*'].to_a,
13
- :dependencies => %w[ruby-nuggets],
14
11
  :authors => ['Arne Eilermann', 'Jens Wille'],
15
12
  :email => ['eilermann@lavabit.com', 'jens.wille@uni-koeln.de'],
16
- :homepage => %q{http://github.com/pattex/jekyll-tagging}
13
+ :homepage => :pattex,
14
+ :dependencies => %w[ruby-nuggets]
17
15
  }
18
16
  }}
19
- rescue LoadError
20
- warn "Please install the `hen' gem."
17
+ rescue LoadError => err
18
+ warn "Please install the `hen' gem. (#{err})"
21
19
  end
22
20
 
23
- ### Place your custom Rake tasks here.
24
-
25
21
  begin
26
22
  require 'jekyll/testtasks/rake'
27
23
  rescue LoadError
@@ -8,11 +8,14 @@ module Jekyll
8
8
  safe true
9
9
 
10
10
  def generate(site)
11
- unless Tagger.const_defined?(:TAG_PAGE_DIR)
12
- Tagger.const_set('TAG_PAGE_DIR', site.config['tag_page_dir'] || 'tag')
11
+ %w[TAG_PAGE_DIR TAG_FEED_DIR].each do |dir_name|
12
+ unless Tagger.const_defined?(dir_name.to_sym)
13
+ Tagger.const_set(dir_name, site.config[dir_name.downcase] || 'tag')
14
+ end
13
15
  end
14
16
 
15
17
  @tag_page_layout = site.config['tag_page_layout']
18
+ @tag_feed_layout = site.config['tag_feed_layout']
16
19
 
17
20
  unless Jekyll::Filters.const_defined?(:PRETTY_URL)
18
21
  Jekyll::Filters.const_set('PRETTY_URL', site.permalink_style == :pretty)
@@ -21,8 +24,7 @@ module Jekyll
21
24
  if @tag_page_layout
22
25
  generate_tag_pages(site)
23
26
  else
24
- $stderr.puts 'WARNING: You have to define a tag_page_layout in ' +
25
- 'configuration file.'
27
+ warn 'WARNING: You have to define a tag_page_layout in configuration file.'
26
28
  end
27
29
 
28
30
  site.config.update({ 'tag_data' => calculate_tag_cloud(site) })
@@ -33,13 +35,16 @@ module Jekyll
33
35
  # to use this.
34
36
  def generate_tag_pages(site)
35
37
  site.tags.each { |tag, posts|
36
- site.pages << new_tag_page(site, site.source, TAG_PAGE_DIR, tag, posts.sort.reverse)
38
+ site.pages << new_tag(site, site.source, TAG_PAGE_DIR, tag, posts.sort.reverse, @tag_page_layout)
39
+ if @tag_feed_layout
40
+ site.pages << new_tag(site, site.source, TAG_FEED_DIR, tag, posts.sort.reverse, @tag_feed_layout)
41
+ end
37
42
  }
38
43
  end
39
44
 
40
- def new_tag_page(site, base, dir, tag, posts)
41
- TagPage.new(site, base, dir, "#{tag}.html", {
42
- 'layout' => @tag_page_layout,
45
+ def new_tag(site, base, dir, tag, posts, layout)
46
+ TagPage.new(site, base, dir, "#{tag}#{site.layouts[layout].ext}", {
47
+ 'layout' => layout,
43
48
  'posts' => posts,
44
49
  })
45
50
  end
@@ -5,7 +5,7 @@ module Jekyll
5
5
  module Version
6
6
 
7
7
  MAJOR = 0
8
- MINOR = 2
8
+ MINOR = 3
9
9
  TINY = 0
10
10
 
11
11
  class << self
metadata CHANGED
@@ -1,94 +1,72 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: jekyll-tagging
3
- version: !ruby/object:Gem::Version
4
- hash: 23
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 0
10
- version: 0.2.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Arne Eilermann
14
9
  - Jens Wille
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2011-03-10 00:00:00 +01:00
20
- default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
13
+ date: 2012-04-03 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
23
16
  name: ruby-nuggets
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &70196087414680 !ruby/object:Gem::Requirement
26
18
  none: false
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 3
31
- segments:
32
- - 0
33
- version: "0"
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
34
23
  type: :runtime
35
- version_requirements: *id001
24
+ prerelease: false
25
+ version_requirements: *70196087414680
36
26
  description: Jekyll plugin to automatically generate a tag cloud and tag pages.
37
- email:
27
+ email:
38
28
  - eilermann@lavabit.com
39
29
  - jens.wille@uni-koeln.de
40
30
  executables: []
41
-
42
31
  extensions: []
43
-
44
- extra_rdoc_files:
32
+ extra_rdoc_files:
45
33
  - ChangeLog
46
- files:
34
+ files:
47
35
  - lib/jekyll/tagging/version.rb
48
36
  - lib/jekyll/tagging.rb
49
37
  - ChangeLog
50
38
  - Rakefile
51
39
  - README.rdoc
52
- has_rdoc: true
53
40
  homepage: http://github.com/pattex/jekyll-tagging
54
41
  licenses: []
55
-
56
42
  post_install_message:
57
- rdoc_options:
58
- - --all
43
+ rdoc_options:
59
44
  - --charset
60
45
  - UTF-8
46
+ - --line-numbers
47
+ - --all
48
+ - --title
49
+ - jekyll-tagging Application documentation (v0.3.0)
61
50
  - --main
62
51
  - ChangeLog
63
- - --title
64
- - jekyll-tagging Application documentation (v0.2.0)
65
- - --line-numbers
66
- require_paths:
52
+ require_paths:
67
53
  - lib
68
- required_ruby_version: !ruby/object:Gem::Requirement
54
+ required_ruby_version: !ruby/object:Gem::Requirement
69
55
  none: false
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- hash: 3
74
- segments:
75
- - 0
76
- version: "0"
77
- required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
61
  none: false
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- hash: 3
83
- segments:
84
- - 0
85
- version: "0"
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
86
66
  requirements: []
87
-
88
67
  rubyforge_project:
89
- rubygems_version: 1.5.2
68
+ rubygems_version: 1.8.11
90
69
  signing_key:
91
70
  specification_version: 3
92
71
  summary: Jekyll plugin to automatically generate a tag cloud and tag pages.
93
72
  test_files: []
94
-