Create an asset datasource so that we don't need all those silly yaml files.
@ -6,7 +6,7 @@ http_path = "/"
|
||||
project_path = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
||||
css_dir = "../docs/stylesheets"
|
||||
sass_dir = "content/stylesheets"
|
||||
images_dir = "content/images"
|
||||
images_dir = "assets/images"
|
||||
http_images_dir = "images"
|
||||
javascripts_dir = "content/javascripts"
|
||||
http_javascripts_dir = "javascripts"
|
||||
|
@ -4,11 +4,7 @@ require 'compass'
|
||||
|
||||
Compass.configuration.parse "#{File.dirname(__FILE__)}/.compass/config.rb"
|
||||
|
||||
compile '/css/*/' do
|
||||
nil
|
||||
end
|
||||
|
||||
compile '/images/*/' do
|
||||
compile '/assets/*/' do
|
||||
nil
|
||||
end
|
||||
|
||||
@ -20,10 +16,6 @@ compile '/examples/*/stylesheet/' do
|
||||
nil
|
||||
end
|
||||
|
||||
compile '/javascripts/*/' do
|
||||
nil
|
||||
end
|
||||
|
||||
compile '/examples/*/' do
|
||||
filter :haml, :ugly => true
|
||||
layout 'example'
|
||||
@ -43,16 +35,16 @@ route '/stylesheets/_*/' do
|
||||
nil
|
||||
end
|
||||
|
||||
route '/css/*/' do
|
||||
item.identifier.chop.gsub(%r{/css}, '/stylesheets')+"."+item[:extension]
|
||||
route '/assets/css/*/' do
|
||||
"/stylesheets"+item.identifier.chop[11..-1]+"."+item[:extension]
|
||||
end
|
||||
|
||||
route '/images/*/' do
|
||||
item.identifier.chop+"."+item[:extension]
|
||||
route '/assets/images/*/' do
|
||||
item.identifier.chop[7..-1]+"."+item[:extension]
|
||||
end
|
||||
|
||||
route '/javascripts/*/' do
|
||||
item.identifier.chop+"."+item[:extension]
|
||||
route '/assets/javascripts/*/' do
|
||||
item.identifier.chop[7..-1]+"."+item[:extension]
|
||||
end
|
||||
|
||||
route '/stylesheets/*/' do
|
||||
|
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 260 B |
Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 251 B |
Before Width: | Height: | Size: 178 B After Width: | Height: | Size: 178 B |
Before Width: | Height: | Size: 104 B After Width: | Height: | Size: 104 B |
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 125 B |
Before Width: | Height: | Size: 105 B After Width: | Height: | Size: 105 B |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 90 B After Width: | Height: | Size: 90 B |
Before Width: | Height: | Size: 167 B After Width: | Height: | Size: 167 B |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 867 B After Width: | Height: | Size: 867 B |
@ -3,4 +3,7 @@ data_sources:
|
||||
- items_root: /
|
||||
layouts_root: /
|
||||
type: filesystem_compact
|
||||
- items_root: /assets
|
||||
layouts_root: /assets
|
||||
type: filesystem_assets
|
||||
output_dir: ../docs
|
||||
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: png
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: png
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: png
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: png
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: png
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: png
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: png
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: png
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: png
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: png
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: png
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: png
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: png
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: png
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: css
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: gif
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: js
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: js
|
@ -1,2 +0,0 @@
|
||||
---
|
||||
extension: js
|
15
doc-src/lib/data_sources/asset_data_source.rb
Normal file
@ -0,0 +1,15 @@
|
||||
class AssetDataSource < Nanoc3::DataSource
|
||||
identifier :filesystem_assets
|
||||
|
||||
def items
|
||||
files = []
|
||||
Dir.glob("assets/**/*").each do |f|
|
||||
files << f if File.file?(f)
|
||||
end
|
||||
files.map do |f|
|
||||
identifier = f[7..-1].gsub(/\.[^.]+$/,'')+"/"
|
||||
attrs = {:extension => File.extname(f)[1..-1]}
|
||||
Nanoc3::Item.new(File.read(f), attrs, identifier, File.mtime(f))
|
||||
end
|
||||
end
|
||||
end
|