trekyll 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trekyll/trello_get.rb +26 -6
- data/lib/trekyll/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09789f5453e5d4d496e9c9a68820e4586375cdfe'
|
4
|
+
data.tar.gz: 156b3ed3a50f16f2ebec2028aecf87c9a1881ce3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7ee1c3767cb4443220923df42d768ed56711d45db29781f37bd49760d37cc79420bdf88d64b1762fd730a5a54d82078c52912f7eda8d0d0d9a41051de6504c9
|
7
|
+
data.tar.gz: 16351a0adcd07d3d1741a4baf2d377fb553bcd142602ec4eaa139d6147406796842fae2fd4ee855a6fecbf563e0b24ed0309a6404ec70f0ffff6105099d06715
|
data/lib/trekyll/trello_get.rb
CHANGED
@@ -62,7 +62,9 @@ module Trekyll
|
|
62
62
|
|
63
63
|
counter = 1
|
64
64
|
wgtcounter = 1
|
65
|
+
postcounter = 1
|
65
66
|
cards.each do |card|
|
67
|
+
puts "Currently on card: #{card.name}"
|
66
68
|
|
67
69
|
# Create Navigation if navigation list name is defined in _nav.yml
|
68
70
|
if card.list.name == init_config.navigation then
|
@@ -228,8 +230,10 @@ module Trekyll
|
|
228
230
|
tmp[k] = v
|
229
231
|
end
|
230
232
|
# Sort hash and get url's
|
231
|
-
sorted_hash = tmp.sort.reverse.to_h
|
232
|
-
attachment_url = sorted_hash.map { |k, v| "\"#{[v].flatten.join(',')}\"" }.join(', ')
|
233
|
+
# sorted_hash = tmp.sort.reverse.to_h
|
234
|
+
# attachment_url = sorted_hash.map { |k, v| "\"#{[v].flatten.join(',')}\"" }.join(', ')
|
235
|
+
sorted_hash = tmp.sort_by { |k,v| k}.reverse
|
236
|
+
attachment_url = sorted_hash.map { |k, v| v}
|
233
237
|
|
234
238
|
puts "Attachment: #{attachment_url}" if attachment_url != ""
|
235
239
|
end
|
@@ -239,7 +243,7 @@ module Trekyll
|
|
239
243
|
template.puts <<~DOC.gsub(/\t/, '')
|
240
244
|
---
|
241
245
|
name: #{card.name}
|
242
|
-
attachments:
|
246
|
+
attachments: #{attachment_url}
|
243
247
|
---
|
244
248
|
DOC
|
245
249
|
# template.puts "#{card.desc}" Interpret content ?! TO DO
|
@@ -255,21 +259,34 @@ module Trekyll
|
|
255
259
|
label_name = ""
|
256
260
|
|
257
261
|
unless card.labels.nil? then
|
262
|
+
arr = []
|
258
263
|
card.labels.each do |label|
|
259
|
-
label_name = label_name + " " + label.name
|
264
|
+
# label_name = label_name + " " + label.name
|
265
|
+
arr.push(label.name)
|
260
266
|
end
|
267
|
+
label_name = arr.to_s
|
261
268
|
end
|
262
269
|
|
263
|
-
# Get cover image
|
270
|
+
# Get cover image and all other attachments
|
264
271
|
cover_id = card.cover_image_id
|
265
272
|
cover_image_url = ""
|
273
|
+
attachments = ""
|
266
274
|
unless card.attachments.nil? then
|
275
|
+
arr = Hash.new
|
267
276
|
card.attachments.each do |attachment|
|
277
|
+
|
278
|
+
k = attachment.pos
|
279
|
+
v = attachment.url
|
280
|
+
arr[k] = v
|
281
|
+
|
268
282
|
if attachment.id == cover_id
|
269
283
|
cover_image_url = attachment.url
|
270
284
|
end
|
271
285
|
end
|
272
286
|
|
287
|
+
tmp = arr.sort_by { |k,v| k}.reverse
|
288
|
+
attachments = tmp.map { |k,v| v}
|
289
|
+
|
273
290
|
puts "Post cover image: #{cover_image_url} " if cover_image_url != ""
|
274
291
|
|
275
292
|
end
|
@@ -326,15 +343,18 @@ module Trekyll
|
|
326
343
|
---
|
327
344
|
layout: #{layout}
|
328
345
|
cover: "#{cover_image_url}"
|
329
|
-
title: #{card.name}
|
346
|
+
title: "#{card.name}"
|
330
347
|
date: #{card.created_at}
|
331
348
|
categories: #{card.list.name.sanitize_as_post_name}
|
349
|
+
weight: #{postcounter}
|
332
350
|
tags: #{label_name}
|
351
|
+
attachments: #{attachments}
|
333
352
|
#{custom_fields.join("\n")}
|
334
353
|
---
|
335
354
|
DOC
|
336
355
|
template.puts "#{content}"
|
337
356
|
template.close
|
357
|
+
postcounter = postcounter.next
|
338
358
|
end
|
339
359
|
end
|
340
360
|
return true
|
data/lib/trekyll/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trekyll
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Canic Interactive
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trelloapi
|
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
89
|
version: '0'
|
90
90
|
requirements: []
|
91
91
|
rubyforge_project:
|
92
|
-
rubygems_version: 2.6.
|
92
|
+
rubygems_version: 2.6.13
|
93
93
|
signing_key:
|
94
94
|
specification_version: 4
|
95
95
|
summary: Trello to Jekyll CMS
|