voog-kit 0.5.8 → 0.5.9

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
  SHA256:
3
- metadata.gz: dd2772b088e4393011c286f94147c3445c2cd65ca443c5a94bf72dc8a1caf8c7
4
- data.tar.gz: 5f5b600bb5ab449e8bdd005d88108285729943bc11aaaac940823240a6518094
3
+ metadata.gz: 618acbfe55808ed71c5f71a5b8482b41c51bfc178a87689bd0d5736b5482594f
4
+ data.tar.gz: ee3d0879f105a0b8e3602979fb8566ebf48df97e43d329740c0a77d2beb8046a
5
5
  SHA512:
6
- metadata.gz: ebe00fbbd5c838201b0e18b14ec89338e3f68b1625b1c1c3b2e0480969d48059b6bfe498f31afdc54bc8a537db9adb0f36c6f7faca6bb1871e6768422c57f7cf
7
- data.tar.gz: 988d541f32772e63805d848bdd13f4e853db8324df7c0ea1cde591f9bc7686f54b713bd631be533300516d45bf04fcca49b4d25a60202ba61fbb4776cfdd5ba3
6
+ metadata.gz: dcb51f26bb93bef797da6da4c105a39426281bfe415fa7c629b7b48e76d99d4f6549bf580642bb41df65181d25a33b208a9d29f4829409da250b511a4805d014
7
+ data.tar.gz: 49c675bbb059d73c6e9d9f08a5b7ecd49b07f887f99d24dcb0850da014da21cdf0852a48d78a8e83bf54d50ee7163b6f1078b3a03423bcc6f51dcf4d0959053b
@@ -34,8 +34,10 @@ module Voog::Dtk
34
34
  end
35
35
 
36
36
  def write_manifest(manifest)
37
- if manifest["layouts"].is_a?(Array)
38
- manifest["layouts"].sort! { |a, b| a["file"] <=> b["file"]}
37
+ %w(assets layouts).each do |k|
38
+ if manifest[k].is_a?(Array)
39
+ manifest[k].sort! { |a, b| a['file'] <=> b['file'] || 0 }
40
+ end
39
41
  end
40
42
  File.open('manifest.json', 'w+', encoding: 'UTF-8') do |file|
41
43
  file << JSON.pretty_generate(manifest)
@@ -337,7 +339,7 @@ module Voog::Dtk
337
339
  'preview_medium' => "",
338
340
  'preview_small' => "",
339
341
  'author' => "",
340
- 'layouts' => sort_layouts_by_content_type(layouts + components),
342
+ 'layouts' => (layouts + components),
341
343
  'assets' => assets
342
344
  }
343
345
  if @old_manifest
@@ -356,15 +358,6 @@ module Voog::Dtk
356
358
  generate_manifest get_layouts, get_layout_assets
357
359
  end
358
360
 
359
- def sort_layouts_by_content_type(layouts)
360
- # make sure that 'blog' is before 'blog_article' and 'elements' is before 'element'
361
- preferred_order = %w(page blog blog_article elements element error_401 error_404 photoset component)
362
-
363
- layouts.sort do |a, b|
364
- preferred_order.index(a.fetch('content_type')) <=> preferred_order.index(b.fetch('content_type'))
365
- end
366
- end
367
-
368
361
  def generate_manifest(layouts = nil, layout_assets = nil)
369
362
  layouts ||= get_layouts
370
363
  layout_assets ||= get_layout_assets
@@ -403,8 +396,6 @@ module Voog::Dtk
403
396
  }
404
397
  end
405
398
 
406
- manifest[:layouts] = sort_layouts_by_content_type(manifest[:layouts])
407
-
408
399
  manifest[:assets] = layout_assets.inject(Array.new) do |memo, a|
409
400
 
410
401
  # kind is same as asset_type for kinds that are represented in the asset_folders hash, defaults to 'asset'
@@ -1,5 +1,5 @@
1
1
  module Voog
2
2
  module Dtk
3
- VERSION = '0.5.8'
3
+ VERSION = '0.5.9'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voog-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikk Pristavka
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-08-24 00:00:00.000000000 Z
12
+ date: 2021-12-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler