diff --git a/doc-src/Rakefile b/doc-src/Rakefile index 1d3e0559..5571a53f 100644 --- a/doc-src/Rakefile +++ b/doc-src/Rakefile @@ -1,19 +1 @@ require 'nanoc3/tasks' - -desc "Make files into items." -task :itemize do - Dir.glob("content/**/*").each do |filename| - yaml_file = File.join(File.dirname(filename), File.basename(filename)[0..-(File.extname(filename).size)]) + "yaml" - if File.extname(filename) == ".yaml" - # skip - elsif File.exists?(yaml_file) - # skip - elsif File.directory?(filename) - else - puts "Itemizing #{filename}" - File.open(yaml_file,"w") do |f| - f.write("---\nextension: #{File.extname(filename)[1..-1]}") - end - end - end -end diff --git a/doc-src/config.yaml b/doc-src/config.yaml index 9195123a..199a304c 100644 --- a/doc-src/config.yaml +++ b/doc-src/config.yaml @@ -2,7 +2,7 @@ data_sources: - items_root: / layouts_root: / - type: filesystem_compact + type: better_combined - items_root: /assets layouts_root: /assets type: filesystem_assets diff --git a/doc-src/content/examples/blueprint/grid/pull.haml b/doc-src/content/examples/blueprint/grid/pull.haml index be90d9dd..86605bcf 100644 --- a/doc-src/content/examples/blueprint/grid/pull.haml +++ b/doc-src/content/examples/blueprint/grid/pull.haml @@ -1 +1,9 @@ +--- +title: Blueprint Pull Example +description: Uses pull to change the display order of columns. +framework: blueprint +stylesheet: blueprint/_grid.sass +mixin: pull +example: true +--- = render "partials/example" diff --git a/doc-src/content/examples/blueprint/grid/pull.yaml b/doc-src/content/examples/blueprint/grid/pull.yaml deleted file mode 100644 index 5817f484..00000000 --- a/doc-src/content/examples/blueprint/grid/pull.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Blueprint Pull Example -description: Uses pull to change the display order of columns. -framework: blueprint -stylesheet: blueprint/_grid.sass -mixin: pull -example: true \ No newline at end of file diff --git a/doc-src/content/examples/blueprint/grid/pull/markup.yaml b/doc-src/content/examples/blueprint/grid/pull/markup.yaml deleted file mode 100644 index e69de29b..00000000 diff --git a/doc-src/content/examples/blueprint/grid/pull/stylesheet.sass b/doc-src/content/examples/blueprint/grid/pull/stylesheet.sass index f4825c60..5c5b6c12 100644 --- a/doc-src/content/examples/blueprint/grid/pull/stylesheet.sass +++ b/doc-src/content/examples/blueprint/grid/pull/stylesheet.sass @@ -1,3 +1,5 @@ +--- +--- !blueprint_grid_columns = 3 @import blueprint/grid.sass diff --git a/doc-src/content/examples/blueprint/grid/pull/stylesheet.yaml b/doc-src/content/examples/blueprint/grid/pull/stylesheet.yaml deleted file mode 100644 index e5219766..00000000 --- a/doc-src/content/examples/blueprint/grid/pull/stylesheet.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -title: A New Item diff --git a/doc-src/content/index.haml b/doc-src/content/index.haml index 4e349018..e2c6bfa9 100644 --- a/doc-src/content/index.haml +++ b/doc-src/content/index.haml @@ -1,3 +1,6 @@ +--- +title: Home +--- %h1 Compass Documentation %p diff --git a/doc-src/content/index.yaml b/doc-src/content/index.yaml deleted file mode 100644 index cb60025b..00000000 --- a/doc-src/content/index.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -title: Home diff --git a/doc-src/content/reference/blueprint.haml b/doc-src/content/reference/blueprint.haml index 5ec71218..bb87e93d 100644 --- a/doc-src/content/reference/blueprint.haml +++ b/doc-src/content/reference/blueprint.haml @@ -1,3 +1,11 @@ +--- +title: Blueprint Module +crumb: Blueprint +framework: blueprint +stylesheet: _blueprint.sass +classnames: + - reference +--- %h1= item[:title] = render "partials/breadcrumbs" diff --git a/doc-src/content/reference/blueprint.yaml b/doc-src/content/reference/blueprint.yaml deleted file mode 100644 index 58862e4d..00000000 --- a/doc-src/content/reference/blueprint.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Blueprint Module -crumb: Blueprint -framework: blueprint -stylesheet: _blueprint.sass -classnames: - - reference diff --git a/doc-src/content/reference/blueprint/colors.haml b/doc-src/content/reference/blueprint/colors.haml index b75e7db4..9afc05b9 100644 --- a/doc-src/content/reference/blueprint/colors.haml +++ b/doc-src/content/reference/blueprint/colors.haml @@ -1,3 +1,11 @@ +--- +title: Blueprint Color Module +crumb: Colors +framework: blueprint +stylesheet: blueprint/_colors.sass +classnames: + - reference +--- %h1= item[:title] = render "partials/breadcrumbs" diff --git a/doc-src/content/reference/blueprint/colors.yaml b/doc-src/content/reference/blueprint/colors.yaml deleted file mode 100644 index 6404943f..00000000 --- a/doc-src/content/reference/blueprint/colors.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Blueprint Color Module -crumb: Colors -framework: blueprint -stylesheet: blueprint/_colors.sass -classnames: - - reference diff --git a/doc-src/content/reference/blueprint/grid.haml b/doc-src/content/reference/blueprint/grid.haml index 4b002a0e..f6c88c74 100644 --- a/doc-src/content/reference/blueprint/grid.haml +++ b/doc-src/content/reference/blueprint/grid.haml @@ -1,3 +1,11 @@ +--- +title: Blueprint Grid Module +crumb: Grid +framework: blueprint +stylesheet: blueprint/_grid.sass +classnames: + - reference +--- %h1= item[:title] = render "partials/breadcrumbs" diff --git a/doc-src/content/reference/blueprint/grid.yaml b/doc-src/content/reference/blueprint/grid.yaml deleted file mode 100644 index f7877979..00000000 --- a/doc-src/content/reference/blueprint/grid.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Blueprint Grid Module -crumb: Grid -framework: blueprint -stylesheet: blueprint/_grid.sass -classnames: - - reference diff --git a/doc-src/content/stylesheets/example.yaml b/doc-src/content/stylesheets/example.yaml deleted file mode 100644 index 2fbf0ffd..00000000 --- a/doc-src/content/stylesheets/example.yaml +++ /dev/null @@ -1 +0,0 @@ ---- {} diff --git a/doc-src/content/stylesheets/main.yaml b/doc-src/content/stylesheets/main.yaml deleted file mode 100644 index 2fbf0ffd..00000000 --- a/doc-src/content/stylesheets/main.yaml +++ /dev/null @@ -1 +0,0 @@ ---- {} diff --git a/doc-src/content/tutorials/blueprint.haml b/doc-src/content/tutorials/blueprint.haml index f5e78b70..bbec29c3 100644 --- a/doc-src/content/tutorials/blueprint.haml +++ b/doc-src/content/tutorials/blueprint.haml @@ -1,3 +1,8 @@ +--- +title: Blueprint Framework +classnames: + - tutorial +--- %h1= item[:title] %h2#semantic-blueprint Semantic Blueprint Template diff --git a/doc-src/content/tutorials/blueprint.yaml b/doc-src/content/tutorials/blueprint.yaml deleted file mode 100644 index 8dfa9d03..00000000 --- a/doc-src/content/tutorials/blueprint.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Blueprint Framework -classnames: - - tutorial diff --git a/doc-src/layouts/default.yaml b/doc-src/layouts/default.yaml deleted file mode 100644 index 20670d5f..00000000 --- a/doc-src/layouts/default.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- {} - diff --git a/doc-src/layouts/dialog.yaml b/doc-src/layouts/dialog.yaml deleted file mode 100644 index 2fbf0ffd..00000000 --- a/doc-src/layouts/dialog.yaml +++ /dev/null @@ -1 +0,0 @@ ---- {} diff --git a/doc-src/layouts/example.yaml b/doc-src/layouts/example.yaml deleted file mode 100644 index 2fbf0ffd..00000000 --- a/doc-src/layouts/example.yaml +++ /dev/null @@ -1 +0,0 @@ ---- {} diff --git a/doc-src/layouts/partials/breadcrumbs.yaml b/doc-src/layouts/partials/breadcrumbs.yaml deleted file mode 100644 index 2fbf0ffd..00000000 --- a/doc-src/layouts/partials/breadcrumbs.yaml +++ /dev/null @@ -1 +0,0 @@ ---- {} diff --git a/doc-src/layouts/partials/example.yaml b/doc-src/layouts/partials/example.yaml deleted file mode 100644 index 2fbf0ffd..00000000 --- a/doc-src/layouts/partials/example.yaml +++ /dev/null @@ -1 +0,0 @@ ---- {} diff --git a/doc-src/layouts/partials/reference/constants.yaml b/doc-src/layouts/partials/reference/constants.yaml deleted file mode 100644 index 2fbf0ffd..00000000 --- a/doc-src/layouts/partials/reference/constants.yaml +++ /dev/null @@ -1 +0,0 @@ ---- {} diff --git a/doc-src/layouts/partials/reference/imports.yaml b/doc-src/layouts/partials/reference/imports.yaml deleted file mode 100644 index 2fbf0ffd..00000000 --- a/doc-src/layouts/partials/reference/imports.yaml +++ /dev/null @@ -1 +0,0 @@ ---- {} diff --git a/doc-src/layouts/partials/reference/mixins.yaml b/doc-src/layouts/partials/reference/mixins.yaml deleted file mode 100644 index 2fbf0ffd..00000000 --- a/doc-src/layouts/partials/reference/mixins.yaml +++ /dev/null @@ -1 +0,0 @@ ---- {} diff --git a/doc-src/lib/data_sources/better_combined_datasource.rb b/doc-src/lib/data_sources/better_combined_datasource.rb new file mode 100644 index 00000000..18e9b143 --- /dev/null +++ b/doc-src/lib/data_sources/better_combined_datasource.rb @@ -0,0 +1,28 @@ +# This is basically the default filesystem_combined datasource +# But items without a metadata header don't get an error. +class BetterFilesystemCombined < Nanoc3::DataSources::FilesystemCombined + identifier :better_combined + + def parse_file(filename, kind) + contents = File.read(filename) + if contents =~ /^(-{5}|-{3})/ + # Split file + pieces = contents.split(/^(-{5}|-{3})/).compact + if pieces.size < 4 + raise RuntimeError.new( + "The file '#{filename}' does not seem to be a nanoc #{kind}" + ) + end + + # Parse + meta = YAML.load(pieces[2]) || {} + content = pieces[4..-1].join.strip + + [ meta, content ] + else + [{}, contents] + end + end + +end + \ No newline at end of file