msgtrail 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -10
- data/lib/msgtrail/blog.rb +1 -1
- data/lib/msgtrail/publish.rb +1 -0
- data/lib/msgtrail/renderers.rb +23 -8
- data/lib/msgtrail/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28e7072fe3ebdebc29a89edccec28b74522208f82be5aeef20ad627564b37d07
|
4
|
+
data.tar.gz: 2e1eab46f795631e71f00f9125afb82bff67f67e2cdc58cf684b61d862b1a375
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bc9b1f3bd053300bab75a40ea78ba82451f604c431b38a07dd8978dfcc889dd4fcbde208d96b822171c1d8292f411429a760fd92a637c8ad4f2d26445f4bf05
|
7
|
+
data.tar.gz: 58a263140a89b1b189ecbc56c90190ddf1e96552095591f56cc0d5426862529b2f53749934ae57a62a6acd28a0c9b3ddd755a390d1c1491537569f9649ec02ed
|
data/CHANGELOG.md
CHANGED
@@ -1,39 +1,44 @@
|
|
1
|
-
|
1
|
+
# Changelog
|
2
2
|
|
3
|
-
|
3
|
+
## Version 0.9.3
|
4
|
+
|
5
|
+
- Make published and updated date/time datestamps explicit
|
6
|
+
- Change feed format from RSS to Atom
|
7
|
+
|
8
|
+
## Version 0.9.2
|
4
9
|
|
5
10
|
- Add details to error messages
|
6
11
|
- Add plaintext rendering
|
7
12
|
|
8
|
-
|
13
|
+
## Version 0.9.1
|
9
14
|
|
10
15
|
- Fix link to tweets on mobile devices
|
11
16
|
|
12
|
-
|
17
|
+
## Version 0.9.0
|
13
18
|
|
14
19
|
- Condense multiple dashes in slugs into single dash
|
15
20
|
|
16
|
-
|
21
|
+
## Version 0.8.0
|
17
22
|
|
18
23
|
- Remove old packages (trims gem size).
|
19
24
|
|
20
|
-
|
25
|
+
## Version 0.7.0
|
21
26
|
|
22
27
|
- Add `track()` helper. Use for example `<%= track("index") %>` or `<%= track("article", article[:slug]) %>` to add a 1x1 pixel image using the following format: `"<img src=\"#{self.config.settings.domain_matter.tracking_pixel_url}?e=#{event}&se=#{sub_event}\" width=\"1\" height=\"1\" alt=\".\"/>"`. The `tracking_pixel_url` setting must be added to the `domain_matter` section in `config.json`. The URL should point to a (transparent) tracking pixel e.g. hosted on AWS CloudFront/S3.
|
23
28
|
|
24
|
-
|
29
|
+
## Version 0.7.0
|
25
30
|
|
26
31
|
- Add access to `cfg` variable inside partials.
|
27
32
|
|
28
|
-
|
33
|
+
## Version 0.6.0
|
29
34
|
|
30
35
|
- Added changelog.
|
31
36
|
- Removed unnecessary warning about missing output directory.
|
32
37
|
|
33
|
-
|
38
|
+
## Version 0.5.0
|
34
39
|
|
35
40
|
- First production version capable of rendering static files for msgtrail.com.
|
36
41
|
|
37
|
-
|
42
|
+
## Version 0.1.0 - 0.4.0
|
38
43
|
|
39
44
|
- Alpha/beta versions
|
data/lib/msgtrail/blog.rb
CHANGED
@@ -55,7 +55,7 @@ module Msgtrail
|
|
55
55
|
|
56
56
|
def generate_article_slugs
|
57
57
|
self.articles.each do |article|
|
58
|
-
article[:slug] = Slug.generate(article[:title], article[:date], article[:time])
|
58
|
+
article[:slug] = Slug.generate(article[:title], article[:published][:date], article[:published][:time])
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
data/lib/msgtrail/publish.rb
CHANGED
data/lib/msgtrail/renderers.rb
CHANGED
@@ -1,7 +1,28 @@
|
|
1
|
+
module RenderHelper
|
2
|
+
|
3
|
+
def now_as_rfc3339
|
4
|
+
DateTime.now.rfc3339
|
5
|
+
end
|
6
|
+
|
7
|
+
def as_rfc3339(published, updated = nil)
|
8
|
+
updated.nil? ? datestamp = published : datestamp = updated
|
9
|
+
ymd = datestamp[:date].split(/\D/).map(&:to_i)
|
10
|
+
hm = datestamp[:time].split(/\D/).map(&:to_i)
|
11
|
+
DateTime.new(ymd[0], ymd[1], ymd[2], hm[0], hm[1], 0, datestamp[:utc_offset]).rfc3339
|
12
|
+
end
|
13
|
+
|
14
|
+
def xml_safe(str)
|
15
|
+
str.gsub("&", "&").gsub("<", "<").gsub(">", ">").gsub("\"", """).gsub("'", "'")
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
1
20
|
module Msgtrail
|
2
21
|
|
3
22
|
class PageRenderer
|
4
23
|
|
24
|
+
include RenderHelper
|
25
|
+
|
5
26
|
attr_accessor :article, :articles, :config, :layout, :markdown, :plaintext, :template, :theme_directory
|
6
27
|
|
7
28
|
def initialize(layout_filepath, template_filepath, config)
|
@@ -58,18 +79,12 @@ module Msgtrail
|
|
58
79
|
end
|
59
80
|
end
|
60
81
|
|
61
|
-
def rfc2822_time(date, time)
|
62
|
-
ymd = date.split(/\D/).map(&:to_i)
|
63
|
-
hm = time.split(/\D/).map(&:to_i)
|
64
|
-
Time.new(ymd[0], ymd[1], ymd[2], hm[0], hm[1])
|
65
|
-
.getlocal(cfg.time_matter.utc_offset)
|
66
|
-
.rfc2822
|
67
|
-
end
|
68
|
-
|
69
82
|
end
|
70
83
|
|
71
84
|
class PartialRenderer
|
72
85
|
|
86
|
+
include RenderHelper
|
87
|
+
|
73
88
|
attr_accessor :config, :markdown, :partial, :plaintext, :variables
|
74
89
|
|
75
90
|
def initialize(partial_filepath, variables, config)
|
data/lib/msgtrail/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: msgtrail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik van Eykelen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
|
-
rubygems_version: 3.0.
|
176
|
+
rubygems_version: 3.0.1
|
177
177
|
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: A simple blog publication tool
|