smallvictories 0.0.12 → 0.0.13
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/README.md +19 -7
- data/lib/smallvictories/compiler.rb +3 -1
- data/lib/smallvictories/version.rb +1 -1
- data/spec/builder_spec.rb +1 -1
- data/spec/compiler_spec.rb +6 -1
- data/spec/configuration_spec.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: 966e2ee0f8881035c9d3afa19586e41c66650fe5
|
4
|
+
data.tar.gz: 8152940979805c2ed96708a517cee27b8ed70fa4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15bf9c69e085db8a2ea9a6f9ed951d72305d6a0c31130c7e01310d74235a1f503ac17d0094d27e94fc0d3d32b00b2dda279b7928b6327072b06c1e91cbd3b712
|
7
|
+
data.tar.gz: c3cd754db14b09c714ca25739fa7b9db114e17ce6dd47ed4044e91aab57147357f81a7f181128214ddd6136876f3a3ead4d20716e2d13971a23438b0e45ebd41
|
data/README.md
CHANGED
@@ -82,13 +82,13 @@ Command: `sv watch`
|
|
82
82
|
### Default Folder Structure
|
83
83
|
|
84
84
|
The default setup for Small Victories is to have your production files in the
|
85
|
-
root and your development files in the `
|
85
|
+
root and your development files in the `_sv` directory.
|
86
86
|
|
87
87
|
```text
|
88
88
|
Dropbox
|
89
89
|
└── Small Victories
|
90
90
|
└── Your Site
|
91
|
-
└──
|
91
|
+
└── _sv
|
92
92
|
│ ├── _includes
|
93
93
|
│ │ └── _head.liquid
|
94
94
|
│ ├── _sprite
|
@@ -97,7 +97,6 @@ Dropbox
|
|
97
97
|
│ ├── application.js
|
98
98
|
│ ├── index.liquid
|
99
99
|
│ └── sprite.css
|
100
|
-
│
|
101
100
|
├── _sv_custom.css
|
102
101
|
├── _sv_custom.js
|
103
102
|
├── _sv_sprite.png
|
@@ -105,7 +104,7 @@ Dropbox
|
|
105
104
|
```
|
106
105
|
|
107
106
|
You would then run `sv watch` from within `Your Site` and Small Victories will
|
108
|
-
watch for changes in `
|
107
|
+
watch for changes in `_sv` and compile them to the `Your Site` folder.
|
109
108
|
|
110
109
|
## How does it work with Small Victories?
|
111
110
|
|
@@ -135,7 +134,7 @@ And finally:
|
|
135
134
|
With the default config, Small Victories will watch and compile your files into
|
136
135
|
the root of your site folder.
|
137
136
|
|
138
|
-
## Why is there
|
137
|
+
## Why is there no web server?
|
139
138
|
|
140
139
|
There are other static site generators (like [Jekyll](http://jekyllrb.com/) or [Middleman](https://middlemanapp.com/)) that you can use to fire up a web server (and more!), Small Victories helps you build a static site for hosting on Small Victories, so if you don't need anything more than a static HTML file that can be dropped into your Small Victories folder.
|
141
140
|
|
@@ -146,18 +145,21 @@ run from.
|
|
146
145
|
|
147
146
|
You can set the following options:
|
148
147
|
|
149
|
-
+ `source`: Relative path to find and watch files for
|
148
|
+
+ `source`: Relative path to find and watch files for watching and compiling.
|
150
149
|
+ `destination`: Relative path for where to save final files.
|
151
150
|
+ `stylesheet`: Main stylesheet (Sass or CSS) to be compiled into destination.
|
152
151
|
+ `javascript`: Main javascript file (JS or CoffeeScript) to be compiled into destination.
|
153
152
|
+ `layout`: Liquid layout file to render all other html and liquid files through.
|
154
153
|
+ `includes`: Directory where liquid rendered should expect to find snippets.
|
154
|
+
+ `compile_css`: Should Small Victories compile Sass/css? Default is true.
|
155
|
+
+ `compile_js`: Should Small Victories compile CoffeeScript/JavaScript? Default is true.
|
155
156
|
+ `compile_html`: Should Small Victories compile HTML? Default is true.
|
157
|
+
+ `compile_sprite`: Should Small Victories compile Sprite? Default is true.
|
156
158
|
|
157
159
|
### Default Configuration
|
158
160
|
|
159
161
|
```yaml
|
160
|
-
source: '
|
162
|
+
source: '_sv'
|
161
163
|
destination: ''
|
162
164
|
source_stylesheet: 'application.css'
|
163
165
|
source_javascript: 'application.js'
|
@@ -167,6 +169,16 @@ layout: '_layout.liquid'
|
|
167
169
|
includes: '_includes'
|
168
170
|
compile_html: true
|
169
171
|
```
|
172
|
+
## What if I want to use Liquid tags on Small Victories?
|
173
|
+
|
174
|
+
To keep liquid tags in your compiled html file for parsing on Small
|
175
|
+
Victories you should wrap the tag in a {% raw %} tag.
|
176
|
+
|
177
|
+
```liquid
|
178
|
+
{% raw %}
|
179
|
+
{{ my tag }}
|
180
|
+
{% endraw %}
|
181
|
+
```
|
170
182
|
|
171
183
|
## Building Locally
|
172
184
|
|
@@ -156,8 +156,10 @@ module SmallVictories
|
|
156
156
|
end
|
157
157
|
|
158
158
|
def sprite
|
159
|
+
sprite_directory = File.join(config.full_source_path, config.source_sprite)
|
160
|
+
return unless Dir.exists?(sprite_directory)
|
159
161
|
css = "@import 'rails-sass-images';\n"
|
160
|
-
css += SpriteFactory.run!(
|
162
|
+
css += SpriteFactory.run!(sprite_directory,
|
161
163
|
output_image: File.join(config.full_source_path, config.destination_sprite_file),
|
162
164
|
style: :scss,
|
163
165
|
margin: 20,
|
data/spec/builder_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe SmallVictories do
|
4
4
|
let(:builder) { SmallVictories::Builder.new(config: SmallVictories::Configuration.new) }
|
5
|
-
let(:files) { %w(fixtures/new/_sv_config.yml fixtures/new/.sv_guardfile fixtures/new/
|
5
|
+
let(:files) { %w(fixtures/new/_sv_config.yml fixtures/new/.sv_guardfile fixtures/new/_sv/index.liquid fixtures/new/_sv/application.css fixtures/new/_sv/application.js fixtures/new/_sv/_includes/_head.liquid fixtures/new/_sv/_layout.liquid fixtures/new/_sv/_sprite/empty.png) }
|
6
6
|
|
7
7
|
context 'with folder' do
|
8
8
|
it 'sets up default files' do
|
data/spec/compiler_spec.rb
CHANGED
@@ -134,7 +134,7 @@ describe SmallVictories do
|
|
134
134
|
|
135
135
|
context 'with invalid files' do
|
136
136
|
before do
|
137
|
-
|
137
|
+
allow_any_instance_of(SmallVictories::Configuration).to receive(:source).and_return('./spec/fixtures/invalid')
|
138
138
|
end
|
139
139
|
|
140
140
|
it 'does not generate a css file' do
|
@@ -151,6 +151,11 @@ describe SmallVictories do
|
|
151
151
|
compiler.compile_html
|
152
152
|
expect(File.open(destination_html).read).to include "<html>\n<h1>Index</h1>\nLiquid error: No such template 'snippet'\n\n</html>"
|
153
153
|
end
|
154
|
+
|
155
|
+
it 'ignores the sprite' do
|
156
|
+
compiler.compile_sprite
|
157
|
+
expect(File.exists?(destination_sprite_style)).to eq false
|
158
|
+
end
|
154
159
|
end
|
155
160
|
|
156
161
|
describe '#compile_sprite' do
|
data/spec/configuration_spec.rb
CHANGED