Skip to content

Commit 0ec57b8

Browse files
committed
default nanoc site
0 parents  commit 0ec57b8

File tree

7 files changed

+214
-0
lines changed

7 files changed

+214
-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: /

content/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: Home
3+
---
4+
5+
<h1>A Brand New nanoc Site</h1>
6+
7+
<p>You’ve just created a new nanoc site. The page you are looking at right now is the home page for your site. To get started, consider replacing this default homepage with your own customized homepage. Some pointers on how to do so:</p>
8+
9+
<ul>
10+
<li><p><strong>Change this page’s content</strong> by editing the “index.html” file in the “content” directory. This is the actual page content, and therefore doesn’t include the header, sidebar or style information (those are part of the layout).</p></li>
11+
<li><p><strong>Change the layout</strong>, which is the “default.html” file in the “layouts” directory, and create something unique (and hopefully less bland).</p></li>
12+
</ul>
13+
14+
<p>If you need any help with customizing your nanoc web site, be sure to check out the documentation (see sidebar), and be sure to subscribe to the discussion group (also see sidebar). Enjoy!</p>

content/stylesheet.css

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
* {
2+
margin: 0;
3+
padding: 0;
4+
5+
font-family: Georgia, Palatino, Times, 'Times New Roman', sans-serif;
6+
}
7+
8+
body {
9+
background: #fff;
10+
}
11+
12+
a {
13+
text-decoration: none;
14+
}
15+
16+
a:link,
17+
a:visited {
18+
color: #f30;
19+
}
20+
21+
a:hover {
22+
color: #f90;
23+
}
24+
25+
#main {
26+
position: absolute;
27+
28+
top: 40px;
29+
left: 280px;
30+
31+
width: 500px;
32+
}
33+
34+
#main h1 {
35+
font-size: 40px;
36+
font-weight: normal;
37+
38+
line-height: 40px;
39+
40+
letter-spacing: -1px;
41+
}
42+
43+
#main p {
44+
margin: 20px 0;
45+
46+
font-size: 15px;
47+
48+
line-height: 20px;
49+
}
50+
51+
#main ul {
52+
margin: 20px;
53+
}
54+
55+
#main li {
56+
list-style-type: square;
57+
58+
font-size: 15px;
59+
60+
line-height: 20px;
61+
}
62+
63+
#sidebar {
64+
position: absolute;
65+
66+
top: 40px;
67+
left: 20px;
68+
width: 200px;
69+
70+
padding: 20px 20px 0 0;
71+
72+
border-right: 1px solid #ccc;
73+
74+
text-align: right;
75+
}
76+
77+
#sidebar h2 {
78+
text-transform: uppercase;
79+
80+
font-size: 13px;
81+
82+
color: #333;
83+
84+
letter-spacing: 1px;
85+
86+
line-height: 20px;
87+
}
88+
89+
#sidebar ul {
90+
list-style-type: none;
91+
92+
margin: 20px 0;
93+
}
94+
95+
#sidebar li {
96+
font-size: 14px;
97+
98+
line-height: 20px;
99+
}

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>

lib/default.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# All files in the 'lib' directory will be loaded
2+
# before nanoc starts compiling.

0 commit comments

Comments
 (0)