starch 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6b6a4173185bf8ea05853f031b42dbfac996ca55
4
- data.tar.gz: b37598511ef6e085c5627a7946f31523e37cd03d
3
+ metadata.gz: c170d06a472a33880620fe55dbda11895d058cb2
4
+ data.tar.gz: e28d81bc0d32a6d945648b22a906e4e8cc236b3c
5
5
  SHA512:
6
- metadata.gz: 41681de3cf1828e9b02b1952362d86d6694d85d3421e1edff66e0cc251d97e56d023a9c4c7677220ea96b9d866ac32cdcb2b91713a32aac71cf1193375348c31
7
- data.tar.gz: afa8d6c38037998b9e70bbd1db167642f1418c002f457deac637ad5f49a4e4923b893cb83b136710f2c88881f89ed4b702cc0486570244ca97717e247855445b
6
+ metadata.gz: 41b9b3c242a16301d1476e16d5770aaa263d19f642895f814de8e4488c02188dbcd7a1b0139499b5d01219d6716957bcd7e4b9e3b7a348a6a31aaaa3b09cf7a5
7
+ data.tar.gz: 04bd45f2f50b61569abe2ac6c8d1de19bb977c06e4ee30dcd5f02865afc74e18ef8a8f894783d271b7c2bd30c3eff7553e2746d55bb95580133b626bf9fae380
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Starch
2
+ [![Gem Version](https://badge.fury.io/rb/starch.svg)](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
- │   └── assets
37
- | ├── files
38
- | ├── fonts
39
- | ├── images
40
-    ├── js
41
-    └── stylesheets
42
-    └── main.scss
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 can live anywhere in the `app` directory (preferably outside
49
- of `assets`)
50
- * Javascript and Coffeescript should live in `app/assets/js/`
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
- By default, your site will be built 1:1 with the `app` directory, so you can
62
- reference assets in your site like: `/assets/images/spuds.png`.
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/[my-github-username]/starch/fork )
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
@@ -1,7 +1,6 @@
1
1
  require 'bundler/gem_tasks'
2
2
  require 'cucumber/rake/task'
3
3
 
4
- Bundler::GemHelper.install_tasks
5
4
  Cucumber::Rake::Task.new
6
5
 
7
6
  task :default => :cucumber
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",
@@ -1,6 +1,6 @@
1
1
  require 'aruba/cucumber'
2
2
 
3
3
  Before do
4
- @aruba_timeout_seconds = 30
4
+ @aruba_timeout_seconds = 60
5
5
  end
6
6
 
@@ -1,3 +1,3 @@
1
1
  module Starch
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.0"
3
3
  end
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: ['**/*.html', 'assets/{files,fonts,images}/**/*'],
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: ['**/*.html', 'assets/{files,fonts,images}/**/*'],
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: ['app/**/*.html', 'app/assets/{files,fonts,images}/**/*'],
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
@@ -0,0 +1,10 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <title>{{page.title}}</title>
5
+ </head>
6
+ <body>
7
+ {{{body}}}
8
+ </body>
9
+ </html>
10
+
data/skel/package.json.tt CHANGED
@@ -11,7 +11,8 @@
11
11
  "grunt-contrib-sass": "^0.7.3",
12
12
  "grunt-contrib-uglify": "^0.5.0",
13
13
  "grunt-contrib-watch": "^0.6.1",
14
- "grunt-express": "^1.4.0"
14
+ "grunt-express": "^1.4.0",
15
+ "grunt-generator": "^0.4.0"
15
16
  }
16
17
  }
17
18
 
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: 0.1.0
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-12 00:00:00.000000000 Z
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