-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.coffee
112 lines (99 loc) · 2.59 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
RootsUtil = require 'roots-util'
js_pipeline = require 'js-pipeline'
css_pipeline = require 'css-pipeline'
dynamic_content = require 'dynamic-content'
browserify = require 'roots-browserify'
image_pipeline = require 'roots-image-pipeline'
statica = require 'statica'
autoprefixer = require 'autoprefixer'
dateFormat = require 'date_format'
jade = require 'jade'
fs = require 'fs'
marked = require 'marked'
moment = require 'moment'
highlight = require 'highlight.js'
records = require 'roots-records'
lang = highlight.getLanguage 'bash'
lang.keywords.keyword += ' assert run load'
lang.contains.push {className: 'hook', begin: '@\\w+'}
lang.contains.push {className: 'punctuation', begin: '[\\\'\\\"\\{\\}\\(\\)\\`]'}
highlight.registerLanguage 'zunit', () -> lang
marked.setOptions
gfm: true
tables: true
breaks: true
pedantic: false
sanitize: false
smartLists: true
smartypants: true
highlight: (code, lang) ->
highlight.highlightAuto(code, [lang]).value
dateFormat.extendPrototype()
module.exports =
ignores: [
'readme.md'
'**/layout.*'
'**/_*/*'
'**/_*/**/*'
'**/_*'
'.gitignore'
'**/drafts/**/*'
'ship.*conf'
'.travis.yml'
'yarn.lock'
'.sass-lint.yml'
'coffeelint.json'
'Gemfile'
'Gemfile.lock'
'vendor/**/*'
'.bundle/**/*'
'.editorconfig'
]
browser:
open: false
before: (roots) ->
helpers = new RootsUtil.Helpers
helpers.project.remove_folders(roots.config.output)
extensions: [
image_pipeline(
files: 'assets/img/**'
compress: false
resize: false
output_webp: false
)
css_pipeline(files: 'assets/css/main.sass', postcss: true)
dynamic_content(write: 'docs.json')
statica()
browserify(
files: 'assets/js/main.coffee'
out: 'js/main.js'
minify: false
sourceMap: true
)
records(
authors: {file: 'authors.json'}
)
]
scss:
sourcemap: true
minify: true
indentedSyntax: true
postcss:
use: [autoprefixer(browsers: ['last 3 version'])]
'coffee-script':
sourcemap: true
locals:
baseUrl: ''
baseDomain: 'http://localhost:1111'
render: fs.readFileSync
md: marked
date: (date) ->
moment(date, 'YYYY-MM-DD hh:mm:ss').format('dddd Do MMMM YYYY')
sort: (posts) ->
posts.sort (a, b) ->
aDate = moment(a.date, 'YYYY-MM-DD hh:mm:ss').unix()
bDate = moment(b.date, 'YYYY-MM-DD hh:mm:ss').unix()
bDate - aDate
jade:
pretty: true
basedir: "#{__dirname}/views"