Skip to content

Commit

Permalink
Initial commit after playing around a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles R. Hogg III committed Sep 6, 2012
1 parent fd35d66 commit 8df5586
Show file tree
Hide file tree
Showing 14 changed files with 497 additions and 0 deletions.
57 changes: 57 additions & 0 deletions Rules
@@ -0,0 +1,57 @@
#!/usr/bin/env ruby

# A few helpful tips about the Rules file:
#
# * The string given to #compile and #route are matching patterns for
# identifiers--not for paths. Therefore, you can’t match on extension.
#
# * The order of rules is important: for each item, only the first matching
# rule is applied.
#
# * Item identifiers start and end with a slash (e.g. “/about/” for the file
# “content/about.html”). To select all children, grandchildren, … of an
# item, use the pattern “/about/*/”; “/about/*” will also select the parent,
# because “*” matches zero or more characters.

compile '/stylesheet/' do
# don’t filter or layout
end

compile '/about/*' do
if item.binary?
# don't filter binary items
else
filter :pandoc
filter :pygments
layout 'default'
end
end

compile '*' do
if item.binary?
# don’t filter binary items
else
filter :erb
layout 'default'
end
end

route '/stylesheet/' do
'/style.css'
end

route '/Mathjax/' do
'/Mathjax.js'
end

route '*' do
if item.binary?
# Write item with identifier /foo/ to /foo.ext
item.identifier.chop + '.' + item[:extension]
else
# Write item with identifier /foo/ to /foo/index.html
item.identifier + 'index.html'
end
end

layout '*', :erb
77 changes: 77 additions & 0 deletions config.yaml
@@ -0,0 +1,77 @@
# A list of file extensions that nanoc will consider to be textual rather than
# binary. If an item with an extension not in this list is found, the file
# will be considered as binary.
text_extensions: [ 'coffee', 'css', 'erb', 'haml', 'handlebars', 'hb', 'htm', 'html', 'js', 'less', 'markdown', 'md', 'ms', 'mustache', 'php', 'rb', 'sass', 'scss', 'txt', 'xhtml', 'xml' ]

# The path to the directory where all generated files will be written to. This
# can be an absolute path starting with a slash, but it can also be path
# relative to the site directory.
output_dir: output

# A list of index filenames, i.e. names of files that will be served by a web
# server when a directory is requested. Usually, index files are named
# “index.html”, but depending on the web server, this may be something else,
# such as “default.htm”. This list is used by nanoc to generate pretty URLs.
index_filenames: [ 'index.html' ]

# Whether or not to generate a diff of the compiled content when compiling a
# site. The diff will contain the differences between the compiled content
# before and after the last site compilation.
enable_output_diff: false

prune:
# Whether to automatically remove files not managed by nanoc from the output
# directory. For safety reasons, this is turned off by default.
auto_prune: false

# Which files and directories you want to exclude from pruning. If you version
# your output directory, you should probably exclude VCS directories such as
# .git, .svn etc.
exclude: [ '.git', '.hg', '.svn', 'CVS' ]

# The data sources where nanoc loads its data from. This is an array of
# hashes; each array element represents a single data source. By default,
# there is only a single data source that reads data from the “content/” and
# “layout/” directories in the site directory.
data_sources:
-
# The type is the identifier of the data source. By default, this will be
# `filesystem_unified`.
type: filesystem_unified

# The path where items should be mounted (comparable to mount points in
# Unix-like systems). This is “/” by default, meaning that items will have
# “/” prefixed to their identifiers. If the items root were “/en/”
# instead, an item at content/about.html would have an identifier of
# “/en/about/” instead of just “/about/”.
items_root: /

# The path where layouts should be mounted. The layouts root behaves the
# same as the items root, but applies to layouts rather than items.
layouts_root: /

# Whether to allow periods in identifiers. When turned off, everything
# past the first period is considered to be the extension, and when
# turned on, only the characters past the last period are considered to
# be the extension. For example, a file named “content/about.html.erb”
# will have the identifier “/about/” when turned off, but when turned on
# it will become “/about.html/” instead.
allow_periods_in_identifiers: false

# Configuration for the “watch” command, which watches a site for changes and
# recompiles if necessary.
watcher:
# A list of directories to watch for changes. When editing this, make sure
# that the “output/” and “tmp/” directories are _not_ included in this list,
# because recompiling the site will cause these directories to change, which
# will cause the site to be recompiled, which will cause these directories
# to change, which will cause the site to be recompiled again, and so on.
dirs_to_watch: [ 'content', 'layouts', 'lib' ]

# A list of single files to watch for changes. As mentioned above, don’t put
# any files from the “output/” or “tmp/” directories in here.
files_to_watch: [ 'config.yaml', 'Rules' ]

# When to send notifications (using Growl or notify-send).
notify_on_compilation_success: true
notify_on_compilation_failure: true
30 changes: 30 additions & 0 deletions content/Mathjax.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions content/about.pd
@@ -0,0 +1,7 @@
# About the author

Charles R. Hogg III wishes he knew how to use pandoc. So, here's some vim code:

```vim
setlocal nohlsearch
```
5 changes: 5 additions & 0 deletions content/about.yaml
@@ -0,0 +1,5 @@
---
title: About the author
---


1 change: 1 addition & 0 deletions content/about/out.html
@@ -0,0 +1 @@
--- title: About this website --- # Motivation Why do a new website? The time is right. ## An online home for everything I found I needed a home for my research # Needs What do I need this website to be able to do? ## Syntax highlighting [Coderay](http://coderay.rubychan.de/ "Coderay - Fast and easy syntax highlighting for selected languages.") or [pygments](http://pygments.org/ "pygments - Python syntax highlighting")? Coderay looks good, and has a nice, expressive Ruby syntax. But it doesn't highlight `R` _or_ `vimscript`. Pygments _does_ -- as well as [a whole lot more](http://pygments.org/languages/ "The ever-growing range of languages supported by pygments")! I'm going with pygments. ### Problems with pandoc I do all my writing in [pandoc](http://johnmacfarlane.net/pandoc/index.html "Pandoc - a universal document converter"). It seems like the most flexible markdown superset that meets _all_ my needs: blogging, scientific papers, and talk slides. ~~~~~~~~~~~~~~~ {.vim .numberLines startFrom="3"} let g:adjective = "flexible" echom "I hear pandoc is pretty" g:adjective ~~~~~~~~~~~~~~~ Okay, I see pandoc doesn't have support for `vim` highlighting. ```bash for I in ls do echo "$I" done ``` ```vim let g:adjective = "flexible" echom "I hear pandoc is pretty" g:adjective ``` $$\sum_{i=0}^\infty \frac{1}{2^i}$$
52 changes: 52 additions & 0 deletions content/about/site.pd
@@ -0,0 +1,52 @@
# Motivations

Why do a new website? Because the time is right.

## An online home for everything

I found I needed a home for my research

# Needs

What do I need this website to be able to do?

## Syntax highlighting

[Coderay](http://coderay.rubychan.de/ "Coderay - Fast and easy syntax highlighting for selected languages.")
or
[pygments](http://pygments.org/ "pygments - Python syntax highlighting")?

Coderay looks good, and has a nice, expressive Ruby syntax.
But it doesn't highlight `R` _or_ `vimscript`.
Pygments _does_ -- as well as [a whole lot more](http://pygments.org/languages/
"The ever-growing range of languages supported by pygments")!

I'm going with pygments.

### Problems with pandoc

I do all my writing in [pandoc](http://johnmacfarlane.net/pandoc/index.html
"Pandoc - a universal document converter").
It seems like the most flexible markdown superset that meets _all_ my needs:
blogging, scientific papers, and talk slides.

~~~~~~~~~~~~~~~ {.vim .numberLines startFrom="3"}
let g:adjective = "flexible"
echom "I hear pandoc is pretty" g:adjective
~~~~~~~~~~~~~~~

Okay, I see pandoc doesn't have support for `vim` highlighting.

```bash
for I in ls
do
echo "$I"
done
```

```vim
let g:adjective = "flexible"
echom "I hear pandoc is pretty" g:adjective
```

$$\sum_{i=0}^\infty \frac{1}{2^i}$$ should work
3 changes: 3 additions & 0 deletions content/about/site.yaml
@@ -0,0 +1,3 @@
---
title: About this website
---
16 changes: 16 additions & 0 deletions content/index.html
@@ -0,0 +1,16 @@
---
title: Hurry up already!
---

<h1>A Brand New nanoc Site</h1>

<p>One small step for Charles Hogg; one giant leap for... actually, not a giant leap yet.</p>

<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>

<ul>
<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>
<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>
</ul>

<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>
5 changes: 5 additions & 0 deletions content/software/gppois.html
@@ -0,0 +1,5 @@
---
title: A New Item
---

Hi, I'm a new item!

0 comments on commit 8df5586

Please sign in to comment.