octopress-date-format 2.0.2 → 3.0.0

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: 7a22b97f31315075505298367d931ac711bf1a07
4
- data.tar.gz: f441b78ea1c9356ab066809229bf48bf1a14f392
3
+ metadata.gz: 1c8eb3200076ffb34ddff36208941349740217f2
4
+ data.tar.gz: 157b3d14982e791756faf5dc7c95a03fbc64e7fc
5
5
  SHA512:
6
- metadata.gz: 26752820cf9f7623e3da7a690be9586ab21a9d14a50032f26033abee39a521f8af477d37cb512d2377980096eeb36f23a15bed7df3d5a34b3b52e4693de6f4ec
7
- data.tar.gz: 7766f7abc45ea443b205fe4566b0d97bb41e67c5c5856c06404c23654307d44674fb694b9d17dd52858f01f0449c711779d64e7c9e4256d2823730b6305d1e7c
6
+ metadata.gz: 454cc19b7a1287eae597e658d00e008736de7c4f11f015fb8e524c7ecb39c22841c0f27895b8df705910af8ee78eddee5302bd8bbdc7d58492d2b3e4ce6cd4de
7
+ data.tar.gz: f3a1cfa6e2530188068916218de682917e12d5e9086983a43794a51857c0ebc0a1fb4ed2da05ba30c4f647f2e4f8d2b4769ba0105964aa96c6d7694c060f2358
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ### 3.0.0 - 2014-10-09
4
+
5
+ - Now only reads from Jekyll's configuration.
6
+
3
7
  ### 2.0.2 - 2014-10-09
4
8
 
5
9
  - Also reads from Jekyll's configuration for broader compatibility.
data/README.md CHANGED
@@ -68,8 +68,8 @@ Of course you can use Liquid conditionals when outputting an updated date.
68
68
 
69
69
  ## Configuration
70
70
 
71
- You may change the formatting of the dates and times in the
72
- `_octopress.yml` configuration file. Here are the defaults:
71
+ You may change the formatting of the dates and times in
72
+ Jekyll's configuration file. Here are the defaults:
73
73
 
74
74
  ```
75
75
  date_format: 'ordinal' # July 3rd, 2014
@@ -1,9 +1,21 @@
1
1
  require 'octopress-hooks'
2
- require 'octopress-date-format/configuration'
3
2
  require 'octopress-date-format/version'
4
3
 
5
4
  module Octopress
6
5
  module PageDate
6
+ DEFAULTS = {
7
+ 'date_format' => 'ordinal',
8
+ 'time_format' => '%-I:%M %P'
9
+ }
10
+
11
+ def self.config
12
+ @config
13
+ end
14
+
15
+ def self.config=(config)
16
+ @config = DEFAULTS.merge(config)
17
+ end
18
+
7
19
  class PageHook < Hooks::Page
8
20
  def post_init(page)
9
21
  PageDate.hack_date(page)
@@ -18,7 +30,7 @@ module Octopress
18
30
 
19
31
  class SiteHook < Hooks::Site
20
32
  def pre_read(site)
21
- PageDate::Configuration.jekyll_config = site.config
33
+ PageDate.config = site.config
22
34
  end
23
35
  end
24
36
 
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  class DateFormat
3
- VERSION = "2.0.2"
3
+ VERSION = "3.0.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-date-format
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 3.0.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-10-23 00:00:00.000000000 Z
11
+ date: 2014-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octopress-hooks
@@ -91,7 +91,6 @@ files:
91
91
  - LICENSE.txt
92
92
  - README.md
93
93
  - lib/octopress-date-format.rb
94
- - lib/octopress-date-format/configuration.rb
95
94
  - lib/octopress-date-format/version.rb
96
95
  homepage: https://github.com/octopress/date-format
97
96
  licenses:
@@ -1,44 +0,0 @@
1
- module Octopress
2
- unless defined? Octopress.config
3
- def self.config
4
- file = '_octopress.yml'
5
- if File.exist?(file)
6
- SafeYAML.load_file(file) || {}
7
- else
8
- {}
9
- end
10
- end
11
- end
12
-
13
- module PageDate
14
- module Configuration
15
- @jekyll_config = {}
16
-
17
- DEFAULTS = {
18
- 'date_format' => 'ordinal',
19
- 'time_format' => '%-I:%M %P'
20
- }
21
-
22
- def self.jekyll_config=(config)
23
- @jekyll_config = config
24
- end
25
-
26
- # For broader compatibility, also read config from Jekyll
27
- def self.jekyll_date_config
28
- @jekyll_config.select { |key,_| DEFAULTS.include? key }
29
- end
30
- end
31
-
32
- def self.config
33
- @config ||= begin
34
- default = PageDate::Configuration::DEFAULTS
35
- jekyll = PageDate::Configuration::jekyll_date_config
36
- octopress = Octopress.config
37
-
38
- config = Jekyll::Utils.deep_merge_hashes(default, jekyll)
39
- Jekyll::Utils.deep_merge_hashes(config, octopress)
40
- end
41
- end
42
- end
43
- end
44
-