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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: caf533c45c36a3d0ab706de24d87eb9644c6d75cd96fd382548f2e33669c116a
4
- data.tar.gz: 5ac31c58ab266710d4a7cd01d77b1c0a72557028cf3db98a0b97582274812eed
3
+ metadata.gz: 351d5597f7e44e5196d2aa61bd1d0f525e4d82a70fa5a27952321ea77780eb24
4
+ data.tar.gz: 6715dd0219b716b1933fbad948f89a529f03ab3a318882fb9e7081bd569c3bfb
5
5
  SHA512:
6
- metadata.gz: 301ec61a7fc330eacb9b158ed4171d002dd5cf751155acfc8b8229dabe06160c507a600b47e64f519109dff95e02fc4509f132c6e13728afcaf9866b4d08c01c
7
- data.tar.gz: d4e17fac97b98ed6d6b3e5e37613702943db6518a0b25ea8773b61b9607c73c8c88da2e1a43e23d0ee01ed0c6bf4eec24cda45fb31a756d2b116f31a27b71b03
6
+ metadata.gz: 3425d976c4118a4717a232d030c0c678cc7cc89af8eb343f522dfaa3347071d2716bb0a4d9c5d84568195380168716e6e05471a9f33935e48d1ddc54c0a3c080
7
+ data.tar.gz: 19d2f2e0bfdc7904bf011076c88bfe7f948976bb0ce4c020f5793bd38a1ed2034bcaf45165ff4477c2a5005ae8e2c335a3ef1b88bf9d7484a0dfd4ec08f4b42c
@@ -1 +1 @@
1
- 2.5.0
1
+ 2.5.1
@@ -1,3 +1,7 @@
1
+ # 0.6.5
2
+
3
+ * The `.seo_meta_tags` method now generates fallback titles based on the model field title
4
+
1
5
  # v0.6.2
2
6
 
3
7
  Moved `json_schema` as runtime dependency
@@ -30,7 +30,11 @@ module Dato
30
30
  @extra_headers = options[:extra_headers] || {}
31
31
  end
32
32
 
33
- response = Faraday.get("https://#{subdomain}.datocms.com/docs/#{subdomain}-hyperschema.json")
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&amp;byline=0&amp;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
@@ -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 |_i|
122
- value.to_hash(
93
+ base[:children] = children.map do |child|
94
+ child.to_hash(
123
95
  max_depth,
124
96
  current_depth + 1
125
97
  )
@@ -16,10 +16,7 @@ module Dato
16
16
  end
17
17
 
18
18
  def title_field
19
- item && item.fields.find do |field|
20
- field.field_type == 'string' &&
21
- field.appeareance[:type] == 'title'
22
- end
19
+ item && item.item_type.title_field
23
20
  end
24
21
 
25
22
  def item_title
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Dato
3
- VERSION = '0.6.3'
3
+ VERSION = '0.6.5'
4
4
  end
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.3
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-06-12 00:00:00.000000000 Z
11
+ date: 2018-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler