starch 0.1.0 → 1.0.0
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 +40 -17
- data/Rakefile +0 -1
- data/features/new.feature +4 -0
- data/features/support/env.rb +1 -1
- data/lib/starch/version.rb +1 -1
- data/skel/Gruntfile.js +36 -5
- data/skel/app/pages/.empty_directory +0 -0
- data/skel/app/partials/.empty_directory +0 -0
- data/skel/app/templates/default.hbt +10 -0
- data/skel/package.json.tt +2 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c170d06a472a33880620fe55dbda11895d058cb2
|
4
|
+
data.tar.gz: e28d81bc0d32a6d945648b22a906e4e8cc236b3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41b9b3c242a16301d1476e16d5770aaa263d19f642895f814de8e4488c02188dbcd7a1b0139499b5d01219d6716957bcd7e4b9e3b7a348a6a31aaaa3b09cf7a5
|
7
|
+
data.tar.gz: 04bd45f2f50b61569abe2ac6c8d1de19bb977c06e4ee30dcd5f02865afc74e18ef8a8f894783d271b7c2bd30c3eff7553e2746d55bb95580133b626bf9fae380
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# Starch
|
2
|
+
[](http://badge.fury.io/rb/starch)
|
2
3
|
|
3
4
|
Starch is an opinionated skeleton generator for basic static site development.
|
4
5
|
It will get you going on new sites quickly by generating the meat and *potatoes*
|
@@ -7,6 +8,7 @@ of your toolchain. Starch gets you:
|
|
7
8
|
* A simple directory structure
|
8
9
|
* Barebones `bower.json` and `package.json` files for easily saving bower and
|
9
10
|
npm dependencies
|
11
|
+
* Templates and partials via Handlebars
|
10
12
|
* SASS compilation
|
11
13
|
* JS uglification
|
12
14
|
* Coffeescript compilation
|
@@ -30,27 +32,45 @@ To scaffold a new site named `mysite`:
|
|
30
32
|
Starch will create a directory `mysite` within the current directory that looks
|
31
33
|
like this:
|
32
34
|
|
33
|
-
mysite
|
34
35
|
├── Gruntfile.js
|
35
36
|
├── app
|
36
|
-
│
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
│
|
41
|
-
│
|
42
|
-
│
|
37
|
+
│ ├── assets
|
38
|
+
│ │ ├── files
|
39
|
+
│ │ ├── fonts
|
40
|
+
│ │ ├── images
|
41
|
+
│ │ ├── js
|
42
|
+
│ │ └── stylesheets
|
43
|
+
│ │ └── main.scss
|
44
|
+
│ ├── pages
|
45
|
+
│ ├── partials
|
46
|
+
│ └── templates
|
47
|
+
│ └── default.hbt
|
43
48
|
├── bower.json
|
44
49
|
├── node_modules
|
45
50
|
│ └── ...
|
46
51
|
└── package.json
|
47
52
|
|
48
|
-
* Your site's HTML
|
49
|
-
|
50
|
-
*
|
53
|
+
* Your site's HTML files should live in `app/assets/pages/` with `.html`
|
54
|
+
extensions.
|
55
|
+
* These files will be parsed with Handlebars.
|
56
|
+
* You can include a YAML block (in between two lines of `---`) at the top of
|
57
|
+
the file with frontmatter. The data provided here will be available in the
|
58
|
+
file and in the file's template.
|
59
|
+
* Partials should live in `app/assets/partials/` with `.hbp` extensions.
|
60
|
+
* You can use partials in your HTML files and in your templates in standard
|
61
|
+
Handlebars fashion ( `{{> my-partial-name}}` ).
|
62
|
+
* If you want to use a partial that is deeply nested, you don't need to
|
63
|
+
specify the path - just use the partial's name.
|
64
|
+
* Templates should live in `app/assets/templates/` with `.hbt` extensions.
|
65
|
+
* `default.hbt` is the default template and needs to exist, otherwise you're
|
66
|
+
gonna have a bad time.
|
67
|
+
* You can change the template that a given `.html` file uses by specifying
|
68
|
+
`template: some-template-name` in the file's frontmatter.
|
69
|
+
* Use `{{{body}}}` in your templates where the HTML should be rendered.
|
70
|
+
* Javascript and Coffeescript should live in `app/assets/js/`.
|
51
71
|
* Javascript files should have a `.js` extension and Coffeescript files should
|
52
|
-
have a `.coffee` extension
|
53
|
-
* SASS should live in `app/assets/stylesheets
|
72
|
+
have a `.coffee` extension.
|
73
|
+
* SASS should live in `app/assets/stylesheets/`.
|
54
74
|
* The only SASS file that will be compiled is
|
55
75
|
`app/assets/stylesheets/main.scss`. This file should be used to import the
|
56
76
|
rest of your SASS.
|
@@ -58,10 +78,13 @@ like this:
|
|
58
78
|
and `files` (all in `app/assets`), respectively. These files will be copied
|
59
79
|
1:1 without any additional processing.
|
60
80
|
|
61
|
-
|
62
|
-
|
81
|
+
When your site is staged or built, the `assets` directory will be placed in the
|
82
|
+
root of the destination directory, alongside the rendered contents of the
|
83
|
+
`pages` directory. For example, `app/pages/index.html` will end up as
|
84
|
+
`/index.html`, and you can reference assets in your site like:
|
85
|
+
`/assets/images/spuds.png`.
|
63
86
|
|
64
|
-
### Grunt tasks
|
87
|
+
### Grunt tasks - staging, building, cleaning
|
65
88
|
|
66
89
|
The entirety of the Starch toolchain is accessible through
|
67
90
|
[Grunt](http://gruntjs.com). There are quite a few tasks defined in the
|
@@ -85,7 +108,7 @@ generated Gruntfile (or anything else) to meet the requirements of your project.
|
|
85
108
|
|
86
109
|
## Contributing
|
87
110
|
|
88
|
-
1. Fork it ( https://github.com/
|
111
|
+
1. Fork it ( https://github.com/brianokeefe/starch/fork )
|
89
112
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
90
113
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
91
114
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/Rakefile
CHANGED
data/features/new.feature
CHANGED
@@ -11,11 +11,15 @@ Feature: scaffolding a site
|
|
11
11
|
| foo/app/assets/images |
|
12
12
|
| foo/app/assets/js |
|
13
13
|
| foo/app/assets/stylesheets |
|
14
|
+
| foo/app/pages |
|
15
|
+
| foo/app/partials |
|
16
|
+
| foo/app/templates |
|
14
17
|
And the following files should exist:
|
15
18
|
| foo/Gruntfile.js |
|
16
19
|
| foo/package.json |
|
17
20
|
| foo/bower.json |
|
18
21
|
| foo/app/assets/stylesheets/main.scss |
|
22
|
+
| foo/app/templates/default.hbt |
|
19
23
|
And the file "foo/package.json" should contain:
|
20
24
|
"""
|
21
25
|
"name": "foo",
|
data/features/support/env.rb
CHANGED
data/lib/starch/version.rb
CHANGED
data/skel/Gruntfile.js
CHANGED
@@ -26,7 +26,7 @@ module.exports = function(grunt) {
|
|
26
26
|
files: [{
|
27
27
|
expand: true,
|
28
28
|
cwd: 'app',
|
29
|
-
src:
|
29
|
+
src: 'assets/{files,fonts,images}/**/*',
|
30
30
|
dest: 'staging'
|
31
31
|
}]
|
32
32
|
},
|
@@ -34,7 +34,7 @@ module.exports = function(grunt) {
|
|
34
34
|
files: [{
|
35
35
|
expand: true,
|
36
36
|
cwd: 'app',
|
37
|
-
src:
|
37
|
+
src: 'assets/{files,fonts,images}/**/*',
|
38
38
|
dest: 'public_html'
|
39
39
|
}]
|
40
40
|
}
|
@@ -49,6 +49,31 @@ module.exports = function(grunt) {
|
|
49
49
|
}
|
50
50
|
}
|
51
51
|
},
|
52
|
+
generator: {
|
53
|
+
options: {
|
54
|
+
defaultTemplate: 'default',
|
55
|
+
frontmatterType: 'yaml',
|
56
|
+
partialsGlob: 'app/partials/**/*.hbp',
|
57
|
+
templateExt: 'hbt',
|
58
|
+
templates: 'app/templates'
|
59
|
+
},
|
60
|
+
staging: {
|
61
|
+
files: [{
|
62
|
+
cwd: 'app/pages',
|
63
|
+
src: '**/*.html',
|
64
|
+
dest: 'staging',
|
65
|
+
ext: '.html'
|
66
|
+
}]
|
67
|
+
},
|
68
|
+
build: {
|
69
|
+
files: [{
|
70
|
+
cwd: 'app/pages',
|
71
|
+
src: '**/*.html',
|
72
|
+
dest: 'public_html',
|
73
|
+
ext: '.html'
|
74
|
+
}]
|
75
|
+
}
|
76
|
+
},
|
52
77
|
sass: {
|
53
78
|
staging: {
|
54
79
|
files: [{
|
@@ -96,6 +121,11 @@ module.exports = function(grunt) {
|
|
96
121
|
tasks: 'coffee:staging',
|
97
122
|
options: { livereload: true }
|
98
123
|
},
|
124
|
+
html: {
|
125
|
+
files: 'app/{pages,partials,templates}/**/*',
|
126
|
+
tasks: ['generator:staging'],
|
127
|
+
options: { livereload: true }
|
128
|
+
},
|
99
129
|
js: {
|
100
130
|
files: 'app/assets/js/**/*.js',
|
101
131
|
tasks: ['uglify:staging'],
|
@@ -107,7 +137,7 @@ module.exports = function(grunt) {
|
|
107
137
|
options: { livereload: true }
|
108
138
|
},
|
109
139
|
static: {
|
110
|
-
files:
|
140
|
+
files: 'app/assets/{files,fonts,images}/**/*',
|
111
141
|
tasks: ['copy:staging'],
|
112
142
|
options: { livereload: true }
|
113
143
|
}
|
@@ -121,9 +151,10 @@ module.exports = function(grunt) {
|
|
121
151
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
122
152
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
123
153
|
grunt.loadNpmTasks('grunt-express');
|
154
|
+
grunt.loadNpmTasks('grunt-generator');
|
124
155
|
|
125
156
|
grunt.registerTask('serve', ['stage', 'express', 'watch']);
|
126
|
-
grunt.registerTask('stage', ['clean:staging', 'copy:staging', 'sass:staging', 'coffee:staging', 'uglify:staging']);
|
127
|
-
grunt.registerTask('build', ['clean:build', 'copy:build', 'sass:build', 'coffee:build', 'uglify:build']);
|
157
|
+
grunt.registerTask('stage', ['clean:staging', 'generator:staging', 'copy:staging', 'sass:staging', 'coffee:staging', 'uglify:staging']);
|
158
|
+
grunt.registerTask('build', ['clean:build', 'generator:build', 'copy:build', 'sass:build', 'coffee:build', 'uglify:build']);
|
128
159
|
};
|
129
160
|
|
File without changes
|
File without changes
|
data/skel/package.json.tt
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: starch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian O'Keefe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -93,6 +93,9 @@ files:
|
|
93
93
|
- skel/app/assets/images/.empty_directory
|
94
94
|
- skel/app/assets/js/.empty_directory
|
95
95
|
- skel/app/assets/stylesheets/main.scss
|
96
|
+
- skel/app/pages/.empty_directory
|
97
|
+
- skel/app/partials/.empty_directory
|
98
|
+
- skel/app/templates/default.hbt
|
96
99
|
- skel/bower.json.tt
|
97
100
|
- skel/package.json.tt
|
98
101
|
- starch.gemspec
|