Move static resources around, adding new datasource to handle them · dubrie/developer.github.com@ecbcc8e · GitHub
Skip to content

Commit ecbcc8e

Browse files
committed
Move static resources around, adding new datasource to handle them
1 parent 9c2709c commit ecbcc8e

38 files changed

Lines changed: 317 additions & 289 deletions

.gitattributes

Lines changed: 1 addition & 0 deletions

Rakefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
require 'nanoc3/tasks'
22

3+
desc "Compile the site"
4+
task :compile do
5+
`nanoc compile`
6+
end
7+
38
desc "Publish to http://developer.github.com"
49
task :publish => [:clean] do
510
FileUtils.rm_r('output') if File.exist?('output')

Rules

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,7 @@
1010
# item, use the pattern “/about/*/”; “/about/*” will also select the parent,
1111
# because “*” matches zero or more characters.
1212

13-
compile '/css/*/' do
14-
# don’t filter or layout
15-
end
16-
17-
compile '/shared/css/*/' do
18-
# don’t filter or layout
19-
end
20-
21-
compile '/images/*' do
22-
end
23-
24-
compile '/shared/images/*' do
25-
end
26-
27-
compile '/shared/js/*' do
28-
end
29-
30-
compile '/assets/*' do
13+
compile '/static/*' do
3114
end
3215

3316
compile '*' do
@@ -38,28 +21,8 @@ compile '*' do
3821
layout 'default'
3922
end
4023

41-
route '/css/*/' do
42-
item.identifier.chomp('/') << '.css'
43-
end
44-
45-
route '/shared/css/*/' do
46-
item.identifier.chomp('/') << '.css'
47-
end
48-
49-
route '/images/*/' do
50-
item.identifier.chomp('/') << '.png'
51-
end
52-
53-
route '/shared/images/*/' do
54-
item.identifier.chomp('/') << '.png'
55-
end
56-
57-
route '/shared/js/*/' do
58-
item.identifier.chomp('/') << '.js'
59-
end
60-
61-
route '/assets/favicon/' do
62-
'/favicon.ico'
24+
route '/static/*' do
25+
item.identifier[7..-2]
6326
end
6427

6528
route '*' do

config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@ data_sources:
3939
# The path where layouts should be mounted. The layouts root behaves the
4040
# same as the items root, but applies to layouts rather than items.
4141
layouts_root: /
42+
43+
-
44+
type: static
45+
items_root: /static

lib/static.rb

Lines changed: 55 additions & 0 deletions
File renamed without changes.

0 commit comments

Comments
 (0)