This repository has been archived by the owner on Jun 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.coffee
154 lines (127 loc) · 3.22 KB
/
app.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
autoprefixer = require 'autoprefixer'
contentful = require 'contentful'
css_pipeline = require 'css-pipeline'
js_pipeline = require 'js-pipeline'
marked = require 'marked'
moment = require 'moment'
roots_contentful = require 'roots-contentful'
rupture = require 'rupture'
_ = require 'underscore'
_str = require 'underscore.string'
S = require 'string'
dotenv = require 'dotenv'
dotenv.config()
# PostCSS
postcss = require 'postcss'
mqpacker = require 'css-mqpacker'
normalize = require 'postcss-normalize'
# Vars
isDev = process.env.CFUL_ENV == "development"
isProd = process.env.CFUL_ENV == "production"
isPreview = process.env.CFUL_ENV == "preview"
# Roots extensions
# ======================================================================
module.exports =
open_browser: false
ignores: [
'_*/**'
'**/_*'
'**/_*/**'
'*.sublime-project'
'.editorconfig'
'.env'
'.gitignore'
'.gitrepos'
'.todo'
'assets/data'
'assets/data/**.json'
'gitrepos'
'gitrepos/**'
'license.*'
'package-lock.json'
'readme.*'
'ship.*conf'
]
extensions: [
css_pipeline
files: [
'./assets/css/main.*'
'./assets/css/_vendors/slick.styl'
]
postcss: true
js_pipeline
files: [
'assets/js/jquery.js'
'assets/js/velocity.js'
'assets/js/velocity.ui.js'
'assets/js/picturefill.js'
'assets/js/lazysizes.js'
'assets/js/slick.js'
'assets/js/clipboard.js'
'assets/js/custom.js'
]
out: './js/main.js'
# Roots Contentful
# - See https://github.com/carrot/roots-contentful/
roots_contentful
access_token: if isProd then process.env.CFUL_LIVE_KEY else process.env.CFUL_PREVIEW_KEY
space_id: process.env.CFUL_SPACE_ID
preview: if isProd then false else true
content_types:
# Core
contentVars:
id: 'contentVars'
global:
id: 'global'
navigation:
id: 'navigation'
# Pages
page:
id: 'page'
template: 'views/_layouts/page.jade'
path: (e) -> "#{S(e.slug).slugify()}"
post:
id: 'post'
template: 'views/_layouts/post.jade'
path: (e) -> "blog/#{S(e.slug).slugify()}"
]
# CSS
# ======================================================================
# Stylus
stylus:
use: [
rupture()
]
# PostCSS
postcss:
use: [
autoprefixer({ browsers: ['last 2 versions'] }),
mqpacker()
]
# HTML
# ======================================================================
# Jade
jade:
pretty: false
# JS
# ======================================================================
# Coffeescript
'coffee-script':
sourcemap: if isProd then false else true
# Local server settings (gh.com/caret/charge)
server:
"clean_urls": true
# Locals
# ======================================================================
locals:
# Generates function to render markdown from Contentful
# https://github.com/carrot/roots-contentful/issues/13
markdown:
marked.setOptions({
gfm: true,
smartLists: true,
smartypants: false
});
moment: moment
_: _
_str: _str