dato 0.3.13 → 0.3.14
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/file.rb +6 -4
- data/lib/dato/local/field_type/global_seo.rb +7 -4
- data/lib/dato/local/field_type/image.rb +14 -4
- data/lib/dato/local/field_type/seo.rb +5 -4
- data/lib/dato/local/items_repo.rb +4 -1
- data/lib/dato/local/site.rb +2 -1
- data/lib/dato/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f19eda1a40bf5684baf782e3f0067631145cb9b1
|
4
|
+
data.tar.gz: a6343cac11fa2ae523030ddd137e881a0062645d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 888a3a62b58796beb47447348a9d294aeceaa5af2c6b8fcf36779b3c0ae1f9b42220b7d0ebc062d39880f3bc1845cefe242ea837d9aed571f4cd327264767fec
|
7
|
+
data.tar.gz: bc5257b829dd8457c2ef2ec3d245ac5892eb655e8f556214a081c21ce9027ea344ce2e7b9bcc6b6ebf3755703e32f6659a3a149bfdbc931be3cf032d22cd9951
|
@@ -7,23 +7,25 @@ module Dato
|
|
7
7
|
class File
|
8
8
|
attr_reader :path, :format, :size
|
9
9
|
|
10
|
-
def self.parse(value,
|
10
|
+
def self.parse(value, repo)
|
11
11
|
value && new(
|
12
12
|
value[:path],
|
13
13
|
value[:format],
|
14
|
-
value[:size]
|
14
|
+
value[:size],
|
15
|
+
repo.site.entity.imgix_host
|
15
16
|
)
|
16
17
|
end
|
17
18
|
|
18
|
-
def initialize(path, format, size)
|
19
|
+
def initialize(path, format, size, imgix_host)
|
19
20
|
@path = path
|
20
21
|
@format = format
|
21
22
|
@size = size
|
23
|
+
@imgix_host = imgix_host
|
22
24
|
end
|
23
25
|
|
24
26
|
def file
|
25
27
|
Imgix::Client.new(
|
26
|
-
host:
|
28
|
+
host: @imgix_host,
|
27
29
|
secure: true,
|
28
30
|
include_library_param: false
|
29
31
|
).path(path)
|
@@ -10,13 +10,14 @@ module Dato
|
|
10
10
|
attr_reader :twitter_account
|
11
11
|
attr_reader :facebook_page_url
|
12
12
|
|
13
|
-
def self.parse(value,
|
13
|
+
def self.parse(value, repo)
|
14
14
|
value && new(
|
15
15
|
value[:site_name],
|
16
16
|
value[:title_suffix],
|
17
17
|
value[:twitter_account],
|
18
18
|
value[:facebook_page_url],
|
19
|
-
value[:fallback_seo]
|
19
|
+
value[:fallback_seo],
|
20
|
+
repo
|
20
21
|
)
|
21
22
|
end
|
22
23
|
|
@@ -25,17 +26,19 @@ module Dato
|
|
25
26
|
title_suffix,
|
26
27
|
twitter_account,
|
27
28
|
facebook_page_url,
|
28
|
-
fallback_seo
|
29
|
+
fallback_seo,
|
30
|
+
repo
|
29
31
|
)
|
30
32
|
@site_name = site_name
|
31
33
|
@title_suffix = title_suffix
|
32
34
|
@twitter_account = twitter_account
|
33
35
|
@facebook_page_url = facebook_page_url
|
34
36
|
@fallback_seo = fallback_seo
|
37
|
+
@repo = repo
|
35
38
|
end
|
36
39
|
|
37
40
|
def fallback_seo
|
38
|
-
@fallback_seo && Seo.parse(@fallback_seo,
|
41
|
+
@fallback_seo && Seo.parse(@fallback_seo, @repo)
|
39
42
|
end
|
40
43
|
|
41
44
|
def to_hash(*args)
|
@@ -7,7 +7,7 @@ module Dato
|
|
7
7
|
class Image < Dato::Local::FieldType::File
|
8
8
|
attr_reader :width, :height, :title, :alt
|
9
9
|
|
10
|
-
def self.parse(value,
|
10
|
+
def self.parse(value, repo)
|
11
11
|
value && new(
|
12
12
|
value[:path],
|
13
13
|
value[:format],
|
@@ -15,12 +15,22 @@ module Dato
|
|
15
15
|
value[:width],
|
16
16
|
value[:height],
|
17
17
|
value[:alt],
|
18
|
-
value[:title]
|
18
|
+
value[:title],
|
19
|
+
repo.site.entity.imgix_host
|
19
20
|
)
|
20
21
|
end
|
21
22
|
|
22
|
-
def initialize(
|
23
|
-
|
23
|
+
def initialize(
|
24
|
+
path,
|
25
|
+
format,
|
26
|
+
size,
|
27
|
+
width,
|
28
|
+
height,
|
29
|
+
alt,
|
30
|
+
title,
|
31
|
+
imgix_host
|
32
|
+
)
|
33
|
+
super(path, format, size, imgix_host)
|
24
34
|
@width = width
|
25
35
|
@height = height
|
26
36
|
@alt = alt
|
@@ -5,18 +5,19 @@ module Dato
|
|
5
5
|
class Seo
|
6
6
|
attr_reader :title, :description
|
7
7
|
|
8
|
-
def self.parse(value,
|
9
|
-
value && new(value[:title], value[:description], value[:image])
|
8
|
+
def self.parse(value, repo)
|
9
|
+
value && new(value[:title], value[:description], value[:image], repo)
|
10
10
|
end
|
11
11
|
|
12
|
-
def initialize(title, description, image)
|
12
|
+
def initialize(title, description, image, repo)
|
13
13
|
@title = title
|
14
14
|
@description = description
|
15
15
|
@image = image
|
16
|
+
@repo = repo
|
16
17
|
end
|
17
18
|
|
18
19
|
def image
|
19
|
-
@image && Image.parse(@image,
|
20
|
+
@image && Image.parse(@image, @repo)
|
20
21
|
end
|
21
22
|
|
22
23
|
def to_hash(*args)
|
data/lib/dato/local/site.rb
CHANGED
@@ -12,8 +12,9 @@ module Dato
|
|
12
12
|
def_delegators :entity, :id, :name, :locales, :theme_hue, :domain,
|
13
13
|
:internal_domain, :no_index, :frontend_url
|
14
14
|
|
15
|
-
def initialize(entity)
|
15
|
+
def initialize(entity, items_repo)
|
16
16
|
@entity = entity
|
17
|
+
@items_repo = items_repo
|
17
18
|
end
|
18
19
|
|
19
20
|
def global_seo
|
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.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Verna
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|