Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Store links to generated pages so index can point to them.

  • Loading branch information...
commit d0677eae14cc0fd7c83bf5a9d1ed4701cf1a8e01 1 parent a5f72ca
@creationix authored
Showing with 8 additions and 113 deletions.
  1. +8 −4 build.js
  2. +0 −36 public/index.html
  3. +0 −73 public/pipe.css
View
12 build.js
@@ -39,7 +39,7 @@ var Filters = {
// Compiles
haml: function (haml) {
- return Haml.optimize(Haml.compile(haml));
+ return Haml.compile(haml);
},
less: function (less) {
@@ -121,6 +121,9 @@ function loop(obj, callback) {
function render(data) {
var Helpers, haml;
Helpers = {
+ github: function (name) {
+ return "http://github.com/" + name;
+ },
gravitar: function (email, size) {
size = size || 80
return "http://www.gravatar.com/avatar/" +
@@ -142,7 +145,8 @@ function render(data) {
// Generate a page for each article...
loop(data.articles, function (name, props) {
- File.write(PUBLIC_DIR + "/" + name + ".html", haml("layout", {
+ props.link = name + ".html";
+ File.write(PUBLIC_DIR + "/" + props.link, haml("layout", {
title: props.title,
content: haml("article", props)
}));
@@ -150,8 +154,8 @@ function render(data) {
// Generate a page for each author...
loop(data.authors, function (name, props) {
- var filename = name.toLowerCase().replace(/ /g, "_") + ".html";
- File.write(PUBLIC_DIR + "/" + filename, haml("layout", {
+ props.link = name.toLowerCase().replace(/ /g, "_") + ".html";
+ File.write(PUBLIC_DIR + "/" + props.link, haml("layout", {
title: "About " + name,
content: haml("author", props)
}));
View
36 public/index.html
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head>
- <title>HowToNode.org</title>
- <link type="text/css" rel="stylesheet" href="pipe.css" />
- <link type="text/css" rel="stylesheet" href="sh_vim-dark.css" />
-
-</head>
-
-<body>
-
- <h2>HowToNode.org</h2>
-
- <p>This will be a site that shows tutorials on various nodejs topics. </p>
- <div id="disqus_thread"></div><script type="text/javascript" src="http://disqus.com/forums/howtonodeorg/embed.js"></script><noscript><a href="http://disqus.com/forums/howtonodeorg/?url=ref">View the discussion thread.</a></noscript><a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
-
- <script type="text/javascript">
- //<![CDATA[
- (function() {
- var links = document.getElementsByTagName('a');
- var query = '?';
- for(var i = 0; i < links.length; i++) {
- if(links[i].href.indexOf('#disqus_thread') >= 0) {
- query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
- }
- }
- document.write('<script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/howtonodeorg/get_num_replies.js' + query + '"></' + 'script>');
- })();
- //]]>
- </script>
-</body>
-</html>
-
View
73 public/pipe.css
@@ -1,73 +0,0 @@
-body {
- background: #22252a;
- color: #eee;
- font-size: 14pt;
- line-height: 150%;
- font-family: times, Times New Roman, times-roman, georgia, serif;
- max-width: 30em;
- margin: 0 0 5em 9em;
-}
-img {
- padding: 5em 0;
-}
-#toc {
- position: fixed;
- top: 2em;
- left: 0;
- width: 8em;
- font-size: 12pt;
- line-height: 150%;
-}
-#toctitle {
- display: none;
-}
-#toc ol {
- list-style: none;
-}
-#toc ol, .toclevel2 {
- margin: 0;
- padding: 0;
- padding-left: 1em;
-}
-#toc ol li {
- margin: 0;
- padding: 0;
-}
-#toc a { color: #aaa; }
-
-h1, h2, h3, h4 {
- color: #B0C4DE;
- margin: 2em 0;
-}
-
-h1 code, h2 code, h3 code, h4 code,
-h1 a, h2 a, h3 a, h4 a
-{
- color: inherit;
- font-size: inherit;
-}
-
-pre, code {
- font-family: monospace;
- font-size: 13pt;
- color: #eee0e0;
-}
-
-pre {
- padding-left: 1em;
- border-left: 1px solid #444;
-}
-
-dd {
- margin: 1em 0;
- margin-left: 1em;
-}
-
-a { color: #cd5; text-decoration: none; }
-a:hover { text-decoration: underline; }
-
-.highlight {
- background: #733;
- padding: 0.2em 0;
-}
-
Please sign in to comment.
Something went wrong with that request. Please try again.