dato 0.6.3 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +4 -0
- data/lib/dato/api_client.rb +5 -1
- data/lib/dato/local/field_type/video.rb +2 -0
- data/lib/dato/local/item.rb +2 -30
- data/lib/dato/utils/meta_tags/title.rb +1 -4
- data/lib/dato/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 351d5597f7e44e5196d2aa61bd1d0f525e4d82a70fa5a27952321ea77780eb24
|
4
|
+
data.tar.gz: 6715dd0219b716b1933fbad948f89a529f03ab3a318882fb9e7081bd569c3bfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3425d976c4118a4717a232d030c0c678cc7cc89af8eb343f522dfaa3347071d2716bb0a4d9c5d84568195380168716e6e05471a9f33935e48d1ddc54c0a3c080
|
7
|
+
data.tar.gz: 19d2f2e0bfdc7904bf011076c88bfe7f948976bb0ce4c020f5793bd38a1ed2034bcaf45165ff4477c2a5005ae8e2c335a3ef1b88bf9d7484a0dfd4ec08f4b42c
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.5.
|
1
|
+
2.5.1
|
data/CHANGELOG.md
CHANGED
data/lib/dato/api_client.rb
CHANGED
@@ -30,7 +30,11 @@ module Dato
|
|
30
30
|
@extra_headers = options[:extra_headers] || {}
|
31
31
|
end
|
32
32
|
|
33
|
-
response = Faraday.get(
|
33
|
+
response = Faraday.get(
|
34
|
+
# FOR DEV
|
35
|
+
# "http://#{subdomain}.lvh.me:3001/docs/#{subdomain}-hyperschema.json"
|
36
|
+
"https://#{subdomain}.datocms.com/docs/#{subdomain}-hyperschema.json"
|
37
|
+
)
|
34
38
|
|
35
39
|
schema = JsonSchema.parse!(JSON.parse(response.body))
|
36
40
|
schema.expand_references!
|
@@ -53,6 +53,8 @@ module Dato
|
|
53
53
|
%(<iframe width="#{width}" height="#{height}" src="//www.youtube.com/embed/#{provider_uid}?rel=0" frameborder="0" allowfullscreen></iframe>)
|
54
54
|
elsif provider == 'vimeo'
|
55
55
|
%(<iframe src="//player.vimeo.com/video/#{provider_uid}?title=0&byline=0&portrait=0" width="#{width}" height="#{height}" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>)
|
56
|
+
elsif provider == 'facebook'
|
57
|
+
%(<iframe src="//www.facebook.com/plugins/video.php?href=#{url}&width=#{width}&show_text=false&height=#{height}" width="#{width}" height="#{height}" style="border:none;overflow:hidden;width:100%;" scrolling="no" frameborder="0" allowTransparency="true" allow="encrypted-media" allowFullScreen="true"></iframe>)
|
56
58
|
end
|
57
59
|
# rubocop:enable Metrics/LineLength
|
58
60
|
end
|
data/lib/dato/local/item.rb
CHANGED
@@ -25,34 +25,6 @@ module Dato
|
|
25
25
|
other.is_a?(Item) && other.id == id
|
26
26
|
end
|
27
27
|
|
28
|
-
def autogenerated_slug(options = {})
|
29
|
-
warning = [
|
30
|
-
'Warning: the method `Item#autogenerated_slug` is deprecated:',
|
31
|
-
'please add an explicit field of type `slug`',
|
32
|
-
"to the `#{item_type.api_key}` item type."
|
33
|
-
]
|
34
|
-
puts warning.join(' ')
|
35
|
-
|
36
|
-
prefix_with_id = options.fetch(:prefix_with_id, true)
|
37
|
-
|
38
|
-
title_field = fields.find do |field|
|
39
|
-
field.field_type == 'string' &&
|
40
|
-
field.appeareance[:type] == 'title'
|
41
|
-
end
|
42
|
-
|
43
|
-
return item_type.api_key.humanize.parameterize if singleton?
|
44
|
-
return id.to_s unless title_field
|
45
|
-
|
46
|
-
title = send(title_field.api_key)
|
47
|
-
if title && prefix_with_id
|
48
|
-
"#{id}-#{title.parameterize[0..50]}"
|
49
|
-
elsif title
|
50
|
-
title.parameterize[0..50]
|
51
|
-
else
|
52
|
-
id.to_s
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
28
|
def seo_meta_tags
|
57
29
|
Utils::SeoTagsBuilder.new(self, @items_repo.site).meta_tags
|
58
30
|
end
|
@@ -118,8 +90,8 @@ module Dato
|
|
118
90
|
|
119
91
|
if item_type.tree
|
120
92
|
base[:position] = position
|
121
|
-
base[:children] = children.map do |
|
122
|
-
|
93
|
+
base[:children] = children.map do |child|
|
94
|
+
child.to_hash(
|
123
95
|
max_depth,
|
124
96
|
current_depth + 1
|
125
97
|
)
|
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.6.
|
4
|
+
version: 0.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Verna
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|