contentful_bootstrap 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +8 -0
- data/lib/contentful_bootstrap/commands.rb +3 -0
- data/lib/contentful_bootstrap/server.rb +0 -1
- data/lib/contentful_bootstrap/templates/base.rb +1 -0
- data/lib/contentful_bootstrap/templates/catalogue.rb +179 -0
- data/lib/contentful_bootstrap/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccdf855e61bc34f54ceb1aa0d11ffe347fa82354
|
4
|
+
data.tar.gz: 382ab23f1e2da34c48718f82a66d49600a232569
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b05191cd8ace399c1e88f9c8f4461217f5137021a1e3115d1d18ed0dd70bbcba08174e25eeb0ed79a5e7d86bb325401dfb86aaace3ded6cf5e1a56a8631589a1
|
7
|
+
data.tar.gz: e17a17529945dad7bd8b7805a38d71c4196edd2356ceda2f342bd57679ec7ac2840c13c5343da2b1cc98868e1c4f187aef9a53b988c4994ac5a9059b564d2490
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
# Change Log
|
2
2
|
## Unreleased
|
3
3
|
|
4
|
+
## v0.0.6
|
5
|
+
### Fixed
|
6
|
+
* Token was not being returned on `generate_token` call
|
7
|
+
|
8
|
+
### Added
|
9
|
+
* `catalogue` template now available
|
10
|
+
* Added small sleep window between asset processing and publishing
|
11
|
+
|
12
|
+
|
4
13
|
## v0.0.5
|
5
14
|
### Added
|
6
15
|
* API Token Generation
|
data/README.md
CHANGED
@@ -26,12 +26,20 @@ $ gem install contentful_bootstrap
|
|
26
26
|
$ contentful_bootstrap init <space_name> [--template template_name]
|
27
27
|
```
|
28
28
|
|
29
|
+
|
29
30
|
Then you can create other spaces by doing:
|
30
31
|
|
31
32
|
```bash
|
32
33
|
$ contentful_bootstrap create_space <space_name> [--template template_name]
|
33
34
|
```
|
34
35
|
|
36
|
+
|
37
|
+
You can also generate new Delivery API Tokens by doing:
|
38
|
+
|
39
|
+
```bash
|
40
|
+
$ contentful_bootstrap generate_token <space_id> [--name token_name]
|
41
|
+
```
|
42
|
+
|
35
43
|
### Available templates
|
36
44
|
|
37
45
|
The available templates for your spaces are:
|
@@ -68,6 +68,7 @@ module ContentfulBootstrap
|
|
68
68
|
space = Contentful::Management::Space.find(space)
|
69
69
|
end
|
70
70
|
|
71
|
+
puts
|
71
72
|
puts "Creating Delivery API Token"
|
72
73
|
|
73
74
|
response = Contentful::Management::Request.new(
|
@@ -79,6 +80,8 @@ module ContentfulBootstrap
|
|
79
80
|
token = response.object["accessToken"]
|
80
81
|
|
81
82
|
puts "Token '#{token_name}' created! - '#{token}'"
|
83
|
+
|
84
|
+
token
|
82
85
|
end
|
83
86
|
|
84
87
|
private
|
@@ -51,7 +51,6 @@ module ContentfulBootstrap
|
|
51
51
|
|
52
52
|
class OAuthCallbackController < WEBrick::HTTPServlet::AbstractServlet
|
53
53
|
def do_GET(request, response)
|
54
|
-
#get '/oauth_callback' do
|
55
54
|
response.status = 200
|
56
55
|
response.content_type = "text/html"
|
57
56
|
response.body = OAuthEchoView.new.render
|
@@ -1,8 +1,187 @@
|
|
1
1
|
require "contentful_bootstrap/templates/base"
|
2
|
+
require "contentful_bootstrap/templates/links"
|
2
3
|
|
3
4
|
module ContentfulBootstrap
|
4
5
|
module Templates
|
5
6
|
class Catalogue < Base
|
7
|
+
def content_types
|
8
|
+
[
|
9
|
+
{
|
10
|
+
id: 'brand',
|
11
|
+
name: 'Brand',
|
12
|
+
display_field: 'name',
|
13
|
+
fields: [
|
14
|
+
{
|
15
|
+
id: 'name',
|
16
|
+
name: "Company Name",
|
17
|
+
type: "Symbol"
|
18
|
+
},
|
19
|
+
{
|
20
|
+
id: 'website',
|
21
|
+
name: "Website",
|
22
|
+
type: "Symbol"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
id: 'logo',
|
26
|
+
name: "Logo",
|
27
|
+
type: "Link",
|
28
|
+
link_type: "Asset"
|
29
|
+
}
|
30
|
+
]
|
31
|
+
},
|
32
|
+
{
|
33
|
+
id: 'category',
|
34
|
+
name: 'Category',
|
35
|
+
display_field: 'title',
|
36
|
+
fields: [
|
37
|
+
{
|
38
|
+
id: 'title',
|
39
|
+
name: "Title",
|
40
|
+
type: "Symbol"
|
41
|
+
},
|
42
|
+
{
|
43
|
+
id: 'description',
|
44
|
+
name: "Description",
|
45
|
+
type: "Text"
|
46
|
+
},
|
47
|
+
{
|
48
|
+
id: 'icon',
|
49
|
+
name: "Icon",
|
50
|
+
type: "Link",
|
51
|
+
link_type: "Asset"
|
52
|
+
}
|
53
|
+
]
|
54
|
+
},
|
55
|
+
{
|
56
|
+
id: 'product',
|
57
|
+
name: 'Product',
|
58
|
+
display_field: 'name',
|
59
|
+
fields: [
|
60
|
+
{
|
61
|
+
id: 'name',
|
62
|
+
name: "name",
|
63
|
+
type: "Symbol"
|
64
|
+
},
|
65
|
+
{
|
66
|
+
id: 'description',
|
67
|
+
name: "Description",
|
68
|
+
type: "Text"
|
69
|
+
},
|
70
|
+
{
|
71
|
+
id: 'image',
|
72
|
+
name: "Image",
|
73
|
+
type: "Link",
|
74
|
+
link_type: "Asset"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
id: 'brand',
|
78
|
+
name: "Brand",
|
79
|
+
type: "Link",
|
80
|
+
link_type: "Entry"
|
81
|
+
},
|
82
|
+
{
|
83
|
+
id: 'category',
|
84
|
+
name: "Category",
|
85
|
+
type: "Link",
|
86
|
+
link_type: "Entry"
|
87
|
+
},
|
88
|
+
{
|
89
|
+
id: 'url',
|
90
|
+
name: "Available at",
|
91
|
+
type: "Symbol"
|
92
|
+
}
|
93
|
+
]
|
94
|
+
}
|
95
|
+
]
|
96
|
+
end
|
97
|
+
|
98
|
+
def assets
|
99
|
+
[
|
100
|
+
{
|
101
|
+
id: 'playsam_image',
|
102
|
+
title: 'Playsam',
|
103
|
+
file: create_image('playsam_image', 'https://images.contentful.com/liicpxzmg1q0/4zj1ZOfHgQ8oqgaSKm4Qo2/3be82d54d45b5297e951aee9baf920da/playsam.jpg?h=250&')
|
104
|
+
},
|
105
|
+
{
|
106
|
+
id: 'normann_image',
|
107
|
+
title: 'Normann',
|
108
|
+
file: create_image('normann_image', 'https://images.contentful.com/liicpxzmg1q0/3wtvPBbBjiMKqKKga8I2Cu/75c7c92f38f7953a741591d215ad61d4/zJYzDlGk.jpeg?h=250&')
|
109
|
+
},
|
110
|
+
{
|
111
|
+
id: 'toy_image',
|
112
|
+
title: 'Toys',
|
113
|
+
file: create_image('toy_image', 'https://images.contentful.com/liicpxzmg1q0/6t4HKjytPi0mYgs240wkG/866ef53a11af9c6bf5f3808a8ce1aab2/toys_512pxGREY.png?h=250&')
|
114
|
+
},
|
115
|
+
{
|
116
|
+
id: 'kitchen_image',
|
117
|
+
title: 'Kitchen and Home',
|
118
|
+
file: create_image('kitchen_image', 'https://images.contentful.com/liicpxzmg1q0/6m5AJ9vMPKc8OUoQeoCS4o/ffc20f5a8f2a71cca4801bc9c51b966a/1418244847_Streamline-18-256.png?h=250&')
|
119
|
+
},
|
120
|
+
{
|
121
|
+
id: 'toy_car',
|
122
|
+
title: 'Playsam Toy Car',
|
123
|
+
file: create_image('toy_car', 'https://images.contentful.com/liicpxzmg1q0/wtrHxeu3zEoEce2MokCSi/acef70d12fe019228c4238aa791bdd48/quwowooybuqbl6ntboz3.jpg?h=250&')
|
124
|
+
},
|
125
|
+
{
|
126
|
+
id: 'whiskers',
|
127
|
+
title: 'Normann Whisk Beaters',
|
128
|
+
file: create_image('whiskers', 'https://images.contentful.com/liicpxzmg1q0/10TkaLheGeQG6qQGqWYqUI/d510dde5e575d40288cf75b42383aa53/ryugj83mqwa1asojwtwb.jpg?h=250&')
|
129
|
+
}
|
130
|
+
]
|
131
|
+
end
|
132
|
+
|
133
|
+
def entries
|
134
|
+
{
|
135
|
+
'brand' => [
|
136
|
+
{
|
137
|
+
id: 'playsam',
|
138
|
+
name: 'Playsam, Inc',
|
139
|
+
website: 'http://www.playsam.com',
|
140
|
+
logo: Links::Asset.new('playsam_image')
|
141
|
+
},
|
142
|
+
{
|
143
|
+
id: 'normann',
|
144
|
+
name: "Normann Copenhagen, Inc",
|
145
|
+
website: 'http://www.normann-copenhagen.com/',
|
146
|
+
logo: Links::Asset.new('normann_image')
|
147
|
+
}
|
148
|
+
],
|
149
|
+
'category' => [
|
150
|
+
{
|
151
|
+
id: 'toys',
|
152
|
+
title: 'Toys',
|
153
|
+
description: 'Toys for children',
|
154
|
+
icon: Links::Asset.new('toy_image')
|
155
|
+
},
|
156
|
+
{
|
157
|
+
id: 'kitchen',
|
158
|
+
title: 'House and Kitchen',
|
159
|
+
description: 'House and Kitchen accessories',
|
160
|
+
icon: Links::Asset.new('kitchen_image')
|
161
|
+
}
|
162
|
+
],
|
163
|
+
'product' => [
|
164
|
+
{
|
165
|
+
id: 'playsam_car',
|
166
|
+
name: 'Playsam Streamliner Classic Car, Espresso',
|
167
|
+
description: "A classic Playsam design, the Streamliner Classic Car has been selected as Swedish Design Classic by the Swedish National Museum for its inventive style and sleek surface. It's no wonder that this wooden car has also been a long-standing favorite for children both big and small!",
|
168
|
+
image: Links::Asset.new('toy_car'),
|
169
|
+
brand: Links::Entry.new('playsam'),
|
170
|
+
category: Links::Entry.new('toys'),
|
171
|
+
url: 'http://www.amazon.com/dp/B001R6JUZ2/'
|
172
|
+
},
|
173
|
+
{
|
174
|
+
id: 'whisk_beater',
|
175
|
+
name: 'Whisk Beater',
|
176
|
+
description: "A creative little whisk that comes in 8 different colors. Handy and easy to clean after use. A great gift idea.",
|
177
|
+
image: Links::Asset.new('whiskers'),
|
178
|
+
brand: Links::Entry.new('normann'),
|
179
|
+
category: Links::Entry.new('kitchen'),
|
180
|
+
url: 'http://www.amazon.com/dp/B0081F2CCK/'
|
181
|
+
}
|
182
|
+
]
|
183
|
+
}
|
184
|
+
end
|
6
185
|
end
|
7
186
|
end
|
8
187
|
end
|