-
Notifications
You must be signed in to change notification settings - Fork 2
/
docpad.coffee
50 lines (46 loc) · 1.4 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
# Define the Configuration
docpadConfig = {
templateData:
site:
title: "My website"
ignorePatterns: true
ignoreCustomPatterns: /^_.+\.styl$/i
# =================================
# Environments
environments:
development:
outPath: ".tmp"
plugins:
livereload:
populateCollections: false
bowermount:
excludes: ['primus']
# Because we utilize Grunt for optimization processed
# docpad's static build is a staging one before Grunt
static:
outPath: ".tmp.stage"
# =================================
# Plugins
plugins:
jade:
jadeOptions:
pretty: true
events:
# Add page-specific JavaScript references
# TODO: replace with more native solution when this question will be
# answered: http://stackoverflow.com/questions/17605108/
render: (opts) ->
{inExtension,outExtension,templateData,file,content} = opts
if outExtension == 'html' and scripts = file.get('scripts')
if typeof scripts != 'undefined'
scriptBlock = ''
scripts.forEach (scriptName) ->
scriptBlock = """
\n <!-- build:js /scripts/#{scriptName}.js-->
<script>require(['#{scriptName}'])</script>
<!-- endbuild-->
"""
templateData.scripts = scriptBlock
}
# Export the Configuration
module.exports = docpadConfig