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 +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +1 -0
- data/lib/octopress-date-format.rb +8 -1
- data/lib/octopress-date-format/configuration.rb +1 -0
- data/lib/octopress-date-format/version.rb +1 -1
- data/test/_expected/2014/07/03/test.html +21 -0
- data/test/_expected/2014/07/03/welcome-to-jekyll.html +3 -0
- data/test/_expected/index.html +40 -5
- data/test/_expected/page.html +13 -0
- data/test/_includes/test_date.html +18 -13
- data/test/_posts/2013-08-17-test.html +7 -0
- data/test/index.html +2 -2
- data/test/page.html +6 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd900553e1ca7e0d2f47025f40446fcd62a014bd
|
4
|
+
data.tar.gz: 778e974f85cc5d562e5623ef47797e3bad0b60fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cccc18d8d06d191c87eb400f1da5d1192a5344087f97b84c7766c80095361aa1ea8a6925cf2fc0945c778f59f1ab79c67c82c9f0cf5759597415bc9f84069916
|
7
|
+
data.tar.gz: 6c36777108228c6721b7ce6a191033fb8dafe8098d63c6a655a990dfed1d3093217e59755022ded23737b9a88116ca4158843bc6f8ded12fd96022310138bf19
|
data/CHANGELOG.md
ADDED
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
|
-
|
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
|
|
@@ -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
|
+
|
data/test/_expected/index.html
CHANGED
@@ -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:
|
3
|
-
- Formatted Date:
|
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:
|
6
|
-
- Date HTML: <time class='entry-date' datetime='
|
7
|
-
- Date Time HTML: <time class='entry-date' datetime='
|
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: {{
|
3
|
-
- Formatted Date: {{
|
4
|
-
- Formatted Time: {{
|
5
|
-
- Date XML: {{
|
6
|
-
- Date HTML: {{
|
7
|
-
- 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
|
14
|
+
{% if entry.date_updated %}
|
10
15
|
## Updated
|
11
|
-
- Date: {{
|
12
|
-
- Formatted Date: {{
|
13
|
-
- Formatted Time: {{
|
14
|
-
- XML: {{
|
15
|
-
- HTML: {{
|
16
|
-
- Date Time 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 %}
|
data/test/index.html
CHANGED
data/test/page.html
ADDED
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.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-
|
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
|