octopress-date-format 2.0.1 → 2.0.2

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: bd900553e1ca7e0d2f47025f40446fcd62a014bd
4
- data.tar.gz: 778e974f85cc5d562e5623ef47797e3bad0b60fb
3
+ metadata.gz: 7a22b97f31315075505298367d931ac711bf1a07
4
+ data.tar.gz: f441b78ea1c9356ab066809229bf48bf1a14f392
5
5
  SHA512:
6
- metadata.gz: cccc18d8d06d191c87eb400f1da5d1192a5344087f97b84c7766c80095361aa1ea8a6925cf2fc0945c778f59f1ab79c67c82c9f0cf5759597415bc9f84069916
7
- data.tar.gz: 6c36777108228c6721b7ce6a191033fb8dafe8098d63c6a655a990dfed1d3093217e59755022ded23737b9a88116ca4158843bc6f8ded12fd96022310138bf19
6
+ metadata.gz: 26752820cf9f7623e3da7a690be9586ab21a9d14a50032f26033abee39a521f8af477d37cb512d2377980096eeb36f23a15bed7df3d5a34b3b52e4693de6f4ec
7
+ data.tar.gz: 7766f7abc45ea443b205fe4566b0d97bb41e67c5c5856c06404c23654307d44674fb694b9d17dd52858f01f0449c711779d64e7c9e4256d2823730b6305d1e7c
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ### 2.0.2 - 2014-10-09
4
+
5
+ - Also reads from Jekyll's configuration for broader compatibility.
6
+
3
7
  ### 2.0.1 - 2014-08-18
4
8
 
5
9
  - Added support for old `updated` YAML front-matter var.
@@ -16,6 +16,12 @@ module Octopress
16
16
  end
17
17
  end
18
18
 
19
+ class SiteHook < Hooks::Site
20
+ def pre_read(site)
21
+ PageDate::Configuration.jekyll_config = site.config
22
+ end
23
+ end
24
+
19
25
  def self.hack_date(page)
20
26
  if page.data['date'] || page.respond_to?(:date)
21
27
  date = datetime(page.data['date'] || page.date)
@@ -12,15 +12,32 @@ module Octopress
12
12
 
13
13
  module PageDate
14
14
  module Configuration
15
+ @jekyll_config = {}
16
+
15
17
  DEFAULTS = {
16
18
  'date_format' => 'ordinal',
17
- 'time_format' => '%-I:%M %P',
18
- 'display_time' => false
19
+ 'time_format' => '%-I:%M %P'
19
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
20
30
  end
21
31
 
22
32
  def self.config
23
- @config ||= Jekyll::Utils.deep_merge_hashes(PageDate::Configuration::DEFAULTS, Octopress.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
24
41
  end
25
42
  end
26
43
  end
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  class DateFormat
3
- VERSION = "2.0.1"
3
+ VERSION = "2.0.2"
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.1
4
+ version: 2.0.2
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-18 00:00:00.000000000 Z
11
+ date: 2014-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octopress-hooks
@@ -52,6 +52,34 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry-byebug
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
55
83
  description: 'Adds nicely formated dates to Jekyll posts and pages. (formerly: ''jekyll-date-format'')'
56
84
  email:
57
85
  - brandon@imathis.com
@@ -59,30 +87,12 @@ executables: []
59
87
  extensions: []
60
88
  extra_rdoc_files: []
61
89
  files:
62
- - ".gitignore"
63
- - ".travis.yml"
64
90
  - CHANGELOG.md
65
- - Gemfile
66
91
  - LICENSE.txt
67
92
  - README.md
68
- - Rakefile
69
93
  - lib/octopress-date-format.rb
70
94
  - lib/octopress-date-format/configuration.rb
71
95
  - lib/octopress-date-format/version.rb
72
- - octopress-date-format.gemspec
73
- - test/.clash.yml
74
- - test/.gitignore
75
- - test/Gemfile
76
- - test/_config.yml
77
- - test/_expected/2014/07/03/test.html
78
- - test/_expected/2014/07/03/welcome-to-jekyll.html
79
- - test/_expected/index.html
80
- - test/_expected/page.html
81
- - test/_includes/test_date.html
82
- - test/_posts/2013-08-16-welcome-to-jekyll.html
83
- - test/_posts/2013-08-17-test.html
84
- - test/index.html
85
- - test/page.html
86
96
  homepage: https://github.com/octopress/date-format
87
97
  licenses:
88
98
  - MIT
@@ -103,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
113
  version: '0'
104
114
  requirements: []
105
115
  rubyforge_project:
106
- rubygems_version: 2.2.2
116
+ rubygems_version: 2.4.1
107
117
  signing_key:
108
118
  specification_version: 4
109
119
  summary: 'Adds nicely formated dates to Jekyll posts and pages. (formerly: ''jekyll-date-format'')'
data/.gitignore DELETED
@@ -1,19 +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
- .DS_Store
19
- _site
@@ -1,5 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.0.0
4
- - 1.9.3
5
- script: cd test && bundle exec clash
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in octopress-dateformat.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1 +0,0 @@
1
- require "bundler/gem_tasks"
@@ -1,23 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'octopress-date-format/version'
5
-
6
- Gem::Specification.new do |gem|
7
- gem.name = "octopress-date-format"
8
- gem.version = Octopress::DateFormat::VERSION
9
- gem.authors = ["Brandon Mathis"]
10
- gem.email = ["brandon@imathis.com"]
11
- gem.description = %q{Adds nicely formated dates to Jekyll posts and pages. (formerly: 'jekyll-date-format')}
12
- gem.summary = %q{Adds nicely formated dates to Jekyll posts and pages. (formerly: 'jekyll-date-format')}
13
- gem.homepage = "https://github.com/octopress/date-format"
14
- gem.license = "MIT"
15
-
16
- gem.add_runtime_dependency 'octopress-hooks', '~> 2.0'
17
- gem.add_runtime_dependency 'jekyll', '~> 2.0'
18
-
19
- gem.add_development_dependency 'clash', '~> 1.0'
20
-
21
- gem.files = `git ls-files`.split($/)
22
- gem.require_paths = ["lib"]
23
- end
@@ -1,2 +0,0 @@
1
- build: true
2
- compare: _expected _site
@@ -1 +0,0 @@
1
- _site
@@ -1,3 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path => '/gemspec/path', :path => '../'
@@ -1,7 +0,0 @@
1
- name: Your New Jekyll Site
2
- markdown: redcarpet
3
- timezone: UTC
4
- gems:
5
- - octopress-date-format
6
- exclude:
7
- - Gemfile*
@@ -1,21 +0,0 @@
1
-
2
-
3
-
4
- ## Date
5
- - Date: 2014-07-03 14:08:00 +0000
6
- - Formatted Date: Jul 3rd, 2014
7
- - Formatted Time: 2:08 pm
8
- - Date XML: 2014-07-03T14:08:00+00:00
9
- - Date HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span></time>
10
- - Date Time HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span> <span class='time'>2:08 pm</span></time>
11
-
12
-
13
- ## Updated
14
- - Date: 2014-07-04 16:03:05 +0000
15
- - Formatted Date: Jul 4th, 2014
16
- - Formatted Time: 4:03 pm
17
- - XML: 2014-07-04T16:03:05+00:00
18
- - HTML: <time class='updated' datetime='2014-07-04T16:03:05+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>4</span><span class='date-suffix'>th</span>, <span class='date-year'>2014</span></span></time>
19
- - Date Time HTML: <time class='updated' datetime='2014-07-04T16:03:05+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>4</span><span class='date-suffix'>th</span>, <span class='date-year'>2014</span></span> <span class='time'>4:03 pm</span></time>
20
-
21
-
@@ -1,21 +0,0 @@
1
-
2
-
3
-
4
- ## Date
5
- - Date: 2014-07-03 14:08:00 +0000
6
- - Formatted Date: Jul 3rd, 2014
7
- - Formatted Time: 2:08 pm
8
- - Date XML: 2014-07-03T14:08:00+00:00
9
- - Date HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span></time>
10
- - Date Time HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span> <span class='time'>2:08 pm</span></time>
11
-
12
-
13
- ## Updated
14
- - Date: 2014-07-03 15:03:15 +0000
15
- - Formatted Date: Jul 3rd, 2014
16
- - Formatted Time: 3:03 pm
17
- - XML: 2014-07-03T15:03:15+00:00
18
- - HTML: <time class='updated' datetime='2014-07-03T15:03:15+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span></time>
19
- - Date Time HTML: <time class='updated' datetime='2014-07-03T15:03:15+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span> <span class='time'>3:03 pm</span></time>
20
-
21
-
@@ -1,45 +0,0 @@
1
-
2
-
3
-
4
-
5
- ## Date
6
- - Date: 2014-07-03 14:08:00 +0000
7
- - Formatted Date: Jul 3rd, 2014
8
- - Formatted Time: 2:08 pm
9
- - Date XML: 2014-07-03T14:08:00+00:00
10
- - Date HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span></time>
11
- - Date Time HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span> <span class='time'>2:08 pm</span></time>
12
-
13
-
14
- ## Updated
15
- - Date: 2014-07-03 15:03:15 +0000
16
- - Formatted Date: Jul 3rd, 2014
17
- - Formatted Time: 3:03 pm
18
- - XML: 2014-07-03T15:03:15+00:00
19
- - HTML: <time class='updated' datetime='2014-07-03T15:03:15+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span></time>
20
- - Date Time HTML: <time class='updated' datetime='2014-07-03T15:03:15+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span> <span class='time'>3:03 pm</span></time>
21
-
22
-
23
-
24
-
25
-
26
-
27
- ## Date
28
- - Date: 2014-07-03 14:08:00 +0000
29
- - Formatted Date: Jul 3rd, 2014
30
- - Formatted Time: 2:08 pm
31
- - Date XML: 2014-07-03T14:08:00+00:00
32
- - Date HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span></time>
33
- - Date Time HTML: <time class='entry-date' datetime='2014-07-03T14:08:00+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>3</span><span class='date-suffix'>rd</span>, <span class='date-year'>2014</span></span> <span class='time'>2:08 pm</span></time>
34
-
35
-
36
- ## Updated
37
- - Date: 2014-07-04 16:03:05 +0000
38
- - Formatted Date: Jul 4th, 2014
39
- - Formatted Time: 4:03 pm
40
- - XML: 2014-07-04T16:03:05+00:00
41
- - HTML: <time class='updated' datetime='2014-07-04T16:03:05+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>4</span><span class='date-suffix'>th</span>, <span class='date-year'>2014</span></span></time>
42
- - Date Time HTML: <time class='updated' datetime='2014-07-04T16:03:05+00:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>4</span><span class='date-suffix'>th</span>, <span class='date-year'>2014</span></span> <span class='time'>4:03 pm</span></time>
43
-
44
-
45
-
@@ -1,13 +0,0 @@
1
-
2
-
3
-
4
- ## Date
5
- - Date: 2013-08-16 14:08:15 +0000
6
- - Formatted Date: Aug 16th, 2013
7
- - Formatted Time: 2:08 pm
8
- - Date XML: 2013-08-16T14:08:15+00:00
9
- - Date HTML: <time class='entry-date' datetime='2013-08-16T14:08:15+00:00'><span class='date'><span class='date-month'>Aug</span> <span class='date-day'>16</span><span class='date-suffix'>th</span>, <span class='date-year'>2013</span></span></time>
10
- - Date Time HTML: <time class='entry-date' datetime='2013-08-16T14:08:15+00:00'><span class='date'><span class='date-month'>Aug</span> <span class='date-day'>16</span><span class='date-suffix'>th</span>, <span class='date-year'>2013</span></span> <span class='time'>2:08 pm</span></time>
11
-
12
-
13
-
@@ -1,22 +0,0 @@
1
- {% if post %}
2
- {% assign entry = post %}
3
- {% else %}
4
- {% assign entry = page %}
5
- {% endif %}
6
- ## Date
7
- - Date: {{ entry.date }}
8
- - Formatted Date: {{ entry.date_text }}
9
- - Formatted Time: {{ entry.time_text }}
10
- - Date XML: {{ entry.date_xml }}
11
- - Date HTML: {{ entry.date_html }}
12
- - Date Time HTML: {{ entry.date_time_html }}
13
-
14
- {% if entry.date_updated %}
15
- ## Updated
16
- - Date: {{ entry.date_updated }}
17
- - Formatted Date: {{ entry.date_updated_text }}
18
- - Formatted Time: {{ entry.time_updated_text }}
19
- - XML: {{ entry.date_updated_xml }}
20
- - HTML: {{ entry.date_updated_html }}
21
- - Date Time HTML: {{ entry.date_time_updated_html }}
22
- {% endif %}
@@ -1,7 +0,0 @@
1
- ---
2
- title: "Welcome to Jekyll!"
3
- date: 2014-07-03 14:08:00
4
- date_updated: 2014-07-03 15:03:15
5
- ---
6
-
7
- {% include test_date.html %}
@@ -1,7 +0,0 @@
1
- ---
2
- title: "Test"
3
- date: 2014-07-03 14:08:00
4
- updated: 2014-07-04 16:03:05
5
- ---
6
-
7
- {% include test_date.html %}
@@ -1,6 +0,0 @@
1
- ---
2
- ---
3
-
4
- {% for post in site.posts %}
5
- {% include test_date.html %}
6
- {% endfor %}
@@ -1,6 +0,0 @@
1
- ---
2
- title: Your New Jekyll Site
3
- date: 2013-08-16 14:08:15
4
- ---
5
-
6
- {% include test_date.html %}