hydeweb 0.0.8.pre2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. data/{CHANGELOG → HISTORY.md} +6 -0
  2. data/Rakefile +2 -52
  3. data/bin/hyde +3 -23
  4. data/bin/hyde01 +7 -0
  5. data/data/new_site/README.md +1 -1
  6. data/data/new_site/hyde.conf +9 -6
  7. data/lib/hyde/cli/helpers.rb +40 -0
  8. data/lib/hyde/cli.rb +86 -0
  9. data/lib/hyde/config.rb +37 -0
  10. data/lib/hyde/helpers.rb +6 -47
  11. data/lib/hyde/layout.rb +17 -9
  12. data/lib/hyde/meta.rb +5 -21
  13. data/lib/hyde/page.rb +207 -159
  14. data/lib/hyde/partial.rb +10 -5
  15. data/lib/hyde/project.rb +58 -208
  16. data/lib/hyde/server.rb +57 -0
  17. data/lib/hyde.rb +28 -51
  18. data/test/fixture/extensions/extensions/a/a.rb +1 -0
  19. data/test/fixture/extensions/hyde.conf +8 -0
  20. data/test/fixture/extensions/site/index.haml +1 -0
  21. data/test/fixture/fail_type/control/about/index.html +2 -0
  22. data/test/fixture/fail_type/control/about/us.html +2 -0
  23. data/test/fixture/fail_type/control/index.html +1 -0
  24. data/test/fixture/fail_type/hyde.conf +8 -0
  25. data/test/fixture/fail_type/site/index.haml +4 -0
  26. data/test/fixture/nested_layout/control/index.html +2 -0
  27. data/test/fixture/nested_layout/hyde.conf +8 -0
  28. data/test/fixture/nested_layout/layouts/default.haml +2 -0
  29. data/test/{fixtures/content_for/site/default.html.haml → fixture/nested_layout/layouts/post.haml} +1 -0
  30. data/test/fixture/nested_layout/site/index.haml +4 -0
  31. data/test/fixture/one/control/about/index.css +2 -0
  32. data/test/fixture/one/control/cheers.html +5 -0
  33. data/test/fixture/one/control/css/style.css +2 -0
  34. data/test/fixture/one/control/hello.html +5 -0
  35. data/test/fixture/one/control/hi.html +1 -0
  36. data/test/fixture/one/control/index.html +7 -0
  37. data/test/fixture/one/hyde.conf +9 -0
  38. data/test/fixture/one/layouts/default.haml +4 -0
  39. data/test/fixture/one/partials/menu.haml +3 -0
  40. data/test/fixture/one/site/about/index.scss +1 -0
  41. data/test/fixture/one/site/cheers.html.haml +1 -0
  42. data/test/fixture/one/site/css/style.scss +2 -0
  43. data/test/fixture/one/site/hello.haml +1 -0
  44. data/test/fixture/one/site/hi.html +1 -0
  45. data/test/fixture/one/site/index.haml +7 -0
  46. data/test/fixture/parent/control/about/index.html +2 -0
  47. data/test/fixture/parent/control/about/us.html +2 -0
  48. data/test/fixture/parent/control/index.html +1 -0
  49. data/test/fixture/parent/hyde.conf +8 -0
  50. data/test/fixture/parent/site/about/index.haml +3 -0
  51. data/test/fixture/parent/site/about/us.haml +3 -0
  52. data/test/fixture/parent/site/index.haml +3 -0
  53. data/test/fixture/sort/hyde.conf +8 -0
  54. data/test/fixture/sort/site/about/hardy.haml +4 -0
  55. data/test/fixture/sort/site/about/intrepid.haml +4 -0
  56. data/test/fixture/sort/site/about.haml +3 -0
  57. data/test/fixture/subclass/control/index.html +1 -0
  58. data/test/fixture/subclass/extensions/a/a.rb +12 -0
  59. data/test/fixture/subclass/hyde.conf +8 -0
  60. data/test/fixture/subclass/layouts/default.haml +1 -0
  61. data/test/fixture/subclass/layouts/post.haml +1 -0
  62. data/test/fixture/subclass/site/index.haml +4 -0
  63. data/test/helper.rb +15 -21
  64. data/test/unit/extensions_test.rb +16 -0
  65. data/test/unit/fixture_test.rb +77 -0
  66. data/test/unit/hyde_test.rb +30 -0
  67. metadata +107 -153
  68. data/.yardopts +0 -5
  69. data/LICENSE +0 -20
  70. data/VERSION +0 -1
  71. data/data/new_site/.gitignore +0 -24
  72. data/data/pages/404.html +0 -3
  73. data/hydeweb.gemspec +0 -159
  74. data/lib/hyde/clicommand.rb +0 -60
  75. data/lib/hyde/clicommands.rb +0 -128
  76. data/lib/hyde/ostruct.rb +0 -13
  77. data/lib/hyde/page_factory.rb +0 -90
  78. data/lib/hyde/renderer.rb +0 -133
  79. data/lib/hyde/renderers.rb +0 -100
  80. data/lib/hyde/sinatra/init.rb +0 -64
  81. data/lib/hyde/utils.rb +0 -43
  82. data/lib/hyde_misc/console.rb +0 -4
  83. data/manual/Extending/ExtendingHyde.md +0 -118
  84. data/manual/Hyde.md +0 -63
  85. data/manual/Introduction/Configuration.md +0 -70
  86. data/manual/Introduction/GettingStarted.md +0 -64
  87. data/manual/Introduction/Installation.md +0 -16
  88. data/manual/Introduction/Layouts.md +0 -14
  89. data/manual/Introduction/Metadata.md +0 -94
  90. data/manual/Introduction/Partials.md +0 -73
  91. data/manual/Introduction/TemplateLanguages.md +0 -59
  92. data/manual/Tips/Tips.md +0 -42
  93. data/test/fixtures/content_for/_config.yml +0 -8
  94. data/test/fixtures/content_for/layouts/cf-args.haml +0 -2
  95. data/test/fixtures/content_for/layouts/cf.haml +0 -14
  96. data/test/fixtures/content_for/layouts/default.haml +0 -4
  97. data/test/fixtures/content_for/layouts/shared/test.haml +0 -4
  98. data/test/fixtures/content_for/site/cf-args-default.haml +0 -2
  99. data/test/fixtures/content_for/site/cf-args.haml +0 -5
  100. data/test/fixtures/content_for/site/cf.haml +0 -6
  101. data/test/fixtures/content_for/site/cf2.haml +0 -3
  102. data/test/fixtures/content_for/site/index.html.haml +0 -9
  103. data/test/fixtures/content_for/site/var.html.haml +0 -5
  104. data/test/fixtures/content_for/www_control/cf-args-default.html +0 -1
  105. data/test/fixtures/content_for/www_control/cf-args.html +0 -2
  106. data/test/fixtures/content_for/www_control/cf.html +0 -17
  107. data/test/fixtures/content_for/www_control/cf2.html +0 -19
  108. data/test/fixtures/content_for/www_control/default.html +0 -2
  109. data/test/fixtures/content_for/www_control/index.html +0 -10
  110. data/test/fixtures/content_for/www_control/var.html +0 -2
  111. data/test/fixtures/custom/_config.yml +0 -8
  112. data/test/fixtures/custom/extensions/custom/custom.rb +0 -9
  113. data/test/fixtures/custom/layouts/default.haml +0 -8
  114. data/test/fixtures/custom/layouts/erbtest.erb +0 -2
  115. data/test/fixtures/custom/layouts/shared/sidebar.haml +0 -4
  116. data/test/fixtures/custom/site/about/index.html +0 -1
  117. data/test/fixtures/custom/site/assets/common.css.less +0 -1
  118. data/test/fixtures/custom/site/assets/style.css.less +0 -3
  119. data/test/fixtures/custom/site/foo.html.haml +0 -3
  120. data/test/fixtures/custom/site/index.html.haml +0 -6
  121. data/test/fixtures/custom/site/layout_test.html.haml +0 -6
  122. data/test/fixtures/custom/site/lol.html.erb +0 -7
  123. data/test/fixtures/custom/site/markdown.html.md +0 -8
  124. data/test/fixtures/custom/site/yes.html +0 -2
  125. data/test/fixtures/custom/www_control/about/index.html +0 -1
  126. data/test/fixtures/custom/www_control/assets/common.css +0 -1
  127. data/test/fixtures/custom/www_control/assets/style.css +0 -6
  128. data/test/fixtures/custom/www_control/foo.html +0 -1
  129. data/test/fixtures/custom/www_control/index.html +0 -16
  130. data/test/fixtures/custom/www_control/layout_test.html +0 -16
  131. data/test/fixtures/custom/www_control/lol.html +0 -5
  132. data/test/fixtures/custom/www_control/markdown.html +0 -17
  133. data/test/fixtures/custom/www_control/yes.html +0 -2
  134. data/test/fixtures/default/_config.yml +0 -8
  135. data/test/fixtures/default/extensions/custom/custom.rb +0 -2
  136. data/test/fixtures/default/layouts/default.haml +0 -5
  137. data/test/fixtures/default/site/about/index.html +0 -1
  138. data/test/fixtures/default/site/foo.html.haml +0 -3
  139. data/test/fixtures/default/site/index.html.haml +0 -6
  140. data/test/fixtures/default/site/layout_test.html.haml +0 -6
  141. data/test/fixtures/default/site/yes.html +0 -2
  142. data/test/fixtures/default/www_control/about/index.html +0 -1
  143. data/test/fixtures/default/www_control/foo.html +0 -1
  144. data/test/fixtures/default/www_control/index.html +0 -9
  145. data/test/fixtures/default/www_control/layout_test.html +0 -9
  146. data/test/fixtures/default/www_control/yes.html +0 -2
  147. data/test/test_all_fixtures.rb +0 -51
  148. data/test/test_build.rb +0 -20
  149. data/test/test_hyde.rb +0 -75
  150. data/test/test_page.rb +0 -26
  151. data/test/test_utils.rb +0 -22
data/lib/hyde/project.rb CHANGED
@@ -1,223 +1,73 @@
1
- module Hyde
2
- # TODO: This class is growing... time to refactor
3
- class Project
4
- include Hyde::Utils
5
-
6
- # The filename of the configuration file, relative to the project root. (String)
7
- #
8
- attr :config_file
9
-
10
- # The configuration k/v storage (OStruct)
11
- #
12
- attr_accessor :config
13
-
14
- # The root path (String).
15
- #
16
- # @example
17
- # root
18
- # root :layouts
19
- # root :site, 'blah'
20
- #
21
- def root(*args)
22
- where = ''
23
- where = @config.send("#{args.shift.to_s}_path") if args[0].class == Symbol
24
- path = args
25
- File.expand_path File.join([@root, where, path].reject { |s| s.empty? })
26
- end
27
-
28
- # Can raise a NoRootError
29
- #
30
- def initialize(root = Dir.pwd)
31
- @config = OStruct.new defaults
32
- @root, @config_file = find_root_from root
33
- @config.merge! YAML::load_file(@config_file)
34
-
35
- # Check for version
36
- raise IncompatibleError, "This project requires at least Hyde v#{@config.hyde_requirement}." \
37
- unless @config.hyde_requirement.nil? or \
38
- ::Hyde.compatible_with?(@config.hyde_requirement)
39
-
40
- load_extensions
41
- end
42
-
43
- # Returns an object in the project.
44
- # Can be a page, layout, template...
45
- #
46
- # @example
47
- # @project['index.html']
48
- # @project['default', :Layout]
49
- # @project['widgets/sidebar', :Partial]
50
- #
51
- def [](name, default_class=Page)
52
- default_class = ::Hyde.const_get(default_class) if default_class.is_a? Symbol
53
- Hyde::Page[name, self, default_class]
54
- end
55
-
56
- # Returns all pages.
57
- #
58
- # @example
59
- # @project.all #=> [1, 2, 3]
60
- # @project.all(Hyde::Post) #=> [1]
61
- #
62
- def all(type=nil)
63
- unless type
64
- @all = files.map { |f| self[f] }
65
- else
66
- all.select { |page| page.class == type }
67
- end
68
- end
69
-
70
- # Writes the output files.
71
- # @param
72
- # ostream - (Stream) Where to send the messages
73
- #
74
- def build(ostream = nil)
75
- if File.exists? root(:output)
76
- raise Errno::EEXISTS unless File.directory? root(:output)
77
- else
78
- Dir.mkdir root(:output)
79
- end
80
-
81
- begin
82
- all.each do |page|
83
- ostream << " * #{page.output_path}\n" if ostream
84
-
85
- begin
86
- rendered = page.render
87
- force_file_open(page.output_path) { |file| file << rendered }
88
-
89
- rescue RenderError => e
90
- ostream << " *** Error: #{e.to_s}".gsub("\n", "\n *** ") << "\n"
91
- end
92
- end
93
-
94
- rescue NoGemError => e
95
- ostream << " *** Error: #{e.message}\n"
96
- end
97
- end
98
-
99
- # Returns a list of all URL paths
100
- #
101
- def files
102
- @files = Dir[File.join(root(:site), '**', '*')].inject([]) do |a, match|
103
- # Make sure its the canonical name
104
- path = File.expand_path(match)
105
- file = path.gsub /^#{Regexp.escape root(:site)}\/?/, ''
106
- ext = File.extname(file)[1..-1]
107
-
108
- if ignored_files.include?(path) or File.directory?(match)
109
- # pass
110
- elsif not get_renderer(ext).nil? # Has a renderer associated
111
- fname = file.chomp(".#{ext}")
112
- fname += get_renderer(ext).default_ext unless File.basename(fname).include?('.')
113
- a << fname
114
- else
115
- a << file
116
- end
117
- a
118
- end
119
- end
120
-
121
- # Returns a list of file specs to be excluded from processing.
122
- # @see {#ignored_files}
123
- #
124
- def ignore_list
125
- @ignore_list ||= [
126
- root(:layouts, '**/*'),
127
- root(:extensions, '**/*'),
128
- root(:output, '**/*'),
129
- custom_ignored_files,
130
- @config_file
131
- ].flatten.uniq
132
- end
133
-
134
- def custom_ignored_files
135
- list = @config.send("ignore")
136
- return [] unless list.is_a?(Array)
137
- Dir[*(list.map { |path| root(:site, path) })]
138
- end
1
+ class Hyde
2
+ class Project
3
+ def initialize(root=Dir.pwd)
4
+ @root = root
5
+ $project = self
6
+
7
+ validate_version
8
+ load_extensions
9
+ end
139
10
 
140
- # Returns a list of ignored files based on the {ignore_list}.
141
- # TODO: This is innefficient... do it another way
142
- #
143
- def ignored_files
144
- @ignored_files ||= ignore_list.inject([]) do |a, spec|
145
- Dir[spec].each { |file| a << File.expand_path(file) }; a
146
- end
11
+ def validate_version
12
+ return unless config_file?
13
+ req = config.hyde_requirement.to_s
14
+ if req < "0.1"
15
+ raise LegacyError, "This is a legacy project"
16
+ elsif req > Hyde.version
17
+ raise VersionError, "You will need Hyde version >= #{req} for this project."
147
18
  end
19
+ end
148
20
 
149
- def self.config_filenames
150
- ['_config.yml', 'hyde.conf', '.hyderc']
151
- end
21
+ def load_extensions
22
+ path = path(:extensions)
23
+ Dir[path(:extensions, '*', '*.rb')].each { |f| require f } if path
24
+ end
152
25
 
153
- protected
26
+ def config_file
27
+ try = lambda { |path| p = root(path); p if File.file?(p) }
28
+ try['hyde.conf'] || try['.hyderc']
29
+ end
154
30
 
155
- # Looks for the hyde config file to determine the project root.
156
- #
157
- def find_root_from(start)
158
- check = File.expand_path(start)
159
- ret = nil
160
- while ret.nil?
161
- # See if any of these files exist
162
- self.class.config_filenames.each do |config_name|
163
- config_file = File.join(check, config_name)
164
- ret ||= [check, config_file] if File.exists? config_file
165
- end
31
+ def config_file?
32
+ config_file
33
+ end
166
34
 
167
- # Traverse back (die if we reach the root)
168
- old_check = check
169
- check = File.expand_path(File.join(check, '..'))
170
- raise NoRootError if check == old_check
171
- end
172
- ret
173
- end
35
+ def config
36
+ @config ||= Config.load(config_file)
37
+ end
174
38
 
175
- # Loads the ruby files in the extensions folder
176
- #
177
- def load_extensions
178
- # Load the init.rb file
179
- require root('init.rb') if File.exists?(root('init.rb'))
39
+ # Returns the path for a certain aspect.
40
+ # @example path(:site)
41
+ def path(what, *a)
42
+ return nil unless [:output, :site, :layouts, :extensions, :partials].include?(what)
43
+ path = config.send(:"#{what}_path")
44
+ root path, *a if path
45
+ end
180
46
 
181
- # Load the gems in the config file
182
- @config.gems.each { |gem| require gem }
47
+ def root(*args)
48
+ File.join @root, *(args.compact)
49
+ end
183
50
 
184
- # Load the extensions
185
- ext_roots = Dir[root(:extensions, '*')].select { |d| File.directory? d }
186
- ext_roots.each do |dir|
187
- ext = File.basename(dir)
51
+ def pages
52
+ files.map { |f| Page[f, self] }.compact
53
+ end
188
54
 
189
- # Try extensions/name/name.rb
190
- # Try extensions/name/lib/name.rb
191
- ext_files = [
192
- File.join(dir, "#{ext}.rb"),
193
- File.join(dir, 'lib', "#{ext}.rb")
194
- ]
195
- ext_files.reject! { |f| not File.exists? f }
196
- require ext_files[0] if ext_files[0]
197
- end
198
- end
55
+ def files
56
+ Dir[File.join(path(:site), '**', '*')] - ignored_files
57
+ end
199
58
 
200
- def defaults
201
- { 'layouts_path' => 'layouts',
202
- 'extensions_path' => 'extensions',
203
- 'partials_path' => 'layouts',
204
- 'site_path' => 'site',
205
- 'output_path' => 'public',
206
- 'port' => 4833,
207
- 'gems' => []
208
- }
59
+ def ignored_files
60
+ specs = [*config.ignore].map { |s| root(s) }
61
+ specs << config_file
62
+ [:layouts, :extensions, :partials, :output].each do |aspect|
63
+ specs << path(aspect, '**/*') if path(aspect)
209
64
  end
65
+ specs.compact.map { |s| Dir[s] }.flatten.uniq
66
+ end
210
67
 
211
- # Returns the renderer associated with the given file extension.
212
- #
213
- def get_renderer(name)
214
- begin
215
- class_name = name.to_s.capitalize.to_sym
216
- renderer = ::Hyde::Renderers.const_get(class_name)
217
- rescue NameError
218
- renderer = nil
219
- end
220
- renderer
221
- end
68
+ def build_cleanup
69
+ FileUtils.rm_rf '.sass_cache'
222
70
  end
223
71
  end
72
+ end
73
+
@@ -0,0 +1,57 @@
1
+ require 'cuba'
2
+ require 'rack'
3
+ require 'hyde'
4
+
5
+ class Hyde
6
+ Server = Cuba.dup
7
+
8
+ module Server; end
9
+
10
+ module Server::PageHelpers
11
+ def not_found
12
+ show_status nil
13
+ res.status = 404
14
+ res.write "404"
15
+ end
16
+
17
+ def show_status(page)
18
+ path = env['PATH_INFO']
19
+ return if path == '/favicon.ico'
20
+
21
+ status = page ? "\033[0;32m[ OK ]" : "\033[0;31m[404 ]"
22
+ verb = get ? 'GET ' : (post ? 'POST' : '')
23
+ puts "%s\033[0;m %s %s" % [ status, verb, env['PATH_INFO'] ]
24
+ puts " Source: #{page.file.sub(page.project.path(:site), '')} (#{page.tilt_engine_name})" if page.tilt?
25
+ end
26
+ end
27
+
28
+ module Hyde::Server
29
+ Ron.send :include, PageHelpers
30
+
31
+ define do
32
+ on default do
33
+ page = Hyde::Page[env['PATH_INFO']] or break not_found
34
+ res.write page.to_html
35
+ show_status page
36
+ end
37
+ end
38
+ end
39
+ end
40
+
41
+ module Hyde::Server
42
+ # :Host, :Port
43
+ def self.run!(options={})
44
+ handler = rack_handler or return false
45
+ handler.run self, options
46
+ end
47
+
48
+ def self.rack_handler
49
+ %w(thin mongrel webrick).each do |svr|
50
+ begin
51
+ return Rack::Handler.get(svr)
52
+ rescue LoadError
53
+ rescue NameError
54
+ end
55
+ end
56
+ end
57
+ end
data/lib/hyde.rb CHANGED
@@ -1,55 +1,32 @@
1
- require 'yaml'
2
-
3
- module Hyde
4
- LIB_PATH = File.dirname(__FILE__)
5
-
6
- autoload :OStruct, "#{LIB_PATH}/hyde/ostruct"
7
- autoload :Project, "#{LIB_PATH}/hyde/project"
8
- autoload :Layout, "#{LIB_PATH}/hyde/layout"
9
- autoload :Page, "#{LIB_PATH}/hyde/page"
10
- autoload :PageFactory, "#{LIB_PATH}/hyde/page_factory"
11
- autoload :Renderer, "#{LIB_PATH}/hyde/renderer"
12
- autoload :Renderers, "#{LIB_PATH}/hyde/renderers"
13
- autoload :Utils, "#{LIB_PATH}/hyde/utils"
14
- autoload :Meta, "#{LIB_PATH}/hyde/meta"
15
- autoload :CLICommand, "#{LIB_PATH}/hyde/clicommand"
16
- autoload :CLICommands, "#{LIB_PATH}/hyde/clicommands"
17
- autoload :Helpers, "#{LIB_PATH}/hyde/helpers"
18
- autoload :Partial, "#{LIB_PATH}/hyde/partial"
1
+ $:.push *Dir[File.expand_path('../../vendor/*/lib', __FILE__)]
19
2
 
20
- Error = Class.new(::StandardError)
21
- NoGemError = Class.new(Error)
22
- NotFound = Class.new(Error)
23
- NoRootError = Class.new(Error)
24
- IncompatibleError = Class.new(Error)
3
+ gem 'shake', '~> 0.1'
25
4
 
26
- class RenderError < Error
27
- attr_accessor :message
28
- attr_accessor :line
29
-
30
- def initialize(msg, *args)
31
- @message = msg
32
- a = args.inject({}) { |a, i| a.merge! i if i.is_a? Hash; a }
33
- @line = a[:line] if a[:line]
34
- end
35
-
36
- def to_s
37
- @line ?
38
- "line #{@line}: #{@message}" :
39
- "#{@message}"
40
- end
41
- end
42
-
43
- extend self
44
-
45
- def version
46
- @version ||= begin
47
- v = File.open(File.join(File.dirname(__FILE__), '..', 'VERSION')) { |f| f.read.strip }
48
- v = v.match(/^[0-9]+(\.[0-9]+){2}/)[0] rescue v
49
- end
50
- end
51
-
52
- def compatible_with?(given_version)
53
- Gem::Version.new(version) >= Gem::Version.new(given_version)
5
+ require 'fileutils'
6
+ require 'ostruct'
7
+ require 'yaml'
8
+ require 'tilt'
9
+ require 'shake'
10
+
11
+ class Hyde
12
+ VERSION = "0.1.0"
13
+ PREFIX = File.expand_path('../', __FILE__)
14
+
15
+ Error = Class.new(StandardError)
16
+ LegacyError = Class.new(Error)
17
+ VersionError = Class.new(Error)
18
+ NoGemError = Class.new(Error)
19
+
20
+ autoload :Project, "#{PREFIX}/hyde/project"
21
+ autoload :Page, "#{PREFIX}/hyde/page"
22
+ autoload :Meta, "#{PREFIX}/hyde/meta"
23
+ autoload :Config, "#{PREFIX}/hyde/config"
24
+ autoload :CLI, "#{PREFIX}/hyde/cli"
25
+ autoload :Layout, "#{PREFIX}/hyde/layout"
26
+ autoload :Partial, "#{PREFIX}/hyde/partial"
27
+ autoload :Helpers, "#{PREFIX}/hyde/helpers"
28
+
29
+ def self.version
30
+ VERSION
54
31
  end
55
32
  end
@@ -0,0 +1 @@
1
+ $extension_loaded = 'aoeu'
@@ -0,0 +1,8 @@
1
+ hyde_requirement: 0.1
2
+ site_path: site
3
+ extensions_path: extensions
4
+ output_path: public
5
+ ignore:
6
+ - **/*~
7
+ - **/compass/**/*
8
+ - **/_*.scss
@@ -0,0 +1 @@
1
+ %h1 hey
@@ -0,0 +1,2 @@
1
+ Parent:
2
+ <a href='/index.html'>Back to parent</a>
@@ -0,0 +1,2 @@
1
+ Parent:
2
+ <a href='/about/index.html'>Back to parent</a>
@@ -0,0 +1 @@
1
+ <h1>Yo</h1>
@@ -0,0 +1,8 @@
1
+ hyde_requirement: 0.1
2
+ site_path: site
3
+ extensions_path: extensions
4
+ output_path: public
5
+ ignore:
6
+ - **/*~
7
+ - **/compass/**/*
8
+ - **/_*.scss
@@ -0,0 +1,4 @@
1
+ title: Hello there
2
+ type: nonexistent
3
+ --
4
+ #ok
@@ -0,0 +1,2 @@
1
+ <div id='default'><h1>Boo!</h1></div>
2
+ <div id='number'>10</div>
@@ -0,0 +1,8 @@
1
+ hyde_requirement: 0.1
2
+ site_path: site
3
+ extensions_path: extensions
4
+ output_path: public
5
+ ignore:
6
+ - **/*~
7
+ - **/compass/**/*
8
+ - **/_*.scss
@@ -0,0 +1,2 @@
1
+ #default!= yield
2
+ #number!= page.ten
@@ -0,0 +1,4 @@
1
+ layout: post
2
+ ten: 10
3
+ --
4
+ Boo!
@@ -0,0 +1,2 @@
1
+ div {
2
+ color: red; }
@@ -0,0 +1,5 @@
1
+ <html>
2
+ <h1>Site</h1>
3
+ <hr />
4
+ <div id='content'>lo.</div>
5
+ </html>
@@ -0,0 +1,2 @@
1
+ dir {
2
+ color: #332211; }
@@ -0,0 +1,5 @@
1
+ <html>
2
+ <h1>Site</h1>
3
+ <hr />
4
+ <div id='content'><h1>Welcome!</h1></div>
5
+ </html>
@@ -0,0 +1 @@
1
+ Hello.
@@ -0,0 +1,7 @@
1
+ <ul>
2
+ <li>Home</li>
3
+ <li>About us</li>
4
+ </ul>
5
+ <h2>Home page</h2>
6
+ &lt;a&gt;
7
+ <a>
@@ -0,0 +1,9 @@
1
+ hyde_requirement: "0.1"
2
+ site_path: site
3
+ layouts_path: layouts
4
+ partials_path: partials
5
+ output_path: public
6
+ ignore:
7
+ - **/*~
8
+ - **/compass/**/*
9
+ - **/_*.scss
@@ -0,0 +1,4 @@
1
+ %html
2
+ %h1 Site
3
+ %hr
4
+ #content!= yield
@@ -0,0 +1,3 @@
1
+ %ul
2
+ %li Home
3
+ %li About us
@@ -0,0 +1 @@
1
+ div { color: red; }
@@ -0,0 +1 @@
1
+ lo.
@@ -0,0 +1,2 @@
1
+ $red: #321;
2
+ dir { color: $red; }
@@ -0,0 +1 @@
1
+ %h1 Welcome!
@@ -0,0 +1 @@
1
+ Hello.
@@ -0,0 +1,7 @@
1
+ layout: false
2
+ lol: <a>
3
+ --
4
+ != partial :'menu'
5
+ %h2 Home page
6
+ = page.meta.lol
7
+ != page.meta.lol
@@ -0,0 +1,2 @@
1
+ Parent:
2
+ <a href='/index.html'>Back to parent</a>
@@ -0,0 +1,2 @@
1
+ Parent:
2
+ <a href='/about/index.html'>Back to parent</a>
@@ -0,0 +1 @@
1
+ <h1>Yo</h1>
@@ -0,0 +1,8 @@
1
+ hyde_requirement: 0.1
2
+ site_path: site
3
+ extensions_path: extensions
4
+ output_path: public
5
+ ignore:
6
+ - **/*~
7
+ - **/compass/**/*
8
+ - **/_*.scss
@@ -0,0 +1,3 @@
1
+ Parent:
2
+ - if parent
3
+ %a{href: parent.path} Back to parent
@@ -0,0 +1,3 @@
1
+ Parent:
2
+ - if parent
3
+ %a{href: parent.path} Back to parent
@@ -0,0 +1,3 @@
1
+ title: Hello there
2
+ --
3
+ %h1 Yo
@@ -0,0 +1,8 @@
1
+ hyde_requirement: 0.1
2
+ site_path: site
3
+ extensions_path: extensions
4
+ output_path: public
5
+ ignore:
6
+ - **/*~
7
+ - **/compass/**/*
8
+ - **/_*.scss
@@ -0,0 +1,4 @@
1
+ position: 2
2
+ title: Two, hardy
3
+ --
4
+ ="..."
@@ -0,0 +1,4 @@
1
+ position: 1
2
+ title: One, intrepid
3
+ --
4
+ ="..."
@@ -0,0 +1,3 @@
1
+ - children.each do |p|
2
+ %li
3
+ %a{:href => p.path}= p
@@ -0,0 +1 @@
1
+ <div id='post'><h1>hello-there</h1></div>
@@ -0,0 +1,12 @@
1
+ class Hyde::Page::Post < Hyde::Page
2
+ def css_class
3
+ title.downcase.gsub(' ', '-')
4
+ end
5
+
6
+ def default_layout
7
+ 'post' if html?
8
+ end
9
+
10
+ # Alias
11
+ ::Post = self
12
+ end