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__), '..'))
|
project_path = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
||||||
css_dir = "../docs/stylesheets"
|
css_dir = "../docs/stylesheets"
|
||||||
sass_dir = "content/stylesheets"
|
sass_dir = "content/stylesheets"
|
||||||
images_dir = "content/images"
|
images_dir = "assets/images"
|
||||||
http_images_dir = "images"
|
http_images_dir = "images"
|
||||||
javascripts_dir = "content/javascripts"
|
javascripts_dir = "content/javascripts"
|
||||||
http_javascripts_dir = "javascripts"
|
http_javascripts_dir = "javascripts"
|
||||||
|
@ -4,11 +4,7 @@ require 'compass'
|
|||||||
|
|
||||||
Compass.configuration.parse "#{File.dirname(__FILE__)}/.compass/config.rb"
|
Compass.configuration.parse "#{File.dirname(__FILE__)}/.compass/config.rb"
|
||||||
|
|
||||||
compile '/css/*/' do
|
compile '/assets/*/' do
|
||||||
nil
|
|
||||||
end
|
|
||||||
|
|
||||||
compile '/images/*/' do
|
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -20,10 +16,6 @@ compile '/examples/*/stylesheet/' do
|
|||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
compile '/javascripts/*/' do
|
|
||||||
nil
|
|
||||||
end
|
|
||||||
|
|
||||||
compile '/examples/*/' do
|
compile '/examples/*/' do
|
||||||
filter :haml, :ugly => true
|
filter :haml, :ugly => true
|
||||||
layout 'example'
|
layout 'example'
|
||||||
@ -43,16 +35,16 @@ route '/stylesheets/_*/' do
|
|||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
route '/css/*/' do
|
route '/assets/css/*/' do
|
||||||
item.identifier.chop.gsub(%r{/css}, '/stylesheets')+"."+item[:extension]
|
"/stylesheets"+item.identifier.chop[11..-1]+"."+item[:extension]
|
||||||
end
|
end
|
||||||
|
|
||||||
route '/images/*/' do
|
route '/assets/images/*/' do
|
||||||
item.identifier.chop+"."+item[:extension]
|
item.identifier.chop[7..-1]+"."+item[:extension]
|
||||||
end
|
end
|
||||||
|
|
||||||
route '/javascripts/*/' do
|
route '/assets/javascripts/*/' do
|
||||||
item.identifier.chop+"."+item[:extension]
|
item.identifier.chop[7..-1]+"."+item[:extension]
|
||||||
end
|
end
|
||||||
|
|
||||||
route '/stylesheets/*/' do
|
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: /
|
- items_root: /
|
||||||
layouts_root: /
|
layouts_root: /
|
||||||
type: filesystem_compact
|
type: filesystem_compact
|
||||||
|
- items_root: /assets
|
||||||
|
layouts_root: /assets
|
||||||
|
type: filesystem_assets
|
||||||
output_dir: ../docs
|
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
|