octopress-date-format 2.0.0 → 2.0.1

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: 1b6c0adba7917954ffbf5405d1078930c67033e9
4
- data.tar.gz: d60d1df617fc1422eb1964d3949737ab08d98199
3
+ metadata.gz: bd900553e1ca7e0d2f47025f40446fcd62a014bd
4
+ data.tar.gz: 778e974f85cc5d562e5623ef47797e3bad0b60fb
5
5
  SHA512:
6
- metadata.gz: 9dfe8fa193b06e5766cae535e01f631369b1ccfb0ab5ff534ba595bf79be4b175ceb529958cc8e68c46cecd8c5fa8349fd95b80723b185b000baf7713c5635c5
7
- data.tar.gz: 0563a12335464f65f3c78c94141bbc29955fd71bfeafc0c7d25270695c87054ec9c07ac45cc51778eb57ccbd12c219695066c27ce72429cfcbb0e614d19e7674
6
+ metadata.gz: cccc18d8d06d191c87eb400f1da5d1192a5344087f97b84c7766c80095361aa1ea8a6925cf2fc0945c778f59f1ab79c67c82c9f0cf5759597415bc9f84069916
7
+ data.tar.gz: 6c36777108228c6721b7ce6a191033fb8dafe8098d63c6a655a990dfed1d3093217e59755022ded23737b9a88116ca4158843bc6f8ded12fd96022310138bf19
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ ### 2.0.1 - 2014-08-18
4
+
5
+ - Added support for old `updated` YAML front-matter var.
6
+
7
+ ### 2.0.0 - 2014-08-03
8
+
9
+ - Initial re-release, used to be jekyll-date-format.
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Octopress Date Format
2
2
 
3
3
  A simple plugin which makes it easy to have nicely formatted dates on any post or page.
4
+
4
5
  [![Build Status](https://travis-ci.org/octopress/date-format.svg)](https://travis-ci.org/octopress/date-format)
5
6
  [![Gem Version](http://img.shields.io/gem/v/octopress-date-format.svg)](https://rubygems.org/gems/octopress-date-format)
6
7
  [![License](http://img.shields.io/:license-mit-blue.svg)](http://octopress.mit-license.org)
@@ -27,6 +27,11 @@ module Octopress
27
27
  page.data['date_time_html'] = date_html(date)
28
28
  end
29
29
 
30
+ # Legacy support
31
+ if page.data['updated']
32
+ page.data['date_updated'] = page.data['updated']
33
+ end
34
+
30
35
  if page.data['date_updated']
31
36
  updated = datetime(page.data['date_updated'])
32
37
  page.data['date_updated_xml'] = updated.xmlschema
@@ -41,7 +46,9 @@ module Octopress
41
46
  def self.date_html(date, time=true)
42
47
  tag = "<time class='entry-date' datetime='#{ date.xmlschema }'>"
43
48
  tag += "<span class='date'>#{format_date(date, true)}</span>"
44
- tag += " <span class='time'>#{format_time(date)}</span>" if time
49
+ if time
50
+ tag += " <span class='time'>#{format_time(date)}</span>" if time
51
+ end
45
52
  tag += "</time>"
46
53
  end
47
54
 
@@ -15,6 +15,7 @@ module Octopress
15
15
  DEFAULTS = {
16
16
  'date_format' => 'ordinal',
17
17
  'time_format' => '%-I:%M %P',
18
+ 'display_time' => false
18
19
  }
19
20
  end
20
21
 
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  class DateFormat
3
- VERSION = "2.0.0"
3
+ VERSION = "2.0.1"
4
4
  end
5
5
  end
@@ -0,0 +1,21 @@
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,3 +1,6 @@
1
+
2
+
3
+
1
4
  ## Date
2
5
  - Date: 2014-07-03 14:08:00 +0000
3
6
  - Formatted Date: Jul 3rd, 2014
@@ -1,10 +1,45 @@
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
+
1
27
  ## Date
2
- - Date: 2013-08-16 14:08:15 +0000
3
- - Formatted Date: Aug 16th, 2013
28
+ - Date: 2014-07-03 14:08:00 +0000
29
+ - Formatted Date: Jul 3rd, 2014
4
30
  - Formatted Time: 2:08 pm
5
- - Date XML: 2013-08-16T14:08:15+00:00
6
- - 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>
7
- - 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>
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>
8
43
 
9
44
 
10
45
 
@@ -0,0 +1,13 @@
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,17 +1,22 @@
1
+ {% if post %}
2
+ {% assign entry = post %}
3
+ {% else %}
4
+ {% assign entry = page %}
5
+ {% endif %}
1
6
  ## Date
2
- - Date: {{ page.date }}
3
- - Formatted Date: {{ page.date_text }}
4
- - Formatted Time: {{ page.time_text }}
5
- - Date XML: {{ page.date_xml }}
6
- - Date HTML: {{ page.date_html }}
7
- - Date Time HTML: {{ page.date_time_html }}
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 }}
8
13
 
9
- {% if page.date_updated %}
14
+ {% if entry.date_updated %}
10
15
  ## Updated
11
- - Date: {{ page.date_updated }}
12
- - Formatted Date: {{ page.date_updated_text }}
13
- - Formatted Time: {{ page.time_updated_text }}
14
- - XML: {{ page.date_updated_xml }}
15
- - HTML: {{ page.date_updated_html }}
16
- - Date Time HTML: {{ page.date_time_updated_html }}
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 }}
17
22
  {% endif %}
@@ -0,0 +1,7 @@
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 +1,6 @@
1
1
  ---
2
- title: Your New Jekyll Site
3
- date: 2013-08-16 14:08:15
4
2
  ---
5
3
 
4
+ {% for post in site.posts %}
6
5
  {% include test_date.html %}
6
+ {% endfor %}
@@ -0,0 +1,6 @@
1
+ ---
2
+ title: Your New Jekyll Site
3
+ date: 2013-08-16 14:08:15
4
+ ---
5
+
6
+ {% include test_date.html %}
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.0
4
+ version: 2.0.1
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-03 00:00:00.000000000 Z
11
+ date: 2014-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octopress-hooks
@@ -61,6 +61,7 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
63
  - ".travis.yml"
64
+ - CHANGELOG.md
64
65
  - Gemfile
65
66
  - LICENSE.txt
66
67
  - README.md
@@ -73,11 +74,15 @@ files:
73
74
  - test/.gitignore
74
75
  - test/Gemfile
75
76
  - test/_config.yml
77
+ - test/_expected/2014/07/03/test.html
76
78
  - test/_expected/2014/07/03/welcome-to-jekyll.html
77
79
  - test/_expected/index.html
80
+ - test/_expected/page.html
78
81
  - test/_includes/test_date.html
79
82
  - test/_posts/2013-08-16-welcome-to-jekyll.html
83
+ - test/_posts/2013-08-17-test.html
80
84
  - test/index.html
85
+ - test/page.html
81
86
  homepage: https://github.com/octopress/date-format
82
87
  licenses:
83
88
  - MIT