jekyll 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of jekyll might be problematic. Click here for more details.

@@ -1,4 +1,8 @@
1
- == 0.1.3 /
1
+ == 0.1.4 / 2008-12-08
2
+ * Bug Fixes
3
+ * DATA does not work properly with rubygems
4
+
5
+ == 0.1.3 / 2008-12-06
2
6
  * Major Features
3
7
  * Markdown support [github.com/vanpelt]
4
8
  * Mephisto and CSV converters [github.com/vanpelt]
@@ -50,7 +50,7 @@ And if you don't want to be in the proto site root to run Jekyll:
50
50
 
51
51
  $ jekyll /path/to/proto/site /path/to/place/generated/site
52
52
 
53
- The autobuid feature can be used on any of the invocations.
53
+ The autobuild feature can be used on any of the invocations.
54
54
 
55
55
  h2. Contribute
56
56
 
data/bin/jekyll CHANGED
@@ -2,13 +2,24 @@
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
4
4
 
5
+ help = <<HELP
6
+ Jekyll is a blog-aware, static site generator.
7
+
8
+ Basic Command Line Usage:
9
+ jekyll # . -> ./_site
10
+ jekyll <path to write generated site> # . -> <path>
11
+ jekyll <path to source> <path to write generated site> # <path> -> <path>
12
+
13
+ Options:
14
+ HELP
15
+
5
16
  require 'optparse'
6
17
  require 'jekyll'
7
18
 
8
19
  options = {}
9
20
 
10
21
  opts = OptionParser.new do |opts|
11
- opts.banner = DATA.read
22
+ opts.banner = help
12
23
 
13
24
  opts.on("--auto", "Auto-regenerate") do
14
25
  options[:auto] = true
@@ -67,14 +78,4 @@ if options[:auto]
67
78
  loop { sleep 1000 }
68
79
  else
69
80
  Jekyll.process(source, destination)
70
- end
71
-
72
- __END__
73
- Jekyll is a blog-aware, static site generator.
74
-
75
- Basic Command Line Usage:
76
- jekyll # . -> ./_site
77
- jekyll <path to write generated site> # . -> <path>
78
- jekyll <path to source> <path to write generated site> # <path> -> <path>
79
-
80
- Options:
81
+ end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{jekyll}
3
- s.version = "0.1.3"
3
+ s.version = "0.1.4"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Tom Preston-Werner"]
@@ -26,7 +26,7 @@ require 'jekyll/filters'
26
26
  require 'jekyll/blocks'
27
27
 
28
28
  module Jekyll
29
- VERSION = '0.1.3'
29
+ VERSION = '0.1.4'
30
30
 
31
31
  def self.process(source, dest)
32
32
  Jekyll::Site.new(source, dest).process
@@ -55,13 +55,27 @@ module Jekyll
55
55
  end
56
56
 
57
57
  # The generated directory into which the post will be placed
58
- # upon generation. e.g. "/2008/11/05/"
58
+ # upon generation. This is derived from the permalink or, if
59
+ # permalink is absent, set to the default date
60
+ # e.g. "/2008/11/05/"
59
61
  #
60
62
  # Returns <String>
61
63
  def dir
62
- self.date.strftime("/%Y/%m/%d/")
64
+ permalink ?
65
+ permalink.to_s.split("/")[0..-2].join("/") :
66
+ date.strftime("/%Y/%m/%d/")
63
67
  end
64
68
 
69
+ # The full path and filename of the post.
70
+ # Defined in the YAML of the post body
71
+ # (Optional)
72
+ #
73
+ # Returns <String>
74
+ def permalink
75
+ self.data && self.data['permalink']
76
+ end
77
+
78
+
65
79
  # The generated relative url of this post
66
80
  # e.g. /2008/11/05/my-awesome-post.html
67
81
  #
@@ -111,7 +125,7 @@ module Jekyll
111
125
  #
112
126
  # Returns nothing
113
127
  def write(dest)
114
- FileUtils.mkdir_p(File.join(dest, self.dir))
128
+ FileUtils.mkdir_p(File.join(dest, dir))
115
129
 
116
130
  path = File.join(dest, self.url)
117
131
  File.open(path, 'w') do |f|
@@ -26,6 +26,22 @@ class TestPost < Test::Unit::TestCase
26
26
  assert_equal "/2008/10/19/foo-bar.html", p.url
27
27
  end
28
28
 
29
+ def test_permalink
30
+ p = Post.allocate
31
+ p.process("2008-12-03-permalinked-post.textile")
32
+ p.read_yaml(File.join(File.dirname(__FILE__), *%w[source posts]), "2008-12-03-permalinked-post.textile")
33
+
34
+ assert_equal "my_category/permalinked-post", p.permalink
35
+ end
36
+
37
+ def test_dir_respects_permalink
38
+ p = Post.allocate
39
+ p.process("2008-12-03-permalinked-post.textile")
40
+ p.read_yaml(File.join(File.dirname(__FILE__), *%w[source posts]), "2008-12-03-permalinked-post.textile")
41
+
42
+ assert_equal "my_category", p.dir
43
+ end
44
+
29
45
  def test_read_yaml
30
46
  p = Post.allocate
31
47
  p.read_yaml(File.join(File.dirname(__FILE__), *%w[source _posts]), "2008-10-18-foo-bar.textile")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-06 00:00:00 -08:00
12
+ date: 2008-12-08 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency