├── CNAME
├── .gitignore
├── images
└── gallery-screenshot.png
├── Makefile
├── index.jade
├── _config.json
├── javascripts
└── site.js
├── _posts
├── 2011-07-29-pop-0.0.9.md
├── 2011-08-02-pop-0.1.0.md
├── 2011-08-18-pop-0.1.1.md
├── 2011-07-26-pop-0.0.6.md
├── 2011-07-24-pop-0.0.4.md
├── 2011-07-23-pop-0.0.3.md
├── 2011-08-23-pop-ga.md
├── 2011-07-21-example-post-about-something.md
├── 2011-07-22-pop-0.0.2.md
├── 2011-07-28-pop-0.0.8.md
├── 2011-07-27-pop-0.0.7.md
└── 2011-07-25-pop-0.0.5.md
├── tags.jade
├── _layouts
├── post.jade
└── default.jade
├── stylesheets
└── screen.styl
└── doc
└── index.html
/CNAME:
--------------------------------------------------------------------------------
1 | popjs.com
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.sw?
2 | .DS_Store
3 | _site/
4 | node_modules/
5 |
--------------------------------------------------------------------------------
/images/gallery-screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexyoung/pop-pages/master/images/gallery-screenshot.png
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | docs:
2 | @curl https://raw.github.com/alexyoung/pop/master/doc/index.html > doc/index.html
3 |
4 | .PHONY: docs
5 |
--------------------------------------------------------------------------------
/index.jade:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | title: Pop, A Static Site Builder
4 | paginate: true
5 | ---
6 |
7 | !{paginatedPosts()}
8 | !{paginate}
9 |
--------------------------------------------------------------------------------
/_config.json:
--------------------------------------------------------------------------------
1 | { "url": "http://popjs.com/"
2 | , "title": "Pop Blog"
3 | , "permalink": "/:year/:month/:day/:title"
4 | , "paginate": 10
5 | , "exclude": ["\\.swp"]
6 | , "require": ["pop-disqus"]
7 | , "autoGenerate": [{"feed": "feed.xml"}, {"rss": "feed.rss"}] }
8 |
--------------------------------------------------------------------------------
/javascripts/site.js:
--------------------------------------------------------------------------------
1 | $(function() {
2 | $('.tag-list a.tag').live('click', function() {
3 | $(this).parents('h2').next('.posts').toggle();
4 | });
5 |
6 | if (window.location.hash) {
7 | $(window.location.hash).next('.posts').show();
8 | }
9 | });
10 |
--------------------------------------------------------------------------------
/_posts/2011-07-29-pop-0.0.9.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: Pop 0.0.9
4 | author: Pop
5 | tags:
6 | - releases
7 | ---
8 |
9 | Pop 0.0.9 is out:
10 |
11 | * Added centralised logging (mainly so I can turn off logs in tests)
12 | * Defaults post author to `LOGNAME`
13 | * Escapes post file names
14 |
15 |
--------------------------------------------------------------------------------
/_posts/2011-08-02-pop-0.1.0.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: Pop 0.1.0
4 | author: Pop
5 | tags:
6 | - releases
7 | ---
8 |
9 | I've released Pop 0.1.0. This cements the basic functionality that I want to include in Pop for the near future.
10 |
11 | This release includes a tags page for the built-in site generator, and a helper called `postsForTag`.
12 |
13 |
--------------------------------------------------------------------------------
/_posts/2011-08-18-pop-0.1.1.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: Pop 0.1.1
4 | author: Pop
5 | tags:
6 | - releases
7 | ---
8 |
9 | Pop 0.1.1 has been released. This version improves the build process by making it use more events rather than counting down the number of files that have been processed.
10 |
11 | This should make the site build process more stable.
12 |
13 |
--------------------------------------------------------------------------------
/_posts/2011-07-26-pop-0.0.6.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: Pop 0.0.6
4 | author: Pop
5 | tags:
6 | - releases
7 | ---
8 |
9 | Pop 0.0.6 adds the following features and enhancements:
10 |
11 | * A new command-line option, `render`, makes Pop only render files that match a pattern
12 | * Character and word truncation helpers have been added
13 | * The Atom feed can now summarise posts based on paragraph length
14 |
15 |
--------------------------------------------------------------------------------
/_posts/2011-07-24-pop-0.0.4.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: Pop 0.0.4
4 | author: Pop
5 | tags:
6 | - releases
7 | ---
8 |
9 | Pop 0.0.4 is out:
10 |
11 | * Running `pop` will generate a site in the current directory and exit
12 | * Running `pop` on a path that doesn't look like a Pop site will print an error rather than a confusing stack trace
13 | * Pop server mode will watch all subdirectories for changes, so things like stylesheets (including Stylus files) will automatically regenerate the changed file
14 |
--------------------------------------------------------------------------------
/_posts/2011-07-23-pop-0.0.3.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: Pop 0.0.3
4 | author: Pop
5 | tags:
6 | - releases
7 | ---
8 |
9 | Pop version 0.0.3 is out.
10 |
11 | * Atom feed helper takes less options (the variables are all in `config`)
12 | * Atom feed uses `config.perPage`
13 | * Post file names with extra dots will be parsed correctly
14 | * YAML front-matter will be extracted less greedily
15 | * YAML front-matter can now contain a `summary` property to make it easier to display post summaries in lists
16 | * Trailing slashes will be removed from `config.url`
17 |
--------------------------------------------------------------------------------
/_posts/2011-08-23-pop-ga.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: Google Analytics Plugin
4 | author: Pop
5 | tags:
6 | - plugins
7 | - contributions
8 | ---
9 |
10 | [pop-ga](https://github.com/shapeshed/pop-ga) by [George Ornbo](http://shapeshed.com/) is a Google Analytics plugin for pop. It can be installed using npm:
11 |
12 | npm install -g pop-ga
13 |
14 | And then used by updating your `_config.json`:
15 |
16 | , "require": ["pop-ga"]
17 |
18 | Next, call the plugin's helper with your Google Analytics ID:
19 |
20 |
21 | !{ga('UA-345678-90')}
22 |
23 |
24 |
--------------------------------------------------------------------------------
/tags.jade:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | ---
4 |
5 | h1 Tags
6 |
7 | p Click a tag to view the associated posts.
8 |
9 | .tag-list
10 | - var tags = allTags();
11 | - if (tags && tags.length > 0)
12 | - for (var i = 0, tag = tags[0], posts = postsForTag(tag); i < tags.length; i++, tag = tags[i], posts = postsForTag(tag))
13 | h2(id=tag)
14 | a.tag(href="#") (#{posts.length}) #{tag}
15 | .posts
16 | - for (var j = 0, post = posts[j]; j < posts.length; j++, post = posts[j])
17 | p
18 | a(href="#{post.url}") #{post.title}
19 |
20 |
--------------------------------------------------------------------------------
/_posts/2011-07-21-example-post-about-something.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Pop Released
3 | author: Pop
4 | layout: post
5 | tags:
6 | - releases
7 | ---
8 |
9 | Pop version 0.0.1 has been released:
10 |
11 | * GitHub: [alexyoung / pop](https://github.com/alexyoung/pop)
12 |
13 | This includes [stextile](https://github.com/alexyoung/stextile), which is a rough-and-ready [Textile](http://www.textism.com/tools/textile/) parser. Pop also supports [Markdown](http://daringfireball.net/projects/markdown/).
14 |
15 | Pop sites use [Jade](http://jade-lang.com/) and [Stylus](http://learnboost.github.com/stylus/). These are CSS selector-based shorthands for quickly writing HTML and CSS.
16 |
17 |
--------------------------------------------------------------------------------
/_posts/2011-07-22-pop-0.0.2.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: Pop 0.0.2
4 | author: Pop
5 | tags:
6 | - releases
7 | - examples
8 | ---
9 |
10 | Pop version 0.0.2 has been released. This version adds additional default styles to the site generator (blockquotes, pagination), and adds post summary support.
11 |
12 | Writing YAML front-matter like this:
13 |
14 | ---
15 | layout: post
16 | title: Amazing Facts About Lions
17 | summary: Above all, lions are amazing creatures.
18 | author: Dave Grohl
19 | tags:
20 | - releases
21 | ---
22 |
23 | Post content here.
24 |
25 | This will make `post.summary` available to templates. It gets processed with markdown or textile, depending on the format of the post, and also applies helpers. I've added this to the `hNews()` helper when used to generate summaries.
26 |
--------------------------------------------------------------------------------
/_posts/2011-07-28-pop-0.0.8.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: Pop 0.0.8
4 | author: Pop
5 | tags:
6 | - releases
7 | - examples
8 | ---
9 |
10 | I've just released Pop 0.0.8, which adds:
11 |
12 | * An option to `_config.json` for the port the local server uses
13 | * RSS feed helper
14 |
15 | ## RSS Feeds
16 |
17 | You can get RSS feeds "for free" by adding an `autoGenerate` option to `_config.json`:
18 |
19 | "autoGenerate": [{"feed": "feed.xml"}, {"rss": "feed.rss"}]
20 |
21 | The helper itself is fairly easy to use:
22 |
23 | /**
24 | * RSS Jade template.
25 | *
26 | * @param {String} Feed URL
27 | * @param {Integer} Number of paragraphs to summarise
28 | * @param {String} Optional description
29 | *
30 | * @return {String}
31 | */
32 | rss: function(feed, summarise, description) {
33 |
34 | I've checked a few example feeds with the [W3C validation service](http://validator.w3.org/feed/).
35 |
36 |
--------------------------------------------------------------------------------
/_layouts/post.jade:
--------------------------------------------------------------------------------
1 | !!! 5
2 | html(lang="en")
3 | head
4 | title #{post.title}
5 | link(href="/stylesheets/screen.css", media="screen", rel="stylesheet", type="text/css")
6 | link(rel="alternate", type="application/rss+xml", title="RSS 2.0", href="/feed.rss")
7 | link(rel="alternate", type="application/atom+xml", title="Atom Feed", href="/feed.xml")
8 | body
9 | header#header
10 | hgroup
11 | h1
12 | a(href="/") #{site.config.title}
13 | hgroup
14 |
15 | nav#breadcrumb
16 | a.read-more(href="/") ← Back
17 | !{hNews(post)}
18 | !{disqus(post, 'popjs')}
19 | footer
20 | p.copyright Content © Alex R. Young
21 |
--------------------------------------------------------------------------------
/_posts/2011-07-27-pop-0.0.7.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: Pop 0.0.7
4 | author:
5 | tags:
6 | - releases
7 | - tutorials
8 | ---
9 |
10 | Pop 0.0.7 is out:
11 |
12 | * Added generators
13 | * Plugins can add their own generators through `myPlugin.generators`
14 | * `SiteBuilder` should trigger the server properly
15 |
16 | ## Using Generators
17 |
18 | Generating a site with Pop generally works like this:
19 |
20 | pop new new_site
21 |
22 | Generators can now be used to generate different kinds of sites:
23 |
24 | pop new pop-gallery new_site
25 |
26 | This example requires [pop-gallery](https://github.com/alexyoung/pop-gallery).
27 |
28 | ## Writing Generators
29 |
30 | Basic usage is to make a CommonJS module with a `generator` property:
31 |
32 | module.exports = {
33 | generator: {
34 | run: function(helpers, pathName) {
35 | }
36 | }
37 | };
38 |
39 | The parameters will be passed by Pop. The `helpers` value contains the internal cli_tools.js module, and
pathName is the destination path for the site.
40 |
41 | A full example is available here: [pop-gallery](https://github.com/alexyoung/pop-gallery).
42 |
43 |
--------------------------------------------------------------------------------
/_layouts/default.jade:
--------------------------------------------------------------------------------
1 | !!! 5
2 | html(lang="en")
3 | head
4 | title #{site.config.title}
5 | link(href="/stylesheets/screen.css", media="screen", rel="stylesheet", type="text/css")
6 | link(rel="alternate", type="application/rss+xml", title="RSS 2.0", href="/feed.rss")
7 | link(rel="alternate", type="application/atom+xml", title="Atom Feed", href="/feed.xml")
8 | script(type="text/javascript", src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js")
9 | script(type="text/javascript", src="/javascripts/site.js")
10 | body
11 | header#header
12 | hgroup
13 | h1
14 | a(href="/") #{site.config.title}
15 | hgroup
16 |
17 | nav.panel
18 | h2 About
19 | p Pop is a static site generator.
20 | h2 Links
21 | ul
22 | li
23 | a(href="/feed.xml") Feed
24 | li
25 | a(href="http://twitter.com/alex_young") Twitter
26 | li
27 | a(href="/doc/") API Documentation
28 | li
29 | a(href="http://popjs.com") Powered by Pop
30 | li
31 | a(href="https://github.com/alexyoung/pop") Pop Source Code
32 | li
33 | a(href="http://dailyjs.com") Learn JavaScript
34 | section.content
35 | !{content}
36 | footer
37 | p.copyright Content © Alex R. Young
38 |
--------------------------------------------------------------------------------
/_posts/2011-07-25-pop-0.0.5.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: Pop 0.0.5
4 | author: Pop
5 | tags:
6 | - releases
7 | - plugins
8 | - tutorials
9 | ---
10 |
11 | Pop 0.0.5 has been released. This version introduces a plugin architecture and post-filters.
12 |
13 | ## Post-Filters
14 |
15 | A post-filter can alter HTML after it has been generated by the template engine. The structure is the same as helpers and pre-filters. Add a file to `_lib/post-filters.js`:
16 |
17 | {% highlight javascript %}
18 | module.exports = {
19 | /**
20 | * Converts Alex's name to something more suitable.
21 | *
22 | * @param {String} The HTML to transform
23 | * @return {String} The transformed HTML
24 | */
25 | myFilter: function(html) {
26 | return html.replace(/Alex/, 'Super Douche');
27 | }
28 | };
29 | {% endhighlight %}
30 |
31 | ## Using Plugins
32 |
33 | Plugins are bundles of helpers, pre-filters, and post-filters that are loaded using the config file. Here's an example, from this site:
34 |
35 | {% highlight javascript %}
36 | { "url": "http://popjs.com/"
37 | , "title": "Pop Blog"
38 | , "permalink": "/:year/:month/:day/:title"
39 | , "paginate": 10
40 | , "exclude": ["\\.swp"]
41 | , "require": ["pop-disqus"]
42 | , "autoGenerate": [{"feed": "feed.xml"}] }
43 | {% endhighlight %}
44 |
45 | The `require` property loads the plugin found in the CommonJS module `pop-disqus`. This plugin is available through npm.
46 |
47 | ## Writing Plugins
48 |
49 | Create a CommonJS module with a suitable `package.json` that exports an object with one or more of these properties:
50 |
51 | * `helpers`
52 | * `filters`
53 | * `postFilters`
54 |
55 | All the usual rules apply. Get started by looking at [pop-disqus](https://github.com/alexyoung/pop-disqus). Write tests, even if they're basic!
56 |
57 |
--------------------------------------------------------------------------------
/stylesheets/screen.styl:
--------------------------------------------------------------------------------
1 | /* Variables */
2 | light = #fff
3 | dark = #1a1a1f
4 | back = #ddd
5 | highlight = #d02413
6 |
7 | standard-font-size = 14px
8 | small-font-size = 12px
9 | header-font-size = 128.5%
10 |
11 | /* Functions */
12 | header-gradient()
13 | background: #cfd2d7
14 | background: -moz-linear-gradient(top, #cfd2d7 0%, #a3a8af 100%)
15 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#cfd2d7), color-stop(100%,#a3a8af))
16 | background: -webkit-linear-gradient(top, #cfd2d7 0%,#a3a8af 100%)
17 | background: -o-linear-gradient(top, #cfd2d7 0%,#a3a8af 100%)
18 | background: -ms-linear-gradient(top, #cfd2d7 0%,#a3a8af 100%)
19 | background: linear-gradient(top, #cfd2d7 0%,#a3a8af 100%)
20 |
21 | glass-gradient()
22 | background: #f6f8f9
23 | background: -moz-linear-gradient(top, #f6f8f9 0%, #e5ebee 50%, #d7dee3 51%, #f5f7f9 100%)
24 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f6f8f9), color-stop(50%,#e5ebee), color-stop(51%,#d7dee3), color-stop(100%,#f5f7f9))
25 | background: -webkit-linear-gradient(top, #f6f8f9 0%,#e5ebee 50%,#d7dee3 51%,#f5f7f9 100%)
26 | background: -o-linear-gradient(top, #f6f8f9 0%,#e5ebee 50%,#d7dee3 51%,#f5f7f9 100%)
27 | background: -ms-linear-gradient(top, #f6f8f9 0%,#e5ebee 50%,#d7dee3 51%,#f5f7f9 100%)
28 | background: linear-gradient(top, #f6f8f9 0%,#e5ebee 50%,#d7dee3 51%,#f5f7f9 100%)
29 |
30 | border-radius()
31 | -webkit-border-radius arguments
32 | -moz-border-radius arguments
33 | border-radius arguments
34 |
35 | border-radius-top()
36 | -webkit-border-top-left-radius: arguments
37 | -webkit-border-top-right-radius: arguments
38 | -moz-border-radius-topleft: arguments
39 | -moz-border-radius-topright: arguments
40 | border-top-left-radius: arguments
41 | border-top-right-radius: arguments
42 |
43 | shadow()
44 | -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.5)
45 | -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.5)
46 | box-shadow: 0 0 5px rgba(0, 0, 0, 0.5)
47 |
48 | big-shadow()
49 | box-shadow: 0 0 15px #000
50 |
51 | lozenge()
52 | -webkit-border-radius: 10px
53 | -moz-border-radius: 10px
54 | border-radius: 10px
55 | background-color: #bbc4cc
56 | padding: 4px 8px
57 | text-decoration: none
58 | color: dark
59 | font-weight: bold
60 | font-size: small-font-size
61 | text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5)
62 |
63 | reset()
64 | margin: 0
65 | padding: 0
66 |
67 | /* Styles */
68 | body
69 | font-family: "Helvetica Neue", Helvetica, Arial, Verdana, sans-serif
70 | font-size: standard-font-size
71 | margin: 0 auto
72 | padding-bottom: 2em
73 | word-spacing: 0.1em
74 | background-color: back
75 | max-width: 960px
76 |
77 | h1, h2, h3, h4, p
78 | reset()
79 |
80 | h1, h2, h3, h4
81 | font-size: header-font-size
82 |
83 | a
84 | color: highlight
85 |
86 | a:hover
87 | text-decoration: none
88 |
89 | blockquote
90 | reset()
91 | font-style: italic
92 | text-shadow: 0 1px 0 #fff
93 | color: #333
94 |
95 | #header
96 | margin: 10px 0 20px 0
97 | padding-bottom: 10px
98 | border-bottom: 3px solid #ced3d2
99 |
100 | #header h2
101 | color: #333
102 | text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5)
103 |
104 | #header h1
105 | font-size: 50px
106 | text-shadow: rgba(0,0,0,0.3) 0 -1px
107 |
108 | #header h1 a
109 | color: #fff
110 | text-decoration: none
111 |
112 | article
113 | margin: 0 0 20px 0
114 | padding-bottom: 10px
115 | background-color: light
116 | border-radius 5px
117 | border-color: light
118 | shadow()
119 |
120 | article header
121 | margin-bottom: 10px
122 |
123 | article header h1
124 | border-top: 1px solid #bbb
125 | margin: 0 0 5px 0
126 | font-size: header-font-size
127 |
128 | article header h1 a
129 | text-decoration: none
130 | text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5)
131 |
132 | article h1, article h2, article h3, article h4, article h5, article h6, article p, article blockquote, article pre
133 | padding: 10px 20px
134 |
135 | article time, article .author, article .tags
136 | display: inline
137 | margin: 0 0 0 5px
138 | font-size: standard-font-size
139 | lozenge()
140 |
141 | .read-more:hover
142 | box-shadow: 0 0 2px #000
143 |
144 | .tags a
145 | text-decoration: none
146 | color: dark
147 |
148 | .tag-list h2, p
149 | margin: 10px 0
150 |
151 | .tag-list .posts
152 | display: none
153 |
154 | article time
155 | margin-left: 20px
156 |
157 | .read-more
158 | lozenge()
159 |
160 | nav#breadcrumb
161 | margin: 10px 0 20px 0
162 | clear: both
163 |
164 | .content
165 | width: 740px
166 | float: left
167 | clear: right
168 |
169 | nav.panel
170 | width: 200px
171 | float: left
172 | clear: left
173 | padding-bottom: 10px
174 | background-color: light
175 | border-radius 5px
176 | border-color: light
177 | emboss()
178 | margin: 0 20px 40px 0
179 |
180 | nav.panel p
181 | margin: 10px 10px 20px 10px
182 |
183 | nav.panel ul
184 | margin: 10px 0
185 | padding: 0 0 0 25px
186 |
187 | nav.panel h2
188 | background-color: highlight
189 | color: #fff
190 | text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5)
191 | padding: 3px 5px
192 |
193 | .prev_next
194 | margin: 0 0 10px 0
195 | clear: both
196 | float: left
197 |
198 | .prev_next .page, .prev_next .next
199 | padding: 3px 5px
200 | margin: 5px
201 | text-shadow: 0 1px 0 #fff
202 |
203 | footer
204 | clear: both
205 | width: 100%
206 | margin: 40px 0 0 0
207 | padding-top: 20px
208 | border-top: 3px solid #ced3d2
209 |
210 | footer p
211 | font-size: small-font-size
212 | text-align: right
213 | text-shadow: 0 1px 0 #fff
214 |
--------------------------------------------------------------------------------
/doc/index.html:
--------------------------------------------------------------------------------
1 |
2 |
PopPop is a static site and blog generator for Node. 112 | 113 |
| |
cli_tools | lib/cli_tools.js |
|
115 | Module dependencies. 116 | 117 | |
118 |
119 |
126 | |
127 |
|
130 | Adds zero padding to single digit numbers. 131 | 132 | 133 | 134 |
|
136 |
137 |
140 | |
141 |
|
144 | Makes a post file name (not URL) based on the config's permanlink format. 145 | 146 | 147 | 148 |
|
150 |
151 |
160 | |
161 |
|
164 | Generates a stubbed post and writes it based on a file name. 165 | 166 | 167 | 168 |
|
170 |
171 |
196 | |
197 |
|
200 | Default config settings, used by site generator. 201 | 202 | 203 | 204 |
|
206 |
207 |
216 | |
217 |
|
220 | Default index file, used by site generator. 221 | 222 | 223 | 224 |
|
226 |
227 |
237 | |
238 |
|
241 | Default layout, used by site generator. 242 | 243 | 244 | 245 |
|
247 |
248 |
251 | |
252 |
|
255 | Default post layout, used by site generator. 256 | 257 | 258 | 259 |
|
261 |
262 |
265 | |
266 |
|
269 | Default client-side JavaScript. 270 | 271 | 272 | 273 |
|
275 |
276 |
279 | |
280 |
|
283 | Default tags page. 284 | 285 | 286 | 287 |
|
289 |
290 |
293 | |
294 |
|
297 | Sample post, to get people started. 298 | 299 | 300 | 301 |
|
303 |
304 |
316 | |
317 |
|
320 | Built-in stylesheet. 321 | 322 | 323 | 324 |
|
326 |
327 |
330 | |
331 |
|
334 | Site generator. Will not create a site if
|
340 |
341 |
366 | |
367 |
|
370 | Renders files that match
|
376 |
377 |
397 | |
398 |
config | lib/config.js |
|
400 | Config file reader. 401 | 402 | 403 | 404 |
|
406 |
407 |
437 | |
438 |
|
441 | Module dependencies and additional config variables. 442 | 443 | |
444 |
445 |
450 | |
451 |
file_map | lib/file_map.js |
|
453 | Module dependencies. 454 | 455 | |
456 |
457 |
461 | |
462 |
|
465 | Initialize
|
471 |
472 |
483 | |
484 |
|
487 | Determines file type based on file extension. 488 | 489 | 490 | 491 |
|
493 |
494 |
509 | |
510 |
|
513 | Recursively iterates from an initial path. 514 | 515 | 516 | 517 |
|
519 |
520 |
552 | |
553 |
|
556 | Searches for files that match
|
562 |
563 |
567 | |
568 |
|
571 | Checks to see if a file name matches the excluded patterns. 572 | 573 | 574 | 575 |
|
577 |
578 |
586 | |
587 |
|
590 | Determines file type based on file extension. 591 | 592 | 593 | 594 |
|
596 |
597 |
606 | |
607 |
|
610 | Bind an event to the internal
|
616 |
617 |
623 | |
624 |
filters | lib/filters.js |
|
626 | module.exports = { 627 | |
628 |
629 |
635 | |
636 |
|
639 | highlight: function(data) { 640 | data = data.replace(/{% highlight ([^ ]*) %}/g, '<pre class="prettyprint lang-$1">'); 641 | data = data.replace(/{% endhighlight %}/g, '</pre>'); 642 | return data; 643 | } 644 | }; 645 | |
646 | 647 | 648 | | 649 |
generators | lib/generators.js |
|
651 | module.exports = { 652 | 'default': require(__dirname + '/generators/default') 653 | }; 654 | |
655 | 656 | 657 | | 658 |
graceful | lib/graceful.js |
|
660 | Module dependencies. 661 | 662 | |
663 |
664 |
668 | |
669 |
|
672 | Offers functionality similar to
|
678 |
679 |
711 | |
712 |
|
715 | Polymorphic approach to
|
721 |
722 |
755 | |
756 |
helpers | lib/helpers.js |
|
758 | Module dependencies and local variables. 759 | 760 | |
761 |
762 |
770 | |
771 |
|
774 | Pagination links. 775 | 776 | 777 | 778 |
|
780 |
781 |
806 | |
807 |
|
810 | Generates paginated blog posts, suitable for use on an index page. 811 | 812 | 813 | 814 |
|
816 |
817 |
826 | |
827 |
|
830 | Atom Jade template. 831 | 832 | 833 | 834 |
|
836 |
837 |
881 | |
882 |
|
885 | RSS Jade template. 886 | 887 | 888 | 889 |
|
891 |
892 |
941 | |
942 |
|
945 | Returns unique sorted tags for every post. 946 | 947 | 948 | 949 |
|
951 |
952 |
974 | |
975 |
|
978 | Get a set of posts for a tag. 979 | 980 | 981 | 982 |
|
984 |
985 |
994 | |
995 |
|
998 | Display a list of tags. 999 | 1000 |TODO Link options1001 | 1002 | 1003 | 1004 |
|
1006 |
1007 |
1012 | |
1013 |
|
1016 | Renders a post using the hNews microformat, based on: 1017 | 1018 |http://www.readability.com/publishers/guidelines/#view-exampleGuidelines 1019 | 1020 | 1021 | 1022 |
|
1024 |
1025 |
1048 | |
1049 |
|
1052 | Formats a date with date formatting rules according to underscore.date's rules. 1053 | 1054 | 1055 | 1056 |
|
1058 |
1059 |
1062 | |
1063 |
|
1066 | Short date (01 January 2001). 1067 | 1068 | 1069 | 1070 |
|
1072 |
1073 |
1076 | |
1077 |
|
1080 | Atom date formatting. 1081 | 1082 | 1083 | 1084 |
|
1086 |
1087 |
1090 | |
1091 |
|
1094 | RFC-822 dates. 1095 | 1096 | 1097 | 1098 |
|
1100 |
1101 |
1105 | |
1106 |
|
1109 | Escapes brackets and ampersands. 1110 | 1111 | 1112 | 1113 |
|
1115 |
1116 |
1119 | |
1120 |
|
1123 | Truncates HTML based on paragraph counts. 1124 | 1125 | 1126 | 1127 |
|
1129 |
1130 |
1134 | |
1135 |
|
1138 | Truncates based on characters (not HTML safe, use with pre-formatted text). 1139 | 1140 | 1141 | 1142 |
|
1144 |
1145 |
1148 | |
1149 |
|
1152 | Truncates based on words (not HTML safe, use with pre-formatted text). 1153 | 1154 | 1155 | 1156 |
|
1158 |
1159 |
1167 | |
1168 |
log | lib/log.js |
|
1170 | module.exports = { 1171 | enabled: true, 1172 | 1173 |info: function() { 1174 | if (this.enabled) console.log.apply(this, arguments); 1175 | }, 1176 | 1177 |error: function() { 1178 | if (this.enabled) console.error.apply(this, arguments); 1179 | } 1180 | }; 1181 | |
1182 | 1183 | 1184 | | 1185 |
paginator | lib/paginator.js |
|
1187 | Initialize
|
1193 |
1194 |
1203 | |
1204 |
|
1207 | Moves to the next page. 1208 | 1209 |1210 | |
1211 |
1212 |
1221 | |
1222 |
|
1225 | Sort items according to date. 1226 | 1227 | 1228 | 1229 |
|
1231 |
1232 |
1246 | |
1247 |
pop | lib/pop.js |
|
1249 | Module dependencies and local variables. 1250 | 1251 | |
1252 |
1253 |
1260 | |
1261 |
|
1264 | Loads the config script and sets the local variable. 1265 | 1266 | 1267 | 1268 |
|
1270 |
1271 |
1277 | |
1278 |
|
1281 | Loads configuration then runs
|
1287 |
1288 |
1293 | |
1294 |
|
1297 | Runs
|
1303 |
1304 |
1379 | |
1380 |
server | lib/server.js |
|
1382 | Module dependencies and local variables. 1383 | 1384 | |
1385 |
1386 |
1390 | |
1391 |
|
1394 | Instantiates and runs the Express server. 1395 | 1396 | |
1397 |
1398 |
1422 | |
1423 |
|
1426 | Watches for file changes and regenerates files as required. 1427 | ## TODO Work in progress 1428 | 1429 | |
1430 |
1431 |
1458 | |
1459 |
site_builder | lib/site_builder.js |
|
1461 | Module dependencies. 1462 | 1463 | |
1464 |
1465 |
1480 | |
1481 |
|
1484 | Initialize
|
1490 |
1491 |
1519 | |
1520 |
|
1523 | Loads Pop plugins based on |
1526 |
1527 |
1541 | |
1542 |
|
1545 | Applies helpers and "user helpers" to an object so it can be easily passed to Jade. 1546 | 1547 | 1548 | 1549 |
|
1551 |
1552 |
1570 | |
1571 |
|
1574 | Applies helpers and "user helpers" to an object so it can be easily passed to Jade. 1575 | 1576 | 1577 | 1578 |
|
1580 |
1581 |
1605 | |
1606 |
|
1609 | Binds methods to this
|
1615 |
1616 |
1622 | |
1623 |
|
1626 | Builds the site. This is asynchronous, so various counters 1627 | and events are used to track progress. 1628 | 1629 |1630 | |
1631 |
1632 |
1706 | |
1707 |
|
1710 | Returns any configured built-in pages, 1711 | or an empty array. 1712 | 1713 | 1714 | 1715 |
|
1717 |
1718 |
1722 | |
1723 |
|
1726 | Generates a built-in page. Only atom feeds and RSS 1727 | are currently available. 1728 | 1729 | 1730 | 1731 |
|
1733 |
1734 |
1760 | |
1761 |
|
1764 | Determines if a file needs Jade or Stylus rendering. 1765 | 1766 | 1767 | 1768 |
|
1770 |
1771 |
1774 | |
1775 |
|
1778 | Builds a single file. 1779 | ## TODO Work in progress. 1780 | 1781 | 1782 | 1783 |
|
1785 |
1786 |
1802 | |
1803 |
|
1806 | Iterates over the files in the
|
1812 |
1813 |
1818 | |
1819 |
|
1822 | Iterates over the files in the
|
1828 |
1829 |
1835 | |
1836 |
|
1839 | Iterates over the files in the
|
1845 |
1846 |
1851 | |
1852 |
|
1855 | Copies a static file. 1856 | 1857 | 1858 | 1859 |
|
1861 |
1862 |
1893 | |
1894 |
|
1897 | Parse YAML meta data for both files and posts. 1898 | 1899 | 1900 | 1901 |
|
1903 |
1904 |
1940 | |
1941 |
|
1944 | Writes a file, making directories recursively when required. 1945 | 1946 | 1947 | 1948 |
|
1950 |
1951 |
1971 | |
1972 |
|
1975 | Returns a full path name. 1976 | 1977 | 1978 | 1979 |
|
1981 |
1982 |
1985 | |
1986 |
|
1989 | Caches templates inside |
1992 |
1993 |
2030 | |
2031 |
|
2034 | Renders a post using a template. Called by
|
2040 |
2041 |
2077 | |
2078 |
|
2081 | Renders a generic Jade file and will supply pagination if required. 2082 | 2083 | 2084 | 2085 |
|
2087 |
2088 |
2161 | |
2162 |
|
2165 | Parses a file name according to the permalink format. 2166 | 2167 | 2168 | 2169 |
|
2171 |
2172 |
2186 | |
2187 |
|
2190 | Applies internal and user-supplied content pre-filters. 2191 | 2192 | 2193 | 2194 |
|
2196 |
2197 |
2208 | |
2209 |
|
2212 | Applies user-supplied content post-filters. These are run after HTML is generated. 2213 | 2214 | 2215 | 2216 |
|
2218 |
2219 |
2226 | |
2227 |
|
2230 | Renders a post. 2231 | 2232 | 2233 | 2234 |
|
2236 |
2237 |
2272 | |
2273 |
|
2276 | Adds a listener to the internal
|
2282 |
2283 |
2286 | |
2287 |
|
2290 | Adds a listener to the internal
|
2296 |
2297 |
2303 | |
2304 |