octopress-date-format 2.0.1 → 2.0.2
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/octopress-date-format.rb +6 -0
- data/lib/octopress-date-format/configuration.rb +20 -3
- data/lib/octopress-date-format/version.rb +1 -1
- metadata +31 -21
- data/.gitignore +0 -19
- data/.travis.yml +0 -5
- data/Gemfile +0 -4
- data/Rakefile +0 -1
- data/octopress-date-format.gemspec +0 -23
- data/test/.clash.yml +0 -2
- data/test/.gitignore +0 -1
- data/test/Gemfile +0 -3
- data/test/_config.yml +0 -7
- data/test/_expected/2014/07/03/test.html +0 -21
- data/test/_expected/2014/07/03/welcome-to-jekyll.html +0 -21
- data/test/_expected/index.html +0 -45
- data/test/_expected/page.html +0 -13
- data/test/_includes/test_date.html +0 -22
- data/test/_posts/2013-08-16-welcome-to-jekyll.html +0 -7
- data/test/_posts/2013-08-17-test.html +0 -7
- data/test/index.html +0 -6
- data/test/page.html +0 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7a22b97f31315075505298367d931ac711bf1a07
|
|
4
|
+
data.tar.gz: f441b78ea1c9356ab066809229bf48bf1a14f392
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 26752820cf9f7623e3da7a690be9586ab21a9d14a50032f26033abee39a521f8af477d37cb512d2377980096eeb36f23a15bed7df3d5a34b3b52e4693de6f4ec
|
|
7
|
+
data.tar.gz: 7766f7abc45ea443b205fe4566b0d97bb41e67c5c5856c06404c23654307d44674fb694b9d17dd52858f01f0449c711779d64e7c9e4256d2823730b6305d1e7c
|
data/CHANGELOG.md
CHANGED
|
@@ -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 ||=
|
|
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
|
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.
|
|
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-
|
|
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.
|
|
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
data/.travis.yml
DELETED
data/Gemfile
DELETED
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
|
data/test/.clash.yml
DELETED
data/test/.gitignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
_site
|
data/test/Gemfile
DELETED
data/test/_config.yml
DELETED
|
@@ -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
|
-
|
data/test/_expected/index.html
DELETED
|
@@ -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
|
-
|
data/test/_expected/page.html
DELETED
|
@@ -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 %}
|
data/test/index.html
DELETED