dato 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +42 -5
- data/.travis.yml +1 -0
- data/Gemfile +1 -1
- data/Rakefile +2 -2
- data/bin/console +3 -3
- data/bin/rspec +6 -6
- data/dato.gemspec +1 -1
- data/exe/dato +3 -3
- data/lib/dato.rb +8 -8
- data/lib/dato/account/client.rb +2 -2
- data/lib/dato/api_client.rb +39 -43
- data/lib/dato/api_error.rb +10 -13
- data/lib/dato/cli.rb +18 -18
- data/lib/dato/dump/dsl/add_to_data_file.rb +1 -1
- data/lib/dato/dump/dsl/create_data_file.rb +1 -1
- data/lib/dato/dump/dsl/create_post.rb +1 -1
- data/lib/dato/dump/dsl/directory.rb +4 -4
- data/lib/dato/dump/dsl/root.rb +7 -7
- data/lib/dato/dump/format.rb +3 -3
- data/lib/dato/dump/format/json.rb +1 -1
- data/lib/dato/dump/format/toml.rb +6 -6
- data/lib/dato/dump/format/yaml.rb +3 -3
- data/lib/dato/dump/operation/add_to_data_file.rb +4 -4
- data/lib/dato/dump/operation/create_data_file.rb +3 -3
- data/lib/dato/dump/operation/create_post.rb +5 -6
- data/lib/dato/dump/operation/directory.rb +1 -1
- data/lib/dato/dump/runner.rb +5 -5
- data/lib/dato/dump/ssg_detector.rb +18 -20
- data/lib/dato/json_api_deserializer.rb +15 -16
- data/lib/dato/json_api_serializer.rb +30 -21
- data/lib/dato/json_schema_relationships.rb +19 -23
- data/lib/dato/json_schema_type.rb +47 -0
- data/lib/dato/local/entities_repo.rb +3 -3
- data/lib/dato/local/field_type/color.rb +11 -7
- data/lib/dato/local/field_type/file.rb +18 -24
- data/lib/dato/local/field_type/gallery.rb +1 -1
- data/lib/dato/local/field_type/global_seo.rb +4 -7
- data/lib/dato/local/field_type/lat_lon.rb +1 -1
- data/lib/dato/local/field_type/seo.rb +1 -1
- data/lib/dato/local/field_type/structured_text.rb +4 -10
- data/lib/dato/local/field_type/theme.rb +2 -2
- data/lib/dato/local/field_type/upload_id.rb +5 -5
- data/lib/dato/local/field_type/video.rb +9 -15
- data/lib/dato/local/item.rb +13 -12
- data/lib/dato/local/items_repo.rb +12 -18
- data/lib/dato/local/json_api_entity.rb +4 -3
- data/lib/dato/local/loader.rb +30 -31
- data/lib/dato/local/site.rb +5 -4
- data/lib/dato/paginator.rb +4 -4
- data/lib/dato/repo.rb +23 -30
- data/lib/dato/site/client.rb +5 -5
- data/lib/dato/upload/create_upload_path.rb +7 -10
- data/lib/dato/upload/file.rb +3 -3
- data/lib/dato/upload/image.rb +1 -1
- data/lib/dato/utils/build_modular_block.rb +4 -4
- data/lib/dato/utils/favicon_tags_builder.rb +10 -10
- data/lib/dato/utils/locale_value.rb +1 -1
- data/lib/dato/utils/meta_tags/article_modified_time.rb +3 -3
- data/lib/dato/utils/meta_tags/article_publisher.rb +2 -2
- data/lib/dato/utils/meta_tags/base.rb +6 -6
- data/lib/dato/utils/meta_tags/description.rb +4 -4
- data/lib/dato/utils/meta_tags/image.rb +4 -5
- data/lib/dato/utils/meta_tags/og_locale.rb +2 -2
- data/lib/dato/utils/meta_tags/og_site_name.rb +2 -2
- data/lib/dato/utils/meta_tags/og_type.rb +3 -3
- data/lib/dato/utils/meta_tags/robots.rb +2 -2
- data/lib/dato/utils/meta_tags/title.rb +6 -6
- data/lib/dato/utils/meta_tags/twitter_card.rb +2 -2
- data/lib/dato/utils/meta_tags/twitter_site.rb +2 -2
- data/lib/dato/utils/seo_tags_builder.rb +12 -12
- data/lib/dato/version.rb +1 -1
- metadata +7 -6
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "dato/utils/meta_tags/base"
|
4
4
|
|
5
5
|
module Dato
|
6
6
|
module Utils
|
@@ -8,7 +8,7 @@ module Dato
|
|
8
8
|
class OgLocale < Base
|
9
9
|
def build
|
10
10
|
locale = I18n.locale
|
11
|
-
og_tag(
|
11
|
+
og_tag("og:locale", "#{locale}_#{locale.upcase}")
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "dato/utils/meta_tags/base"
|
4
4
|
|
5
5
|
module Dato
|
6
6
|
module Utils
|
7
7
|
module MetaTags
|
8
8
|
class OgSiteName < Base
|
9
9
|
def build
|
10
|
-
og_tag(
|
10
|
+
og_tag("og:site_name", site_name) if site_name
|
11
11
|
end
|
12
12
|
|
13
13
|
def site_name
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "dato/utils/meta_tags/base"
|
4
4
|
|
5
5
|
module Dato
|
6
6
|
module Utils
|
@@ -8,9 +8,9 @@ module Dato
|
|
8
8
|
class OgType < Base
|
9
9
|
def build
|
10
10
|
if !item || item.singleton?
|
11
|
-
og_tag(
|
11
|
+
og_tag("og:type", "website")
|
12
12
|
else
|
13
|
-
og_tag(
|
13
|
+
og_tag("og:type", "article")
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "dato/utils/meta_tags/base"
|
4
4
|
|
5
5
|
module Dato
|
6
6
|
module Utils
|
7
7
|
module MetaTags
|
8
8
|
class Robots < Base
|
9
9
|
def build
|
10
|
-
meta_tag(
|
10
|
+
meta_tag("robots", "noindex") if site.no_index
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "dato/utils/meta_tags/base"
|
4
4
|
|
5
5
|
module Dato
|
6
6
|
module Utils
|
@@ -10,9 +10,9 @@ module Dato
|
|
10
10
|
return unless item_title
|
11
11
|
|
12
12
|
[
|
13
|
-
content_tag(
|
14
|
-
og_tag(
|
15
|
-
card_tag(
|
13
|
+
content_tag("title", item_title_with_suffix),
|
14
|
+
og_tag("og:title", item_title),
|
15
|
+
card_tag("twitter:title", item_title),
|
16
16
|
]
|
17
17
|
end
|
18
18
|
|
@@ -23,12 +23,12 @@ module Dato
|
|
23
23
|
def item_title
|
24
24
|
@item_title ||= seo_field_with_fallback(
|
25
25
|
:title,
|
26
|
-
title_field && item[title_field.api_key]
|
26
|
+
title_field && item[title_field.api_key],
|
27
27
|
)
|
28
28
|
end
|
29
29
|
|
30
30
|
def suffix
|
31
|
-
(site.global_seo && site.global_seo.title_suffix) ||
|
31
|
+
(site.global_seo && site.global_seo.title_suffix) || ""
|
32
32
|
end
|
33
33
|
|
34
34
|
def item_title_with_suffix
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "dato/utils/meta_tags/base"
|
4
4
|
|
5
5
|
module Dato
|
6
6
|
module Utils
|
7
7
|
module MetaTags
|
8
8
|
class TwitterCard < Base
|
9
9
|
def build
|
10
|
-
card_tag(
|
10
|
+
card_tag("twitter:card", seo_field_with_fallback(:twitter_card, nil) || "summary")
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "dato/utils/meta_tags/base"
|
4
4
|
|
5
5
|
module Dato
|
6
6
|
module Utils
|
7
7
|
module MetaTags
|
8
8
|
class TwitterSite < Base
|
9
9
|
def build
|
10
|
-
card_tag(
|
10
|
+
card_tag("twitter:site", twitter_account) if twitter_account
|
11
11
|
end
|
12
12
|
|
13
13
|
def twitter_account
|
@@ -1,16 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
12
|
-
require
|
13
|
-
require
|
3
|
+
require "dato/utils/meta_tags/title"
|
4
|
+
require "dato/utils/meta_tags/description"
|
5
|
+
require "dato/utils/meta_tags/image"
|
6
|
+
require "dato/utils/meta_tags/robots"
|
7
|
+
require "dato/utils/meta_tags/og_locale"
|
8
|
+
require "dato/utils/meta_tags/og_type"
|
9
|
+
require "dato/utils/meta_tags/og_site_name"
|
10
|
+
require "dato/utils/meta_tags/article_modified_time"
|
11
|
+
require "dato/utils/meta_tags/article_publisher"
|
12
|
+
require "dato/utils/meta_tags/twitter_card"
|
13
|
+
require "dato/utils/meta_tags/twitter_site"
|
14
14
|
|
15
15
|
module Dato
|
16
16
|
module Utils
|
@@ -26,7 +26,7 @@ module Dato
|
|
26
26
|
MetaTags::ArticleModifiedTime,
|
27
27
|
MetaTags::ArticlePublisher,
|
28
28
|
MetaTags::TwitterCard,
|
29
|
-
MetaTags::TwitterSite
|
29
|
+
MetaTags::TwitterSite,
|
30
30
|
].freeze
|
31
31
|
|
32
32
|
attr_reader :site, :item
|
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.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Verna
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: simplecov
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.17.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 0.17.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: vcr
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -410,6 +410,7 @@ files:
|
|
410
410
|
- lib/dato/json_api_deserializer.rb
|
411
411
|
- lib/dato/json_api_serializer.rb
|
412
412
|
- lib/dato/json_schema_relationships.rb
|
413
|
+
- lib/dato/json_schema_type.rb
|
413
414
|
- lib/dato/local/entities_repo.rb
|
414
415
|
- lib/dato/local/field_type/boolean.rb
|
415
416
|
- lib/dato/local/field_type/color.rb
|