msgtrail 0.9.2 → 0.9.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22f08180d5b28dc98df44b9f78bcef2201dcc9af653b15bbcc47dc1e7b1154cd
4
- data.tar.gz: 67a1d8d51fb231e7aa12a16c85f51e7fce2bba0c3a794eb257914a50c1a5f60b
3
+ metadata.gz: 28e7072fe3ebdebc29a89edccec28b74522208f82be5aeef20ad627564b37d07
4
+ data.tar.gz: 2e1eab46f795631e71f00f9125afb82bff67f67e2cdc58cf684b61d862b1a375
5
5
  SHA512:
6
- metadata.gz: d3f111b8e2b03d55f94101d8e9cdbdf57d8bef24dc0261eb808a8e28e4644e044133dc4468f41bb91dec7f9191fb1932a1484cb1e1f4c733ed4a4bfed2e7d475
7
- data.tar.gz: b7e5c2807f0a845e62e80be55c563de9d76a080accdafcb3afdc6b99f91ee80d6321e6142352c856836345c7442d16bef7ab84ba8382afaad0ec5544d3ee0731
6
+ metadata.gz: 4bc9b1f3bd053300bab75a40ea78ba82451f604c431b38a07dd8978dfcc889dd4fcbde208d96b822171c1d8292f411429a760fd92a637c8ad4f2d26445f4bf05
7
+ data.tar.gz: 58a263140a89b1b189ecbc56c90190ddf1e96552095591f56cc0d5426862529b2f53749934ae57a62a6acd28a0c9b3ddd755a390d1c1491537569f9649ec02ed
data/CHANGELOG.md CHANGED
@@ -1,39 +1,44 @@
1
- ### Changelog
1
+ # Changelog
2
2
 
3
- ##### Version 0.9.2
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
- ##### Version 0.9.1
13
+ ## Version 0.9.1
9
14
 
10
15
  - Fix link to tweets on mobile devices
11
16
 
12
- ##### Version 0.9.0
17
+ ## Version 0.9.0
13
18
 
14
19
  - Condense multiple dashes in slugs into single dash
15
20
 
16
- ##### Version 0.8.0
21
+ ## Version 0.8.0
17
22
 
18
23
  - Remove old packages (trims gem size).
19
24
 
20
- ##### Version 0.7.0
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
- ##### Version 0.7.0
29
+ ## Version 0.7.0
25
30
 
26
31
  - Add access to `cfg` variable inside partials.
27
32
 
28
- ##### Version 0.6.0
33
+ ## Version 0.6.0
29
34
 
30
35
  - Added changelog.
31
36
  - Removed unnecessary warning about missing output directory.
32
37
 
33
- ##### Version 0.5.0
38
+ ## Version 0.5.0
34
39
 
35
40
  - First production version capable of rendering static files for msgtrail.com.
36
41
 
37
- ##### Version 0.1.0 - 0.4.0
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
 
@@ -1,4 +1,5 @@
1
1
  require 'base64'
2
+ require 'date'
2
3
  require 'dotenv'
3
4
  require 'fileutils'
4
5
  require 'http'
@@ -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("&", "&amp;").gsub("<", "&lt;").gsub(">", "&gt;").gsub("\"", "&quot;").gsub("'", "&apos;")
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)
@@ -1,3 +1,3 @@
1
1
  module Msgtrail
2
- VERSION = "0.9.2"
2
+ VERSION = "0.9.3"
3
3
  end
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.2
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-10 00:00:00.000000000 Z
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.3
176
+ rubygems_version: 3.0.1
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: A simple blog publication tool