middleman-dato 0.5.13 → 0.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +12 -0
- data/README.md +29 -0
- data/lib/middleman_dato/client.rb +16 -1
- data/lib/middleman_dato/version.rb +1 -1
- 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: 782c5f987e8280caab87c79ce9e95205c5284dd0
|
|
4
|
+
data.tar.gz: e6fc0b2f38b2e0ed943ed543633bcaf2b036aeb9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 10bf9143fcb77e7bedaaa743f0a30ca1e8a60085e1e1030f8af2c7658523b6a8074186b40ed9bfe5b3a5bb6479378ac07fb26f1bcc7c5d816079d0f3d628f0bb
|
|
7
|
+
data.tar.gz: fd9332e347def3eb5581954e5cfc1b7ecc918f4836d9b35cd7afc6ef27bd4ea5b3cc0098f5843bede72c6230d6374251648cfbd29d574572a2a1c7ff73c20777
|
data/.travis.yml
ADDED
data/README.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# middleman-dato
|
|
2
2
|
|
|
3
|
+
[](https://travis-ci.org/datocms/middleman-dato)
|
|
4
|
+
|
|
5
|
+
Middleman Dato is a Middleman extension to use the Middleman static site generator together with the API-driven DatoCMS, a fully customizable administrative backend for your static websites.
|
|
6
|
+
|
|
7
|
+
This gem works for Middleman v3 and v4.
|
|
8
|
+
|
|
9
|
+
## Documentation and video tutorials
|
|
10
|
+
|
|
11
|
+
To learn more about DatoCMS and how you can use it with your Middleman website, head over to [our documentation](http://www.datocms.com/docs/) and [video tutorials](http://www.datocms.com/docs/tutorials/middleman_netlify/).
|
|
12
|
+
|
|
3
13
|
## Setup
|
|
4
14
|
|
|
5
15
|
```ruby
|
|
@@ -96,3 +106,22 @@ This helper generates meta tags based on the Favicon image specified within the
|
|
|
96
106
|
```ruby
|
|
97
107
|
<%= dato_favicon_meta_tags(theme_color: '#D97C5F') %>
|
|
98
108
|
```
|
|
109
|
+
|
|
110
|
+
## Submitting a Pull Request
|
|
111
|
+
|
|
112
|
+
1. Fork it.
|
|
113
|
+
2. Create a branch (`git checkout -b some_bufix`)
|
|
114
|
+
3. Commit your changes (`git commit -am "Fix typos"`)
|
|
115
|
+
4. Push to the branch (`git push origin some_bugfix`)
|
|
116
|
+
5. Open a [Pull Request][1]
|
|
117
|
+
6. Enjoy a refreshing Diet Coke and wait
|
|
118
|
+
|
|
119
|
+
## Testing
|
|
120
|
+
|
|
121
|
+
To run the tests:
|
|
122
|
+
|
|
123
|
+
$ rake
|
|
124
|
+
|
|
125
|
+
If nothing complains, congratulations!
|
|
126
|
+
|
|
127
|
+
[1]: http://github.com/datocms/middleman-dato/pulls
|
|
@@ -20,7 +20,22 @@ module MiddlemanDato
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def items
|
|
23
|
-
|
|
23
|
+
items_per_page = 500
|
|
24
|
+
base_response = get('items', 'page[limit]' => 1).body.
|
|
25
|
+
with_indifferent_access
|
|
26
|
+
|
|
27
|
+
pages = (base_response[:meta][:total_count] / items_per_page.to_f).ceil
|
|
28
|
+
base_response[:data] = []
|
|
29
|
+
|
|
30
|
+
pages.times do |page|
|
|
31
|
+
base_response[:data] += get(
|
|
32
|
+
'items',
|
|
33
|
+
'page[offset]' => items_per_page * page,
|
|
34
|
+
'page[limit]' => items_per_page
|
|
35
|
+
).body.with_indifferent_access[:data]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
base_response
|
|
24
39
|
end
|
|
25
40
|
|
|
26
41
|
def get(*args)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: middleman-dato
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stefano Verna
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-07-
|
|
11
|
+
date: 2016-07-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: middleman-core
|
|
@@ -105,6 +105,7 @@ files:
|
|
|
105
105
|
- ".gitlab-ci.yml"
|
|
106
106
|
- ".rspec"
|
|
107
107
|
- ".rubocop.yml"
|
|
108
|
+
- ".travis.yml"
|
|
108
109
|
- Gemfile
|
|
109
110
|
- README.md
|
|
110
111
|
- Rakefile
|