dugway 0.10.2 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +27 -7
- data/README.md +82 -55
- data/lib/dugway.rb +1 -1
- data/lib/dugway/cli/create.rb +1 -0
- data/lib/dugway/cli/templates/config.tt +8 -18
- data/lib/dugway/cli/templates/dugway.tt +27 -0
- data/lib/dugway/cli/templates/gitignore.tt +1 -0
- data/lib/dugway/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: 826b2f5eb8927caa43d20178107cad6e51811bb4
|
4
|
+
data.tar.gz: 04baf16d2887144b19ae7664f7079df41f496577
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c1e3f431703966b86aedb8e8291c0b8d315e28e6f60f54577d589704dc6214f0bed02eb125776816abe59c94149accae6e16a1dd189cef86216292434e95de3
|
7
|
+
data.tar.gz: f596dfb2520ea4f54e306c6b28ca94f676b6b1b789f1250b1676c417099c4e7593c19db3798e7b3775898cbf0b9a7f2d870c1be930d90ef42ae9371510b5b0e6
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,16 +1,36 @@
|
|
1
1
|
## Version History
|
2
2
|
|
3
|
+
#### 0.10.3
|
4
|
+
|
5
|
+
* Added `.dugway.json` as a better way to [test your theme](https://github.com/bigcartel/dugway#testing-your-theme) without needing to modify `config.ru`
|
6
|
+
|
7
|
+
#### 0.10.2
|
8
|
+
|
9
|
+
* Misc bug fixes and improvements
|
10
|
+
|
11
|
+
#### 0.10.1
|
12
|
+
|
13
|
+
* Misc bug fixes and improvements
|
14
|
+
|
15
|
+
#### 0.10.0
|
16
|
+
|
17
|
+
* Added support for default images in `settings.json`
|
18
|
+
|
3
19
|
#### 0.9.0
|
4
|
-
|
5
|
-
|
6
|
-
|
20
|
+
|
21
|
+
* Added support for `theme_font_url` liquid filter
|
22
|
+
* Added fonts directory, serve fonts from there
|
23
|
+
* `dugway build` will include font files in the zip
|
7
24
|
|
8
25
|
#### 0.8.4
|
9
|
-
|
10
|
-
|
26
|
+
|
27
|
+
* Support `image_sets` in `settings.json`
|
28
|
+
* Support the new [constrain](http://help.bigcartel.com/developers/themes/#constrainurl-width-height) filter
|
11
29
|
|
12
30
|
#### 0.7.0
|
13
|
-
|
31
|
+
|
32
|
+
* Rename `scripts.js` and `styles.css` to `theme.js` and `theme.css`
|
14
33
|
|
15
34
|
#### Pre-0.7.0
|
16
|
-
|
35
|
+
|
36
|
+
* Initial launch and bug fixes
|
data/README.md
CHANGED
@@ -20,41 +20,46 @@ Dugway allows you to run your Big Cartel theme on your computer, test it in any
|
|
20
20
|
|
21
21
|
Dugway is Ruby gem so you'll need to have Ruby 1.9.3+ installed. Ruby is usually pre-installed on Mac OS X and Linux, and Windows users can install it using [RubyInstaller](http://rubyinstaller.org). From there, simply install the **dugway** gem from the terminal.
|
22
22
|
|
23
|
-
|
23
|
+
```
|
24
|
+
gem install dugway
|
25
|
+
```
|
24
26
|
|
25
27
|
## Creating a new theme
|
26
28
|
|
27
29
|
With Dugway installed, you can now create a new theme, simply give it a name.
|
28
30
|
|
29
|
-
|
31
|
+
```
|
32
|
+
dugway create mytheme
|
33
|
+
```
|
30
34
|
|
31
35
|
This will create a new directory named *mytheme* that contains a few configuration files and a starter theme to get you going.
|
32
36
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
37
|
+
```
|
38
|
+
mytheme
|
39
|
+
├── source
|
40
|
+
| ├── fonts
|
41
|
+
│ │ └── all font files for your theme
|
42
|
+
│ ├── images
|
43
|
+
│ │ └── all image files for your theme
|
44
|
+
│ ├── javascripts
|
45
|
+
│ │ └── all JavaScript files for your theme
|
46
|
+
│ ├── stylesheets
|
47
|
+
│ │ └── all CSS files for your theme
|
48
|
+
│ ├── cart.html
|
49
|
+
│ ├── checkout.html
|
50
|
+
│ ├── contact.html
|
51
|
+
│ ├── home.html
|
52
|
+
│ ├── layout.html
|
53
|
+
│ ├── maintenance.html
|
54
|
+
│ ├── product.html
|
55
|
+
│ ├── products.html
|
56
|
+
│ ├── screenshot.jpg
|
57
|
+
│ ├── settings.json
|
58
|
+
│ ├── success.html
|
59
|
+
│ ├── theme.css
|
60
|
+
│ └── theme.js
|
61
|
+
└── config.ru
|
62
|
+
```
|
58
63
|
|
59
64
|
## Developing your theme
|
60
65
|
|
@@ -74,15 +79,19 @@ All CSS for your theme is handled by the **theme.css** file, and all JavaScript
|
|
74
79
|
|
75
80
|
##### theme.css
|
76
81
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
82
|
+
```css
|
83
|
+
/*
|
84
|
+
*= require stylesheets/example_1
|
85
|
+
*= require stylesheets/example_2
|
86
|
+
*/
|
87
|
+
```
|
81
88
|
|
82
89
|
##### theme.js
|
83
90
|
|
84
|
-
|
85
|
-
|
91
|
+
```js
|
92
|
+
//= require javascripts/example_1
|
93
|
+
//= require javascripts/example_2
|
94
|
+
```
|
86
95
|
|
87
96
|
#### Using Sass, Compass, LESS, and CoffeeScript
|
88
97
|
|
@@ -98,23 +107,31 @@ You can embed the CSS and JavaScript into your theme by passing the theme variab
|
|
98
107
|
|
99
108
|
##### CSS (theme.css)
|
100
109
|
|
101
|
-
|
110
|
+
```html
|
111
|
+
<link href="{{ theme | theme_css_url }}" media="screen" rel="stylesheet" type="text/css">
|
112
|
+
```
|
102
113
|
|
103
114
|
##### JavaScript (theme.js)
|
104
115
|
|
105
|
-
|
116
|
+
```html
|
117
|
+
<script src="{{ theme | theme_js_url }}" type="text/javascript"></script>
|
118
|
+
```
|
106
119
|
|
107
120
|
### Images
|
108
121
|
|
109
122
|
And as you've probably guessed by now, all images for your theme go in the **images** directory. You can reference an image in your code by passing its name to the [theme_image_url](http://help.bigcartel.com/developers/themes/#themeimageurlname) filter.
|
110
123
|
|
111
|
-
|
124
|
+
```
|
125
|
+
{{ 'sample.png' | theme_image_url }}
|
126
|
+
```
|
112
127
|
|
113
128
|
### Fonts
|
114
129
|
|
115
130
|
Fonts work more or less the same as images. Place font files (say if you have created a custom icon font) in the **fonts** directory. Reference them by passing its name to the `theme_font_url` filter. Please be aware of licensing restrictions. If you're using a font from a forge and don't have permission to host the files directly or have restrictions about only making them available to certain domains, you will need to use another mechanism for hosting your fonts. Any font uploaded as part of a Dugway bundle will essentialy be publicly available and not CORS-restricted to specific domains.
|
116
131
|
|
117
|
-
|
132
|
+
```
|
133
|
+
{{ 'myfont.woff' | theme_font_url }}
|
134
|
+
```
|
118
135
|
|
119
136
|
### Settings
|
120
137
|
|
@@ -124,7 +141,9 @@ Set your theme's name, version, and customizable options in the **settings.json*
|
|
124
141
|
|
125
142
|
Run your theme in any browser by starting the Dugway server:
|
126
143
|
|
127
|
-
|
144
|
+
```
|
145
|
+
dugway server
|
146
|
+
```
|
128
147
|
|
129
148
|
By default this will serve your theme at http://0.0.0.0:9292. You can then stop the server by hitting CTRL+C.
|
130
149
|
|
@@ -134,37 +153,45 @@ Tired of all the manual starting and stopping? Good news, Dugway is built on top
|
|
134
153
|
|
135
154
|
## Testing your theme
|
136
155
|
|
137
|
-
Part of building a great theme is making sure it works well in a variety of contexts and with a variety of content. Dugway makes it easy to test your theme's versatility by
|
156
|
+
Part of building a great theme is making sure it works well in a variety of contexts and with a variety of content. Dugway makes it easy to test your theme's versatility by utilizing the **.dugway.json** file. This file will be specific to your computer for your own testing, and shouldn't be checked into source control.
|
138
157
|
|
139
|
-
*Note:* changing
|
158
|
+
*Note:* changing **.dugway.json** will require you to restart the [server](#running-your-theme).
|
140
159
|
|
141
160
|
### Store content
|
142
161
|
|
143
|
-
The best way to see your theme under a different light is by previewing it with a different store's products, categories, pages, currency, and other content. To do this, simply set the
|
162
|
+
The best way to see your theme under a different light is by previewing it with a different store's products, categories, pages, currency, and other content. To do this, simply set the **store.subdomain** variable in **.dugway.json** to any Big Cartel store's subdomain, and Dugway will bring in their content using the standard [Big Cartel API](http://help.bigcartel.com/developers/api/). By default we use **dugway** for [dugway.bigcartel.com](http://dugway.bigcartel.com).
|
144
163
|
|
145
|
-
|
164
|
+
```json
|
165
|
+
"store": {
|
166
|
+
"subdomain": "beeteeth"
|
167
|
+
}
|
168
|
+
```
|
146
169
|
|
147
170
|
*Note:* don't worry, any sensitive data like inventory levels and discount codes is faked by Dugway.
|
148
171
|
|
149
172
|
### Store customization
|
150
173
|
|
151
|
-
Another important thing to consider is how store owners will customize your theme. You establish what can be customized in your [settings.json](#settings) file, and Dugway allows you to simulate potential values people could choose by setting them in the
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
174
|
+
Another important thing to consider is how store owners will customize your theme. You establish what can be customized in your [settings.json](#settings) file, and Dugway allows you to simulate potential values people could choose by setting them in the **customization** variable in **.dugway.json**. By default we use the **default** values from your **[settings.json](#settings)** file.
|
175
|
+
|
176
|
+
```json
|
177
|
+
"customization": {
|
178
|
+
"logo": {
|
179
|
+
"url": "http://placehold.it/200x50/000000/ffffff&text=My+Logo",
|
180
|
+
"width": 200,
|
181
|
+
"height": 50
|
182
|
+
},
|
183
|
+
"background_color": "#CCCCCC",
|
184
|
+
"show_search": true,
|
185
|
+
"twitter_username": "bigcartel"
|
186
|
+
}
|
187
|
+
```
|
163
188
|
|
164
189
|
## Building your theme
|
165
190
|
|
166
191
|
When you're finished with a new version of your theme, it's time to build it.
|
167
192
|
|
168
|
-
|
193
|
+
```
|
194
|
+
dugway build
|
195
|
+
```
|
169
196
|
|
170
197
|
This will create a zip file for the current version in your **build** directory containing all HTML, images, fonts, and packaged JS and CSS.
|
data/lib/dugway.rb
CHANGED
data/lib/dugway/cli/create.rb
CHANGED
@@ -1,22 +1,12 @@
|
|
1
1
|
require 'dugway'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
# options[:customization] = {
|
12
|
-
# :logo => {
|
13
|
-
# :url => 'http://placehold.it/200x50/000000/ffffff&text=My+Logo',
|
14
|
-
# :width => 200,
|
15
|
-
# :height => 50
|
16
|
-
# },
|
17
|
-
# :background_color => '#CCCCCC',
|
18
|
-
# :show_search => true,
|
19
|
-
# :twitter_username => 'mytwitter'
|
20
|
-
# }
|
3
|
+
begin
|
4
|
+
file = File.read('.dugway.json')
|
5
|
+
json = JSON.parse(file)
|
6
|
+
options = HashWithIndifferentAccess.new(json)
|
7
|
+
rescue Exception => e
|
8
|
+
puts e
|
9
|
+
options = {}
|
10
|
+
end
|
21
11
|
|
22
12
|
run Dugway.application(options)
|
@@ -0,0 +1,27 @@
|
|
1
|
+
// Use this file to test your theme with different stores and customization variations.
|
2
|
+
// Learn more at: // https://github.com/bigcartel/dugway#testing-your-theme
|
3
|
+
// DON'T CHECK THIS FILE INTO SOURCE CONTROL
|
4
|
+
|
5
|
+
{
|
6
|
+
|
7
|
+
// Use data from any store to make sure your theme looks great with all sorts of products, pages,
|
8
|
+
// categories, and more. Just give us the subdomain. Default is "dugway" for dugway.bigcartel.com.
|
9
|
+
|
10
|
+
// "store": {
|
11
|
+
// "subdomain": "mystore"
|
12
|
+
// },
|
13
|
+
|
14
|
+
// Simulate the customization done by store owners by passing values to different variables.
|
15
|
+
// Default values are based on the "default" for each setting in your settings.json.
|
16
|
+
|
17
|
+
// "customization": {
|
18
|
+
// "logo": {
|
19
|
+
// "url": "http://placehold.it/200x50/000000/ffffff&text=My+Logo",
|
20
|
+
// "width": 200,
|
21
|
+
// "height": 50
|
22
|
+
// },
|
23
|
+
// "background_color": "#CCCCCC",
|
24
|
+
// "show_search": true,
|
25
|
+
// "twitter_username": "bigcartel"
|
26
|
+
// }
|
27
|
+
}
|
data/lib/dugway/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dugway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Big Cartel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -415,6 +415,7 @@ files:
|
|
415
415
|
- lib/dugway/cli/create.rb
|
416
416
|
- lib/dugway/cli/server.rb
|
417
417
|
- lib/dugway/cli/templates/config.tt
|
418
|
+
- lib/dugway/cli/templates/dugway.tt
|
418
419
|
- lib/dugway/cli/templates/gitignore.tt
|
419
420
|
- lib/dugway/cli/templates/source/cart.html
|
420
421
|
- lib/dugway/cli/templates/source/checkout.html
|