middleman-scaffold 0.0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 177d5af1b84da676f7e4f27e4fec11d3b04ccdbe
4
+ data.tar.gz: 69c93b52ee08d237f6ac2b4603e1f96b9f52f4ed
5
+ SHA512:
6
+ metadata.gz: 4e0f836e5e3ccdca33c91f0786b290bd4856e60fe1a2ca291c43665e20714d2f987759f19c770657e7620f1aa6b09737755a06e24957d72f76589e149c2bc1ea
7
+ data.tar.gz: 481f3ad194e586464564a75fdab62d615d11c7ebc86b01f08c82ccf81bd6ed8357a9e6fb582968e00f7f03369027a6d8d7fadfe8c11238cc716d33c5fe108bf5
data/.gitignore ADDED
@@ -0,0 +1,20 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.swp
19
+ .DS_Store
20
+ spec/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+ gem "slim", "~> 1.3.6"
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 nao iwata
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # Middleman::Scaffold
2
+
3
+ `middleman-scaffold` is an extension for the [Middleman] static site generator that adds support for Slim, Sass, Coffeescript, Live-reload.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ $ gem install middleman
10
+ $ gem install middleman-scaffold
11
+ $ middleman init MY_PROJECT --template scaffold
12
+
13
+ If you already have a Middleman project: Add `gem "middleman-scaffold"` to your `Gemfile` and run `bundle install`
14
+
15
+ And then execute:
16
+
17
+ $ cd MY_PROJECT
18
+ $ bundle install --path vendor/bundle
19
+
20
+ ## Usage
21
+
22
+ # run local server
23
+ $ bundle exec middleman server
24
+ # build html
25
+ $ bundle exec middleman build
26
+ # deploy build html
27
+ $ bundle exec middleman deploy
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,6 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem "middleman", "~><%= Middleman::VERSION %>"
4
+ gem "slim", "~> 2.0.0"
5
+ gem "middleman-livereload", "~> 3.1.0"
6
+ gem "middleman-deploy", "~> 0.1.2"
@@ -0,0 +1,114 @@
1
+ ###
2
+ # Compass
3
+ ###
4
+
5
+ # Susy grids in Compass
6
+ # First: gem install susy --pre
7
+ # require 'susy'
8
+
9
+ # Change Compass configuration
10
+ # compass_config do |config|
11
+ # config.output_style = :compact
12
+ # end
13
+
14
+ ###
15
+ # Page options, layouts, aliases and proxies
16
+ ###
17
+
18
+ # Slim settings
19
+ # Set slim-lang output style
20
+ Slim::Engine.set_default_options :pretty => true
21
+ # Set Shortcut
22
+ Slim::Engine.set_default_options :shortcut => {
23
+ '#' => {:tag => 'div', :attr => 'id'},
24
+ '.' => {:tag => 'div', :attr => 'class'},
25
+ '&' => {:tag => 'input', :attr => 'type'}
26
+ }
27
+
28
+ # Per-page layout changes:
29
+ #
30
+ # With no layout
31
+ # page "/path/to/file.html", :layout => false
32
+ #
33
+ # With alternative layout
34
+ # page "/path/to/file.html", :layout => :otherlayout
35
+ #
36
+ # A path which all have the same layout
37
+ # with_layout :admin do
38
+ # page "/admin/*"
39
+ # end
40
+
41
+ # Proxy (fake) files
42
+ # page "/this-page-has-no-template.html", :proxy => "/template-file.html" do
43
+ # @which_fake_page = "Rendering a fake page with a variable"
44
+ # end
45
+
46
+ ###
47
+ # Helpers
48
+ ###
49
+
50
+ # Automatic image dimensions on image_tag helper
51
+ activate :automatic_image_sizes
52
+
53
+ # Methods defined in the helpers block are available in templates
54
+ # helpers do
55
+ # def some_helper
56
+ # "Helping"
57
+ # end
58
+ # end
59
+
60
+ # set file names
61
+ set :css_dir, 'css'
62
+ set :js_dir, 'js'
63
+ set :images_dir, 'img'
64
+
65
+ # livereload your browser, Firefox/Google Chrome/Safari
66
+ activate :livereload
67
+
68
+ # Build-specific configuration
69
+ configure :build do
70
+ # For example, change the Compass output style for deployment
71
+ activate :minify_css
72
+
73
+ # Minify Javascript on build
74
+ activate :minify_javascript
75
+
76
+ # Enable cache buster
77
+ activate :cache_buster
78
+
79
+ # Use relative URLs
80
+ activate :relative_assets
81
+
82
+ # Compress PNGs after build
83
+ # First: gem install middleman-smusher
84
+ # require "middleman-smusher"
85
+ # activate :smusher
86
+
87
+ # Or use a different image path
88
+ # set :http_path, "/Content/images/"
89
+ end
90
+
91
+ # Deploy-specific configuration
92
+ activate :deploy do |deploy|
93
+ deploy.build_before = true # default: false
94
+
95
+ # git
96
+ # deploy.method = :git
97
+ # Optional Settings
98
+ # deploy.remote = "custom-remote" # remote name or git url, default: origin
99
+ # deploy.branch = "custom-branch" # default: gh-pages
100
+
101
+ # ftp
102
+ # deploy.method = :ftp
103
+ # deploy.host = "ftp.example.com"
104
+ # deploy.user = "tvaughan"
105
+ # deploy.password = "secret"
106
+ # deploy.path = "/srv/www/site"
107
+
108
+ # sftp
109
+ # deploy.method = :sftp
110
+ # deploy.host = "ftp.example.com"
111
+ # deploy.user = "tvaughan"
112
+ # deploy.password = "secret"
113
+ # deploy.path = "/srv/www/site"
114
+ end
@@ -0,0 +1,16 @@
1
+ @charset "utf-8"
2
+
3
+ body
4
+ background: #d4d4d4
5
+ text-align: center
6
+ font-family: sans-serif
7
+
8
+ #wrap
9
+ width: 640px
10
+ margin : 0 auto
11
+
12
+ .welcome
13
+ color: #777
14
+ a
15
+ color: #777
16
+
@@ -0,0 +1,42 @@
1
+ html, body, div, span, applet, object, iframe,
2
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
3
+ a, abbr, acronym, address, big, cite, code,
4
+ del, dfn, em, img, ins, kbd, q, s, samp,
5
+ small, strike, strong, sub, sup, tt, var,
6
+ b, u, i, center,
7
+ dl, dt, dd, ol, ul, li,
8
+ fieldset, form, label, legend,
9
+ table, caption, tbody, tfoot, thead, tr, th, td,
10
+ article, aside, canvas, details, embed,
11
+ figure, figcaption, footer, header, hgroup,
12
+ menu, nav, output, ruby, section, summary,
13
+ time, mark, audio, video
14
+ margin: 0
15
+ padding: 0
16
+ border: 0
17
+ font-size: 100%
18
+ font: inherit
19
+ vertical-align: baseline
20
+
21
+ /* HTML5 display-role reset for older browsers */
22
+ article, aside, details, figcaption, figure,
23
+ footer, header, hgroup, menu, nav, section
24
+ display: block
25
+
26
+ body
27
+ line-height: 1
28
+
29
+ ol, ul
30
+ list-style: none
31
+
32
+ blockquote, q
33
+ quotes: none
34
+
35
+ blockquote:before, blockquote:after,
36
+ q:before, q:after
37
+ content: ''
38
+ content: none
39
+
40
+ table
41
+ border-collapse: collapse
42
+ border-spacing: 0
@@ -0,0 +1,6 @@
1
+ .welcome
2
+ h1 Middleman is Watching
3
+ h2
4
+ == image_tag "middleman.png"
5
+ p.doc
6
+ == link_to "Read Online Documentation" "http://middlemanapp.com/"
@@ -0,0 +1,3 @@
1
+ #= require_tree .
2
+
3
+ console.info 'hello middleman-scaffold :)'
@@ -0,0 +1,19 @@
1
+ doctype html
2
+ html
3
+ head
4
+ meta charset="utf-8"
5
+ /! meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"
6
+ meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"
7
+ title "The Middleman Scaffold"
8
+ meta type="keyword" content=""
9
+ meta type="description" content=""
10
+ /![if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>[endif]
11
+
12
+ == stylesheet_link_tag "reset", "all"
13
+ == javascript_include_tag "all"
14
+
15
+ body class="#{page_classes}"
16
+ #wrap
17
+ == partial 'layouts/header'
18
+ == yield
19
+ == partial 'layouts/footer'
@@ -0,0 +1,57 @@
1
+ require 'middleman-core/templates'
2
+
3
+ module Middleman
4
+ module Scaffold
5
+
6
+ class Template < Middleman::Templates::Base
7
+ class_option 'css_dir',
8
+ default: 'css',
9
+ desc: 'The path to the css files'
10
+ class_option 'js_dir',
11
+ default: 'js',
12
+ desc: 'The path to the javascript files'
13
+ class_option 'images_dir',
14
+ default: 'img',
15
+ desc: 'The path to the image files'
16
+
17
+ def self.source_root
18
+ File.join(File.dirname(__FILE__), 'template')
19
+ end
20
+
21
+ def build_scaffold
22
+ template 'shared/Gemfile', File.join(location, 'Gemfile')
23
+ template 'shared/config.rb', File.join(location, 'config.rb')
24
+ copy_file 'source/index.html.slim', File.join(location, 'source/index.html.slim')
25
+ copy_file 'source/layouts/layout.slim', File.join(location, 'source/layouts/layout.slim')
26
+ copy_file 'source/layouts/_header.slim', File.join(location, 'source/layouts/_header.slim')
27
+ copy_file 'source/layouts/_footer.slim', File.join(location, 'source/layouts/_footer.slim')
28
+
29
+ empty_directory File.join(location, 'source', options[:css_dir])
30
+ copy_file 'source/css/all.css.sass', File.join(location, 'source', options[:css_dir], 'all.css.sass')
31
+ copy_file 'source/css/reset.css.sass', File.join(location, 'source', options[:css_dir], 'reset.css.sass')
32
+
33
+ empty_directory File.join(location, 'source', options[:js_dir])
34
+ copy_file 'source/js/all.js.coffee', File.join(location, 'source', options[:js_dir], 'all.js.coffee')
35
+
36
+ empty_directory File.join(location, 'source', options[:images_dir])
37
+ copy_file 'source/img/background.png', File.join(location, 'source', options[:images_dir], 'background.png')
38
+ copy_file 'source/img/middleman.png', File.join(location, 'source', options[:images_dir], 'middleman.png')
39
+ replace_css_img_dir
40
+ end
41
+
42
+ private
43
+ def replace_css_img_dir
44
+ f = File.open(File.join(location, 'source', options[:css_dir], 'all.css.sass'), 'r')
45
+ buf = f.read
46
+ buf.gsub!(/IMG_DIR/, options[:images_dir])
47
+ f.close
48
+
49
+ f = File.open(File.join(location, 'source', options[:css_dir], 'all.css.sass'), 'w')
50
+ f.write(buf)
51
+ f.close
52
+ end
53
+ end
54
+ end
55
+ end
56
+
57
+ Middleman::Templates.register :scaffold, Middleman::Scaffold::Template
@@ -0,0 +1,5 @@
1
+ module Middleman
2
+ module Scaffold
3
+ VERSION = "0.0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ require 'middleman-core'
2
+
3
+ require 'middleman-scaffold/version'
4
+ require 'middleman-scaffold/template'
5
+
6
+ Middleman::Templates.register :scaffold, Middleman::Scaffold::Template
@@ -0,0 +1 @@
1
+ require 'middleman-scaffold'
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'middleman-scaffold/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "middleman-scaffold"
8
+ spec.version = Middleman::Scaffold::VERSION
9
+ spec.authors = ["naoiwata"]
10
+ spec.email = ["orrrizzle@gmail.com"]
11
+ spec.description = %q{A Middleman template.}
12
+ spec.summary = %q{A Middleman template using Slim, Sass, Coffeescript.}
13
+ spec.homepage = "https://github.com/naoiwata/middleman-scaffold"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "slim", "~> 2.0.0"
22
+ spec.add_development_dependency "middleman-core", "~> 3.1.0"
23
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: middleman-scaffold
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - naoiwata
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-11-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: slim
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.0
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 2.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: middleman-core
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 3.1.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 3.1.0
41
+ description: A Middleman template.
42
+ email:
43
+ - orrrizzle@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE
51
+ - README.md
52
+ - Rakefile
53
+ - lib/middleman-scaffold.rb
54
+ - lib/middleman-scaffold/template.rb
55
+ - lib/middleman-scaffold/template/shared/Gemfile
56
+ - lib/middleman-scaffold/template/shared/config.rb
57
+ - lib/middleman-scaffold/template/source/css/.gitkeep
58
+ - lib/middleman-scaffold/template/source/css/all.css.sass
59
+ - lib/middleman-scaffold/template/source/css/reset.css.sass
60
+ - lib/middleman-scaffold/template/source/img/.gitkeep
61
+ - lib/middleman-scaffold/template/source/img/background.png
62
+ - lib/middleman-scaffold/template/source/img/middleman.png
63
+ - lib/middleman-scaffold/template/source/index.html.slim
64
+ - lib/middleman-scaffold/template/source/js/.gitkeep
65
+ - lib/middleman-scaffold/template/source/js/all.js.coffee
66
+ - lib/middleman-scaffold/template/source/layouts/.gitkeep
67
+ - lib/middleman-scaffold/template/source/layouts/_footer.slim
68
+ - lib/middleman-scaffold/template/source/layouts/_header.slim
69
+ - lib/middleman-scaffold/template/source/layouts/layout.slim
70
+ - lib/middleman-scaffold/version.rb
71
+ - lib/middleman_extension.rb
72
+ - middleman-scaffold.gemspec
73
+ homepage: https://github.com/naoiwata/middleman-scaffold
74
+ licenses:
75
+ - MIT
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.1.3
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: A Middleman template using Slim, Sass, Coffeescript.
97
+ test_files: []