Skip to content

Commit a8a473a

Browse files
committed
Use nanoc
1 parent 5243d3f commit a8a473a

File tree

4 files changed

+99
-0
lines changed

4 files changed

+99
-0
lines changed

Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require 'nanoc3/tasks'

Rules

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env ruby
2+
3+
# A few helpful tips about the Rules file:
4+
#
5+
# * The order of rules is important: for each item, only the first matching
6+
# rule is applied.
7+
#
8+
# * Item identifiers start and end with a slash (e.g. “/about/” for the file
9+
# “content/about.html”). To select all children, grandchildren, … of an
10+
# item, use the pattern “/about/*/”; “/about/*” will also select the parent,
11+
# because “*” matches zero or more characters.
12+
13+
compile '/stylesheet/' do
14+
# don’t filter or layout
15+
end
16+
17+
compile '*' do
18+
filter :erb
19+
layout 'default'
20+
end
21+
22+
route '/stylesheet/' do
23+
'/style.css'
24+
end
25+
26+
route '*' do
27+
item.identifier + 'index.html'
28+
end
29+
30+
layout '*', :erb

config.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# A list of file extensions that nanoc will consider to be textual rather than
2+
# binary. If an item with an extension not in this list is found, the file
3+
# will be considered as binary.
4+
text_extensions: [ 'css', 'erb', 'haml', 'htm', 'html', 'js', 'less', 'markdown', 'md', 'php', 'rb', 'sass', 'scss', 'txt', 'xhtml', 'xml' ]
5+
6+
# The path to the directory where all generated files will be written to. This
7+
# can be an absolute path starting with a slash, but it can also be path
8+
# relative to the site directory.
9+
output_dir: output
10+
11+
# A list of index filenames, i.e. names of files that will be served by a web
12+
# server when a directory is requested. Usually, index files are named
13+
# “index.hml”, but depending on the web server, this may be something else,
14+
# such as “default.htm”. This list is used by nanoc to generate pretty URLs.
15+
index_filenames: [ 'index.html' ]
16+
17+
# Whether or not to generate a diff of the compiled content when compiling a
18+
# site. The diff will contain the differences between the compiled content
19+
# before and after the last site compilation.
20+
enable_output_diff: false
21+
22+
# The data sources where nanoc loads its data from. This is an array of
23+
# hashes; each array element represents a single data source. By default,
24+
# there is only a single data source that reads data from the “content/” and
25+
# “layout/” directories in the site directory.
26+
data_sources:
27+
-
28+
# The type is the identifier of the data source. By default, this will be
29+
# `filesystem_unified`.
30+
type: filesystem_unified
31+
32+
# The path where items should be mounted (comparable to mount points in
33+
# Unix-like systems). This is “/” by default, meaning that items will have
34+
# “/” prefixed to their identifiers. If the items root were “/en/”
35+
# instead, an item at content/about.html would have an identifier of
36+
# “/en/about/” instead of just “/about/”.
37+
items_root: /
38+
39+
# The path where layouts should be mounted. The layouts root behaves the
40+
# same as the items root, but applies to layouts rather than items.
41+
layouts_root: /

layouts/default.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE HTML>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>A Brand New nanoc Site - <%= @item[:title] %></title>
6+
<link rel="stylesheet" type="text/css" href="/style.css" media="screen">
7+
<meta name="generator" content="nanoc 3.1.6">
8+
</head>
9+
<body>
10+
<div id="main">
11+
<%= yield %>
12+
</div>
13+
<div id="sidebar">
14+
<h2>Documentation</h2>
15+
<ul>
16+
<li><a href="http://nanoc.stoneship.org/docs/">Documentation</a></li>
17+
<li><a href="http://nanoc.stoneship.org/docs/3-getting-started/">Getting Started</a></li>
18+
</ul>
19+
<h2>Community</h2>
20+
<ul>
21+
<li><a href="http://groups.google.com/group/nanoc/">Discussion Group</a></li>
22+
<li><a href="irc://chat.freenode.net/#nanoc">IRC Channel</a></li>
23+
<li><a href="http://projects.stoneship.org/trac/nanoc/">Wiki</a></li>
24+
</ul>
25+
</div>
26+
</body>
27+
</html>

0 commit comments

Comments
 (0)