dato 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dato/local/field_type/date.rb +1 -1
- data/lib/dato/local/field_type/date_time.rb +1 -1
- data/lib/dato/local/field_type/file.rb +1 -1
- data/lib/dato/local/field_type/gallery.rb +23 -0
- data/lib/dato/local/field_type/global_seo.rb +1 -1
- data/lib/dato/local/field_type/image.rb +11 -5
- data/lib/dato/local/field_type/lat_lon.rb +1 -1
- data/lib/dato/local/field_type/link.rb +1 -1
- data/lib/dato/local/field_type/links.rb +6 -1
- data/lib/dato/local/field_type/seo.rb +1 -1
- data/lib/dato/local/field_type/video.rb +1 -1
- data/lib/dato/local/item.rb +1 -1
- data/lib/dato/local/items_repo.rb +4 -3
- data/lib/dato/local/site.rb +1 -1
- data/lib/dato/version.rb +1 -1
- data/lib/dato/watch/site_change_watcher.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9ddbcaa4cd09253d0a43f0f05169498d22e125e
|
4
|
+
data.tar.gz: 16f0cf8243fd0f9519f78bc49fceb1a41cb6c85a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53899624f929cdc34a587426ab3fc21a18e5096b6b1f87ffe5cf959087d2c8a42bf2ef27baf775acf81aa6e0203774f9667767994e6421723a2ecc60d9b53f9e
|
7
|
+
data.tar.gz: 7363a20c682292080b81a2f55a47d7ed0a7924d2e998dfd6e22c3c2f8b604627319153a7960e8eba65075ccf3d840b3eb36a6b7c6d2d371aa682d841c1c142cd
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'dato/local/field_type/file'
|
3
|
+
|
4
|
+
module Dato
|
5
|
+
module Local
|
6
|
+
module FieldType
|
7
|
+
class Gallery < Array
|
8
|
+
def self.parse(value, repo)
|
9
|
+
images = if value
|
10
|
+
value.map { |image| FieldType::Image.parse(image, repo) }
|
11
|
+
else
|
12
|
+
[]
|
13
|
+
end
|
14
|
+
new(images)
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_hash
|
18
|
+
map(&:to_hash)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -5,22 +5,26 @@ module Dato
|
|
5
5
|
module Local
|
6
6
|
module FieldType
|
7
7
|
class Image < Dato::Local::FieldType::File
|
8
|
-
attr_reader :width, :height
|
8
|
+
attr_reader :width, :height, :title, :alt
|
9
9
|
|
10
10
|
def self.parse(value, _repo)
|
11
|
-
new(
|
11
|
+
value && new(
|
12
12
|
value[:path],
|
13
13
|
value[:format],
|
14
14
|
value[:size],
|
15
15
|
value[:width],
|
16
|
-
value[:height]
|
16
|
+
value[:height],
|
17
|
+
value[:alt],
|
18
|
+
value[:title]
|
17
19
|
)
|
18
20
|
end
|
19
21
|
|
20
|
-
def initialize(path, format, size, width, height)
|
22
|
+
def initialize(path, format, size, width, height, alt, title)
|
21
23
|
super(path, format, size)
|
22
24
|
@width = width
|
23
25
|
@height = height
|
26
|
+
@alt = alt
|
27
|
+
@title = title
|
24
28
|
end
|
25
29
|
|
26
30
|
alias raw_file file
|
@@ -32,7 +36,9 @@ module Dato
|
|
32
36
|
def to_hash
|
33
37
|
super.merge(
|
34
38
|
width: width,
|
35
|
-
height: height
|
39
|
+
height: height,
|
40
|
+
alt: alt,
|
41
|
+
title: title
|
36
42
|
)
|
37
43
|
end
|
38
44
|
end
|
data/lib/dato/local/item.rb
CHANGED
@@ -126,9 +126,10 @@ module Dato
|
|
126
126
|
def build_singletons_by_type!
|
127
127
|
item_types.each do |item_type|
|
128
128
|
method = item_type_methods[item_type]
|
129
|
-
|
130
|
-
|
131
|
-
|
129
|
+
next unless item_type.singleton
|
130
|
+
@collections_by_type[method] = @items_by_id[
|
131
|
+
item_type.singleton_item.id
|
132
|
+
]
|
132
133
|
end
|
133
134
|
end
|
134
135
|
|
data/lib/dato/local/site.rb
CHANGED
data/lib/dato/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dato
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Verna
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -402,6 +402,7 @@ files:
|
|
402
402
|
- lib/dato/local/field_type/date_time.rb
|
403
403
|
- lib/dato/local/field_type/file.rb
|
404
404
|
- lib/dato/local/field_type/float.rb
|
405
|
+
- lib/dato/local/field_type/gallery.rb
|
405
406
|
- lib/dato/local/field_type/global_seo.rb
|
406
407
|
- lib/dato/local/field_type/image.rb
|
407
408
|
- lib/dato/local/field_type/integer.rb
|