-
Notifications
You must be signed in to change notification settings - Fork 26
/
docpad.coffee
81 lines (76 loc) · 1.97 KB
/
docpad.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# DocPad Configuration File
# http://docpad.org/docs/config
markdown = require( "markdown" ).markdown;
# Define the DocPad Configuration
docpadConfig = {
templateData: #default data
site:
url: "http://topcoat.io"
title: "Topcoat"
description: """
CSS for clean and fast web apps.
"""
keywords: """
css,opensource,application,development,web standards
"""
authors:
brianleroux:
name: "Brian LeRoux"
twitter: "brianleroux"
url: "http://brian.io/"
dam:
name: "Kristofer Joseph"
twitter: "dam"
url: "http://kristoferjoseph.com/"
garthdb:
name: "Garth Braithwaite"
twitter: "garthdb"
url: "http://www.garthdb.com/"
nnnnic:
name: "Nic Couillard"
twitter: "nnnnic"
url: "http://nnnnic.com/"
g1sh:
name: "Guillermo Torres"
twitter: "g1sh"
url: "http://www.g1sh.com/"
ndreio:
name: "Andrei Oprea"
twitter: "ndreio"
url: "http://github.com/piatra"
nodoherty:
name: "Niall O'Doherty"
twitter: "nodoherty"
url: "http://github.com/nodoherty"
formatDate: (postdate) ->
monthsArray = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
curr_date = postdate.getDate()
curr_month = monthsArray[postdate.getMonth()]
curr_year = postdate.getFullYear()
return (curr_date + " " + curr_month + " " + curr_year)
formatAuthor: (author) ->
authorName =''
authorUrl = ''
if (typeof author == 'object')
authorName = author.name
authorUrl = author.url
else
authorName = @authors[author].name
authorUrl = @authors[author].url
return "<a href='#{authorUrl}'>#{authorName}</a>"
markdowned: (copy) ->
return markdown.toHTML(copy)
collections:
pages: ->
@getCollection("html").findAll({isPage:true})
posts: ->
@getCollection('documents').findAllLive({isPost:true},[date:-1])
plugins:
cleanurls:
trailingSlashes: true
environments:
static:
outPath: ''
}
# Export the DocPad Configuration
module.exports = docpadConfig