awestruct 0.5.0 → 0.5.1a
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.
- data/lib/awestruct/cli/generate.rb +0 -1
- data/lib/awestruct/cli/init.rb +42 -11
- data/lib/awestruct/cli/manifest.rb +53 -5
- data/lib/awestruct/cli/options.rb +1 -1
- data/lib/awestruct/extensions/pipeline.rb +2 -2
- data/lib/awestruct/extensions/posts.rb +1 -1
- data/lib/awestruct/frameworks/base_Rakefile +194 -0
- data/lib/awestruct/frameworks/base_awestruct_ignore +2 -0
- data/lib/awestruct/frameworks/base_pipeline.rb +3 -2
- data/lib/awestruct/frameworks/base_site.yml +4 -0
- data/lib/awestruct/frameworks/bootstrap/base_index.html.haml +1 -1
- data/lib/awestruct/frameworks/foundation/base_index.html.haml +34 -0
- data/lib/awestruct/frameworks/foundation/base_layout.html.haml +58 -0
- data/lib/awestruct/frameworks/foundation/humans.txt +7 -0
- data/lib/awestruct/handlers/css_tilt_handler.rb +0 -1
- data/lib/awestruct/util/COPYING +19 -0
- data/lib/awestruct/version.rb +1 -1
- data/man/awestruct.1 +3 -2
- data/spec/posts_archive_spec.rb +5 -5
- metadata +38 -18
data/lib/awestruct/cli/init.rb
CHANGED
@@ -5,13 +5,18 @@ require 'sass/plugin'
|
|
5
5
|
module Awestruct
|
6
6
|
module CLI
|
7
7
|
class Init
|
8
|
+
|
9
|
+
def self.framework_path(path, framework = nil)
|
10
|
+
File.join [File.dirname(__FILE__), '..', 'frameworks', framework, path].compact
|
11
|
+
end
|
12
|
+
|
8
13
|
BASE_MANIFEST = Manifest.new {
|
9
14
|
mkdir( '_config' )
|
10
15
|
mkdir( '_layouts' )
|
11
16
|
mkdir( '_ext' )
|
12
|
-
copy_file( '_ext/pipeline.rb',
|
13
|
-
copy_file( '.awestruct_ignore',
|
14
|
-
copy_file( 'Rakefile',
|
17
|
+
copy_file( '_ext/pipeline.rb', Init.framework_path( 'base_pipeline.rb' ) )
|
18
|
+
copy_file( '.awestruct_ignore', Init.framework_path( 'base_awestruct_ignore' ) )
|
19
|
+
copy_file( 'Rakefile', Init.framework_path( 'base_Rakefile' ) )
|
15
20
|
mkdir( 'stylesheets' )
|
16
21
|
}
|
17
22
|
|
@@ -23,23 +28,49 @@ module Awestruct
|
|
23
28
|
|
24
29
|
def run()
|
25
30
|
manifest = Manifest.new( BASE_MANIFEST )
|
31
|
+
scaffold_name = @framework
|
32
|
+
lib = nil
|
33
|
+
case @framework
|
34
|
+
when 'compass'
|
35
|
+
scaffold_name = 'blueprint'
|
36
|
+
when 'bootstrap'
|
37
|
+
lib = 'bootstrap-sass'
|
38
|
+
when 'foundation'
|
39
|
+
lib = 'zurb-foundation'
|
40
|
+
when '960'
|
41
|
+
lib = 'ninesixty'
|
42
|
+
end
|
43
|
+
require lib unless lib.nil?
|
26
44
|
manifest.install_compass( @framework )
|
27
|
-
scaffold_name = ( @framework == 'compass' ? 'blueprint' : @framework )
|
28
45
|
if ( @scaffold )
|
29
|
-
manifest.copy_file( '
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
46
|
+
manifest.copy_file( '_config/site.yml', framework_path( 'base_site.yml' ), :overwrite => true )
|
47
|
+
manifest.copy_file( '_layouts/base.html.haml', framework_path( 'base_layout.html.haml', scaffold_name ) )
|
48
|
+
base_index = framework_path( 'base_index.html.haml', scaffold_name )
|
49
|
+
if File.file? base_index
|
50
|
+
manifest.copy_file( 'index.html.haml', base_index)
|
34
51
|
else
|
35
|
-
manifest.copy_file( 'index.html.haml',
|
36
|
-
|
52
|
+
manifest.copy_file( 'index.html.haml', framework_path( 'base_index.html.haml' ) )
|
53
|
+
end
|
54
|
+
|
55
|
+
humans_txt = framework_path( 'humans.txt' )
|
56
|
+
if File.file? humans_txt
|
57
|
+
manifest.copy_file( 'humans.txt', humans_txt, :overwrite => true )
|
37
58
|
end
|
59
|
+
|
38
60
|
manifest.touch_file( '_config/site.yml' )
|
61
|
+
manifest.add_requires( '_ext/pipeline.rb', [lib] ) unless lib.nil?
|
62
|
+
if scaffold_name == 'foundation'
|
63
|
+
manifest.remove_file( 'index.html' )
|
64
|
+
manifest.remove_file( 'MIT-LICENSE.txt' )
|
65
|
+
end
|
39
66
|
end
|
40
67
|
manifest.perform( @dir )
|
41
68
|
end
|
42
69
|
|
70
|
+
def framework_path(path, framework = nil)
|
71
|
+
Init.framework_path path, framework
|
72
|
+
end
|
73
|
+
|
43
74
|
end
|
44
75
|
end
|
45
76
|
end
|
@@ -29,7 +29,6 @@ class Compass::AppIntegration::StandAlone::Installer
|
|
29
29
|
rake
|
30
30
|
|
31
31
|
then visit your site at: http://localhost:4242
|
32
|
-
|
33
32
|
END
|
34
33
|
end
|
35
34
|
end
|
@@ -51,14 +50,22 @@ module Awestruct
|
|
51
50
|
steps << MkDir.new( path )
|
52
51
|
end
|
53
52
|
|
54
|
-
def copy_file(path, input_path)
|
55
|
-
steps << CopyFile.new( path, input_path )
|
53
|
+
def copy_file(path, input_path, opts = {})
|
54
|
+
steps << CopyFile.new( path, input_path, opts )
|
56
55
|
end
|
57
56
|
|
58
57
|
def touch_file(path)
|
59
58
|
steps << TouchFile.new(path)
|
60
59
|
end
|
61
60
|
|
61
|
+
def remove_file(path)
|
62
|
+
steps << RemoveFile.new(path)
|
63
|
+
end
|
64
|
+
|
65
|
+
def add_requires(path, libs = [])
|
66
|
+
steps << AddRequires.new(path, libs)
|
67
|
+
end
|
68
|
+
|
62
69
|
def install_compass(framework)
|
63
70
|
steps << InstallCompass.new(framework)
|
64
71
|
end
|
@@ -143,15 +150,56 @@ module Awestruct
|
|
143
150
|
end
|
144
151
|
end
|
145
152
|
|
153
|
+
class RemoveFile
|
154
|
+
def initialize(path)
|
155
|
+
@path = path
|
156
|
+
end
|
157
|
+
|
158
|
+
def perform(dir)
|
159
|
+
FileUtils.rm( File.join( dir, @path ), :force => true )
|
160
|
+
end
|
161
|
+
|
162
|
+
def unperform(dir)
|
163
|
+
#nothing
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
# Adds a requires for each library in libs to the
|
168
|
+
# top of the file specified by path
|
169
|
+
class AddRequires
|
170
|
+
def initialize(path, libs)
|
171
|
+
@path = path
|
172
|
+
@libs = libs
|
173
|
+
end
|
174
|
+
|
175
|
+
def perform(dir)
|
176
|
+
file = File.join(dir, @path)
|
177
|
+
File.open(file, 'r') do |old|
|
178
|
+
File.unlink(file)
|
179
|
+
File.open(file, 'w') do |new|
|
180
|
+
@libs.each do |lib|
|
181
|
+
new.write "require '#{lib}'\n"
|
182
|
+
end
|
183
|
+
new.write old.read
|
184
|
+
end
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
def unperform(dir)
|
189
|
+
#nothing
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
146
193
|
class CopyFile
|
147
|
-
def initialize(path, input_path)
|
194
|
+
def initialize(path, input_path, opts = {})
|
148
195
|
@path = path
|
149
196
|
@input_path = input_path
|
197
|
+
@overwrite = opts[:overwrite]
|
150
198
|
end
|
151
199
|
|
152
200
|
def perform(dir )
|
153
201
|
p = File.join( dir, @path )
|
154
|
-
if
|
202
|
+
if !@overwrite && File.exist?( p )
|
155
203
|
$LOG.error "Exists: #{p}" if $LOG.error?
|
156
204
|
return
|
157
205
|
end
|
@@ -52,7 +52,7 @@ module Awestruct
|
|
52
52
|
self.init = init
|
53
53
|
self.generate = false
|
54
54
|
end
|
55
|
-
opts.on( '-f', '--framework FRAMEWORK', 'Specify a compass framework during initialization (bootstrap, blueprint, 960)' ) do |framework|
|
55
|
+
opts.on( '-f', '--framework FRAMEWORK', 'Specify a compass framework during initialization (bootstrap, foundation, blueprint, 960)' ) do |framework|
|
56
56
|
self.framework = framework
|
57
57
|
end
|
58
58
|
opts.on( '--[no-]scaffold', 'Create scaffolding during initialization (default: true)' ) do |s|
|
@@ -3,9 +3,9 @@ Dir[ File.join( File.dirname(__FILE__), '*.rb' ) ].each do |f|
|
|
3
3
|
begin
|
4
4
|
require f
|
5
5
|
rescue LoadError => e
|
6
|
-
puts "WARNING: Missing required dependency to activate optional built
|
6
|
+
puts "WARNING: Missing required dependency to activate optional built-in extension #{File.basename(f)}\n #{e}"
|
7
7
|
rescue StandardError => e
|
8
|
-
puts "WARNING: Missing runtime configuration to activate optional built
|
8
|
+
puts "WARNING: Missing runtime configuration to activate optional built-in extension #{File.basename(f)}\n #{e}"
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
@@ -0,0 +1,194 @@
|
|
1
|
+
# This file is a rake build file. The purpose of this file is to simplify
|
2
|
+
# setting up and using Awestruct. It's not required to use Awestruct, though it
|
3
|
+
# does save you time (hopefully). If you don't want to use rake, just ignore or
|
4
|
+
# delete this file.
|
5
|
+
#
|
6
|
+
# If you're just getting started, execute this command to install Awestruct and
|
7
|
+
# the libraries on which it depends:
|
8
|
+
#
|
9
|
+
# rake setup
|
10
|
+
#
|
11
|
+
# The setup task installs the necessary libraries according to which Ruby
|
12
|
+
# environment you are using. If you want the libraries kept inside the project,
|
13
|
+
# execute this command instead:
|
14
|
+
#
|
15
|
+
# rake setup[local]
|
16
|
+
#
|
17
|
+
# IMPORTANT: To install gems, you'll need development tools on your machine,
|
18
|
+
# which include a C compiler, the Ruby development libraries and some other
|
19
|
+
# development libraries as well.
|
20
|
+
#
|
21
|
+
# There are also tasks for running Awestruct. The build will auto-detect
|
22
|
+
# whether you are using Bundler and, if you are, wrap calls to awestruct in
|
23
|
+
# `bundle exec`.
|
24
|
+
#
|
25
|
+
# To run in Awestruct in development mode, execute:
|
26
|
+
#
|
27
|
+
# rake
|
28
|
+
#
|
29
|
+
# To clean the generated site before you build, execute:
|
30
|
+
#
|
31
|
+
# rake clean preview
|
32
|
+
#
|
33
|
+
# To deploy using the production profile, execute:
|
34
|
+
#
|
35
|
+
# rake deploy
|
36
|
+
#
|
37
|
+
# To get a list of all tasks, execute:
|
38
|
+
#
|
39
|
+
# rake -T
|
40
|
+
#
|
41
|
+
# Now you're Awestruct with rake!
|
42
|
+
|
43
|
+
$use_bundle_exec = true
|
44
|
+
$install_gems = ['awestruct -v "~> 0.5.0"', 'rb-inotify -v "~> 0.9.0"']
|
45
|
+
$awestruct_cmd = nil
|
46
|
+
task :default => :preview
|
47
|
+
|
48
|
+
desc 'Setup the environment to run Awestruct'
|
49
|
+
task :setup, [:env] => :init do |task, args|
|
50
|
+
next if !which('awestruct').nil?
|
51
|
+
|
52
|
+
if File.exist? 'Gemfile'
|
53
|
+
if args[:env] == 'local'
|
54
|
+
require 'fileutils'
|
55
|
+
FileUtils.remove_file 'Gemfile.lock', true
|
56
|
+
FileUtils.remove_dir '.bundle', true
|
57
|
+
system 'bundle install --binstubs=_bin --path=.bundle'
|
58
|
+
else
|
59
|
+
system 'bundle install'
|
60
|
+
end
|
61
|
+
else
|
62
|
+
if args[:env] == 'local'
|
63
|
+
$install_gems.each do |gem|
|
64
|
+
msg "Installing #{gem}..."
|
65
|
+
system "gem install --bindir=_bin --install-dir=.bundle #{gem}"
|
66
|
+
end
|
67
|
+
else
|
68
|
+
$install_gems.each do |gem|
|
69
|
+
msg "Installing #{gem}..."
|
70
|
+
system "gem install #{gem}"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
msg 'Run awestruct using `awestruct` or `rake`'
|
75
|
+
# Don't execute any more tasks, need to reset env
|
76
|
+
exit 0
|
77
|
+
end
|
78
|
+
|
79
|
+
desc 'Update the environment to run Awestruct'
|
80
|
+
task :update => :init do
|
81
|
+
if File.exist? 'Gemfile'
|
82
|
+
system 'bundle update'
|
83
|
+
else
|
84
|
+
system 'gem update awestruct'
|
85
|
+
end
|
86
|
+
# Don't execute any more tasks, need to reset env
|
87
|
+
exit 0
|
88
|
+
end
|
89
|
+
|
90
|
+
desc 'Build and preview the site locally in development mode'
|
91
|
+
task :preview => :check do
|
92
|
+
run_awestruct '-d'
|
93
|
+
end
|
94
|
+
|
95
|
+
desc 'Generate the site using the development profile'
|
96
|
+
task :gen => :check do
|
97
|
+
run_awestruct '-P development -g --force'
|
98
|
+
end
|
99
|
+
|
100
|
+
desc 'Generate the site and deploy to production'
|
101
|
+
task :deploy => :check do
|
102
|
+
run_awestruct '-P production -g --force --deploy'
|
103
|
+
end
|
104
|
+
|
105
|
+
desc 'Clean out generated site and temporary files'
|
106
|
+
task :clean, :spec do |task, args|
|
107
|
+
require 'fileutils'
|
108
|
+
dirs = ['.awestruct', '.sass-cache', '_site']
|
109
|
+
if args[:spec] == 'all'
|
110
|
+
dirs << '_tmp'
|
111
|
+
end
|
112
|
+
dirs.each do |dir|
|
113
|
+
FileUtils.remove_dir dir unless !File.directory? dir
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
# Perform initialization steps, such as setting up the PATH
|
118
|
+
task :init do
|
119
|
+
# Detect using gems local to project
|
120
|
+
if File.exist? '_bin'
|
121
|
+
ENV['PATH'] = "_bin#{File::PATH_SEPARATOR}#{ENV['PATH']}"
|
122
|
+
ENV['GEM_HOME'] = '.bundle'
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
desc 'Check to ensure the environment is properly configured'
|
127
|
+
task :check => :init do
|
128
|
+
if !File.exist? 'Gemfile'
|
129
|
+
if which('awestruct').nil?
|
130
|
+
msg 'Could not find awestruct.', :warn
|
131
|
+
msg 'Run `rake setup` or `rake setup[local]` to install from RubyGems.'
|
132
|
+
# Enable once the rubygem-awestruct RPM is available
|
133
|
+
#msg 'Run `sudo yum install rubygem-awestruct` to install via RPM. (Fedora >= 18)'
|
134
|
+
exit 1
|
135
|
+
else
|
136
|
+
$use_bundle_exec = false
|
137
|
+
next
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
begin
|
142
|
+
require 'bundler'
|
143
|
+
Bundler.setup
|
144
|
+
rescue LoadError
|
145
|
+
$use_bundle_exec = false
|
146
|
+
rescue StandardError => e
|
147
|
+
msg e.message, :warn
|
148
|
+
if which('awestruct').nil?
|
149
|
+
msg 'Run `rake setup` or `rake setup[local]` to install required gems from RubyGems.'
|
150
|
+
else
|
151
|
+
msg 'Run `rake update` to install additional required gems from RubyGems.'
|
152
|
+
end
|
153
|
+
exit e.status_code
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
# Execute Awestruct
|
158
|
+
def run_awestruct(args)
|
159
|
+
system "#{$use_bundle_exec ? 'bundle exec ' : ''}awestruct #{args}"
|
160
|
+
end
|
161
|
+
|
162
|
+
# A cross-platform means of finding an executable in the $PATH.
|
163
|
+
# Respects $PATHEXT, which lists valid file extensions for executables on Windows
|
164
|
+
#
|
165
|
+
# which 'awestruct'
|
166
|
+
# => /usr/bin/awestruct
|
167
|
+
def which(cmd, opts = {})
|
168
|
+
unless $awestruct_cmd.nil? || opts[:clear_cache]
|
169
|
+
return $awestruct_cmd
|
170
|
+
end
|
171
|
+
|
172
|
+
$awestruct_cmd = nil
|
173
|
+
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
174
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
175
|
+
exts.each do |ext|
|
176
|
+
candidate = File.join path, "#{cmd}#{ext}"
|
177
|
+
if File.executable? candidate
|
178
|
+
$awestruct_cmd = candidate
|
179
|
+
return $awestruct_cmd
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
183
|
+
return $awestruct_cmd
|
184
|
+
end
|
185
|
+
|
186
|
+
# Print a message to STDOUT
|
187
|
+
def msg(text, level = :info)
|
188
|
+
case level
|
189
|
+
when :warn
|
190
|
+
puts "\e[31m#{text}\e[0m"
|
191
|
+
else
|
192
|
+
puts "\e[33m#{text}\e[0m"
|
193
|
+
end
|
194
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
|
2
2
|
Awestruct::Extensions::Pipeline.new do
|
3
|
-
# extension Awestruct::Extensions::Posts.new
|
3
|
+
# extension Awestruct::Extensions::Posts.new '/news'
|
4
4
|
# extension Awestruct::Extensions::Indexifier.new
|
5
|
+
# Indexifier *must* come before Atomizer
|
6
|
+
# extension Awestruct::Extensions::Atomizer.new :posts, '/feed.atom'
|
5
7
|
end
|
6
|
-
|
@@ -3,7 +3,7 @@ layout: base
|
|
3
3
|
---
|
4
4
|
.hero-unit
|
5
5
|
%h1 You're awestruct!
|
6
|
-
%p This site is all setup to use
|
6
|
+
%p This site is all setup to use Bootstrap 2 with Awestruct.
|
7
7
|
%p
|
8
8
|
%a.btn.btn-primary.btn-large{ :href=>'http://awestruct.org' }
|
9
9
|
%i.icon-info-sign.icon-white
|
@@ -0,0 +1,34 @@
|
|
1
|
+
---
|
2
|
+
layout: base
|
3
|
+
---
|
4
|
+
.row
|
5
|
+
.large-12.columns
|
6
|
+
%h1 You're awestruct!
|
7
|
+
%hr
|
8
|
+
|
9
|
+
.row
|
10
|
+
.large-12.columns
|
11
|
+
.panel
|
12
|
+
%h3 Get started
|
13
|
+
%p This site is all setup to use Foundation 4 with Awestruct.
|
14
|
+
%a.button{:href=>'http://awestruct.org'} Check out Foundation 4
|
15
|
+
%a.button.secondary{:href=>'http://awestruct.org'} Check out Awestruct
|
16
|
+
|
17
|
+
.row
|
18
|
+
.large-4.columns
|
19
|
+
%h3 About
|
20
|
+
%p Awestruct is a framework for creating static HTML sites. It's inspired by the awesome Jekyll utility in the same genre. Additionally, Awestruct integrates technologies such as Compass, Markdown and Haml.
|
21
|
+
%p
|
22
|
+
%a.button{:href=>'http://awestruct.org'} View details »
|
23
|
+
|
24
|
+
.large-4.columns
|
25
|
+
%h3 Goal
|
26
|
+
%p The goal of Awestruct is to make it trivially easy to bake out non-trivial static websites. In addition to providing template-driven site creation (using Haml), Awestruct provides facilities for easily priming the site creation with additional non-page data.
|
27
|
+
%p
|
28
|
+
%a.button{:href=>'http://awestruct.org'} View details »
|
29
|
+
|
30
|
+
.large-4.columns
|
31
|
+
%h3 Concept
|
32
|
+
%p The core concept of Awestruct is that of structures, specifically Ruby OpenStruct structures. The struct aspect allows arbitrary, schema-less data to be associated with a specific page or the entire site.
|
33
|
+
%p
|
34
|
+
%a.button{:href=>'http://awestruct.org'} View details »
|
@@ -0,0 +1,58 @@
|
|
1
|
+
!!!5
|
2
|
+
-# To understand why the html tag is setup this way,
|
3
|
+
-# see http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither
|
4
|
+
<!--[if IE 8]><html class="no-js lt-ie9" lang="en"><![endif]-->
|
5
|
+
<!--[if gt IE 8]><!--><html class="no-js" lang="en"><!--<![endif]-->
|
6
|
+
%head
|
7
|
+
%meta(charset='utf-8')
|
8
|
+
%meta(name='viewport' content='width=device-width, initial-scale=1.0')
|
9
|
+
%title=site.title
|
10
|
+
%link{:rel=>'stylesheet', :href=>"#{site.base_url}/stylesheets/normalize.css"}
|
11
|
+
%link{:rel=>'stylesheet', :href=>"#{site.base_url}/stylesheets/app.css"}
|
12
|
+
%script(src="#{site.base_url}/javascripts/vendor/custom.modernizr.js")
|
13
|
+
%link{:rel=>'author', :type=>'text/plain', :href=>"#{site.base_url}/humans.txt"}
|
14
|
+
%body.antialiased
|
15
|
+
%nav.top-bar
|
16
|
+
%ul.title-area
|
17
|
+
%li.name
|
18
|
+
%h1
|
19
|
+
%a(href="#{site.base_url}/")=site.name
|
20
|
+
%li.toggle-topbar.menu-icon
|
21
|
+
%a{:href=>'#'}<
|
22
|
+
%span
|
23
|
+
%section.top-bar-section
|
24
|
+
%ul.right
|
25
|
+
%li.divider
|
26
|
+
%li
|
27
|
+
%a{:href=>"#{site.base_url}/"} Home
|
28
|
+
-#%li.divider
|
29
|
+
-# %li
|
30
|
+
-# %a{:href=>"#{site.base_url}/blog"} Blog
|
31
|
+
.row
|
32
|
+
.large-12.columns
|
33
|
+
~ content
|
34
|
+
%footer.row(style='max-width: 100%')
|
35
|
+
%hr
|
36
|
+
.large-6.columns
|
37
|
+
%p(style='margin-bottom: .75em')
|
38
|
+
© #{site.org} #{Date.today.year}
|
39
|
+
%br
|
40
|
+
Built on Foundation. Baked by Awestruct.
|
41
|
+
.large-6.columns
|
42
|
+
%ul.inline-list.right
|
43
|
+
%li
|
44
|
+
%a{:href=>"#{site.base_url}/"} Home
|
45
|
+
-#%li
|
46
|
+
-# %a{:href=>"#{site.base_url}/blog"} Blog
|
47
|
+
%script
|
48
|
+
document.write('<script src=' + ('__proto__' in {} ? '#{site.base_url}/javascripts/vendor/zepto' : '#{site.base_url}/javascripts/vendor/jquery') + '.js><\/script>')
|
49
|
+
%script{:src=>"#{site.base_url}/javascripts/foundation/foundation.js"}
|
50
|
+
-# select foundation components from this array and add them to the one on the line below it
|
51
|
+
-# [:orbit, :cookie, :clearing, :magellan, :section, :alerts, :topbar, :joyride, :forms, :tooltips, :dropdown, :placeholder, :reveal]
|
52
|
+
- [:topbar].each do |component|
|
53
|
+
%script{:src=>"#{site.base_url}/javascripts/foundation/foundation.#{component}.js"}
|
54
|
+
%script
|
55
|
+
$(document).foundation()
|
56
|
+
- if site.google_analytics
|
57
|
+
=google_analytics_async
|
58
|
+
</html>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/* Foundation was made by ZURB (zurb.com), an interaction design and design strategy firm in Campbell, CA */
|
2
|
+
/* To learn more about this file, visit humanstxt.org */
|
3
|
+
|
4
|
+
/* SITE */
|
5
|
+
Standards: HTML5, CSS3
|
6
|
+
Components: Foundation, Normalize, Modernizr, Zepto, jQuery
|
7
|
+
Software: Ruby, Rake, Awestruct, Haml, Git
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2007-2008 Sharon Rosner
|
2
|
+
Copyright (c) 2008-2009 Jeremy Evans
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to
|
6
|
+
deal in the Software without restriction, including without limitation the
|
7
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
8
|
+
sell copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in
|
12
|
+
all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
17
|
+
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/awestruct/version.rb
CHANGED
data/man/awestruct.1
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
.\" Title: awestruct
|
3
3
|
.\" Author: [see the "AUTHORS" section]
|
4
4
|
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
|
5
|
-
.\" Date: 03/
|
5
|
+
.\" Date: 03/29/2013
|
6
6
|
.\" Manual: \ \&
|
7
7
|
.\" Source: \ \&
|
8
8
|
.\" Language: English
|
9
9
|
.\"
|
10
|
-
.TH "AWESTRUCT" "1" "03/
|
10
|
+
.TH "AWESTRUCT" "1" "03/29/2013" "\ \&" "\ \&"
|
11
11
|
.\" -----------------------------------------------------------------
|
12
12
|
.\" * Define some portability stuff
|
13
13
|
.\" -----------------------------------------------------------------
|
@@ -50,6 +50,7 @@ directory\&.
|
|
50
50
|
\fB\-f, \-\-framework\fR=\fIFRAMEWORK\fR
|
51
51
|
.RS 4
|
52
52
|
Specify a Compass framework during initialization to use in the project\&. (\fIbootstrap\fR,
|
53
|
+
\fIfoundation\fR,
|
53
54
|
\fIblueprint\fR,
|
54
55
|
\fI960\fR)
|
55
56
|
.RE
|
data/spec/posts_archive_spec.rb
CHANGED
@@ -16,7 +16,7 @@ describe Awestruct::Extensions::Posts do
|
|
16
16
|
|
17
17
|
it "should have 'posts' as a layout by default" do
|
18
18
|
extension = Awestruct::Extensions::Posts.new('/posts', :posts)
|
19
|
-
extension.default_layout.should eql '
|
19
|
+
extension.default_layout.should eql 'post'
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should have a nil archive template by default" do
|
@@ -45,18 +45,18 @@ describe Awestruct::Extensions::Posts do
|
|
45
45
|
end
|
46
46
|
|
47
47
|
it "should accept a default layout for post pages" do
|
48
|
-
extension = Awestruct::Extensions::Posts.new( '/posts', :news, nil, nil, :default_layout => '
|
48
|
+
extension = Awestruct::Extensions::Posts.new( '/posts', :news, nil, nil, :default_layout => 'blog' )
|
49
49
|
extension.archive_path.should be_nil
|
50
50
|
extension.archive_template.should be_nil
|
51
|
-
extension.default_layout.should == '
|
51
|
+
extension.default_layout.should == 'blog'
|
52
52
|
end
|
53
53
|
|
54
54
|
it "should assign default layout if specified to post without layout" do
|
55
|
-
extension = Awestruct::Extensions::Posts.new( '/posts', :news, nil, nil, :default_layout => '
|
55
|
+
extension = Awestruct::Extensions::Posts.new( '/posts', :news, nil, nil, :default_layout => 'blog' )
|
56
56
|
site = Hashery::OpenCascade[ { :encoding=>false } ]
|
57
57
|
page = __create_page( 2012, 8, 9, '/posts/mock-post.md' )
|
58
58
|
page.stub(:layout).and_return(nil)
|
59
|
-
page.should_receive(:layout=).with('
|
59
|
+
page.should_receive(:layout=).with('blog')
|
60
60
|
page.stub(:slug).and_return(nil, 'mock-post')
|
61
61
|
page.should_receive(:slug=).with('mock-post')
|
62
62
|
page.should_receive(:output_path=).with('/posts/2012/08/09/mock-post.html')
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awestruct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.1a
|
5
|
+
prerelease: 5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Bob McWhirter and other contributors
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: haml
|
@@ -107,6 +107,22 @@ dependencies:
|
|
107
107
|
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: 2.3.1.0
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: zurb-foundation
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 4.0.9
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 4.0.9
|
110
126
|
- !ruby/object:Gem::Dependency
|
111
127
|
name: json
|
112
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -214,7 +230,18 @@ files:
|
|
214
230
|
- lib/awestruct/config.rb
|
215
231
|
- lib/awestruct/handler_chains.rb
|
216
232
|
- lib/awestruct/context.rb
|
233
|
+
- lib/awestruct/frameworks/960/base_layout.html.haml
|
234
|
+
- lib/awestruct/frameworks/base_awestruct_ignore
|
235
|
+
- lib/awestruct/frameworks/base_index.html.haml
|
217
236
|
- lib/awestruct/frameworks/base_pipeline.rb
|
237
|
+
- lib/awestruct/frameworks/base_site.yml
|
238
|
+
- lib/awestruct/frameworks/bootstrap/base_layout.html.haml
|
239
|
+
- lib/awestruct/frameworks/bootstrap/base_index.html.haml
|
240
|
+
- lib/awestruct/frameworks/foundation/base_layout.html.haml
|
241
|
+
- lib/awestruct/frameworks/foundation/base_index.html.haml
|
242
|
+
- lib/awestruct/frameworks/foundation/humans.txt
|
243
|
+
- lib/awestruct/frameworks/blueprint/base_layout.html.haml
|
244
|
+
- lib/awestruct/frameworks/base_Rakefile
|
218
245
|
- lib/awestruct/rack/app.rb
|
219
246
|
- lib/awestruct/astruct.rb
|
220
247
|
- lib/awestruct/pipeline.rb
|
@@ -241,8 +268,10 @@ files:
|
|
241
268
|
- lib/awestruct/handlers/file_handler.rb
|
242
269
|
- lib/awestruct/handlers/redirect_handler.rb
|
243
270
|
- lib/awestruct/handlers/base_tilt_handler.rb
|
271
|
+
- lib/awestruct/util/COPYING
|
244
272
|
- lib/awestruct/util/default_inflections.rb
|
245
273
|
- lib/awestruct/util/inflector.rb
|
274
|
+
- lib/awestruct/config/default-site.yml
|
246
275
|
- lib/awestruct/site.rb
|
247
276
|
- lib/awestruct/deployers.rb
|
248
277
|
- lib/awestruct/astruct_mixin.rb
|
@@ -258,11 +287,14 @@ files:
|
|
258
287
|
- lib/awestruct/cli/deploy.rb
|
259
288
|
- lib/awestruct/cli/manifest.rb
|
260
289
|
- lib/awestruct/extensions/posts.rb
|
290
|
+
- lib/awestruct/extensions/tag_cloud.html.haml
|
261
291
|
- lib/awestruct/extensions/google_analytics.rb
|
262
292
|
- lib/awestruct/extensions/atomizer.rb
|
263
293
|
- lib/awestruct/extensions/pipeline.rb
|
264
294
|
- lib/awestruct/extensions/indexifier.rb
|
295
|
+
- lib/awestruct/extensions/template.atom.haml
|
265
296
|
- lib/awestruct/extensions/data_dir.rb
|
297
|
+
- lib/awestruct/extensions/sitemap.xml.haml
|
266
298
|
- lib/awestruct/extensions/tag_cloud.rb
|
267
299
|
- lib/awestruct/extensions/cachebuster.rb
|
268
300
|
- lib/awestruct/extensions/relative.rb
|
@@ -284,15 +316,6 @@ files:
|
|
284
316
|
- lib/awestruct/dependencies.rb
|
285
317
|
- lib/awestruct/logger.rb
|
286
318
|
- lib/awestruct/engine.rb
|
287
|
-
- lib/awestruct/frameworks/960/base_layout.html.haml
|
288
|
-
- lib/awestruct/frameworks/base_index.html.haml
|
289
|
-
- lib/awestruct/frameworks/bootstrap/base_layout.html.haml
|
290
|
-
- lib/awestruct/frameworks/bootstrap/base_index.html.haml
|
291
|
-
- lib/awestruct/frameworks/blueprint/base_layout.html.haml
|
292
|
-
- lib/awestruct/extensions/tag_cloud.html.haml
|
293
|
-
- lib/awestruct/extensions/template.atom.haml
|
294
|
-
- lib/awestruct/extensions/sitemap.xml.haml
|
295
|
-
- lib/awestruct/config/default-site.yml
|
296
319
|
- spec/yaml_handler_spec.rb
|
297
320
|
- spec/mustache_handler_spec.rb
|
298
321
|
- spec/options_spec.rb
|
@@ -418,16 +441,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
418
441
|
version: '0'
|
419
442
|
segments:
|
420
443
|
- 0
|
421
|
-
hash:
|
444
|
+
hash: 773767743724011562
|
422
445
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
423
446
|
none: false
|
424
447
|
requirements:
|
425
|
-
- - ! '
|
448
|
+
- - ! '>'
|
426
449
|
- !ruby/object:Gem::Version
|
427
|
-
version:
|
428
|
-
segments:
|
429
|
-
- 0
|
430
|
-
hash: 1113133206677710409
|
450
|
+
version: 1.3.1
|
431
451
|
requirements:
|
432
452
|
- Any markup languages you are using and its dependencies
|
433
453
|
- If LESS is used, or some other fixes within tilt, it is required to use Bundler
|