forked from DefinitelyTyped/definitelytyped.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docpad.js
114 lines (112 loc) · 2.82 KB
/
docpad.js
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
/* jshint -W014 */
var docpadConfig = {
templateData: {
site: {
url: 'http://definitelytyped.org',
github: 'https://github.com/DefinitelyTyped/DefinitelyTyped',
ref: 'github.com/DefinitelyTyped/DefinitelyTyped',
home: '/',
gh: {
user: 'DefinitelyTyped',
repo: 'DefinitelyTyped'
},
oldUrls: [],
title: 'DefinitelyTyped',
description: 'The repository for high quality TypeScript type definitions',
tagline: 'The repository for high quality TypeScript type definitions',
keywords: 'typescript, type, definition, declaration, repository, typing',
styles: [
'/styles/semantic.min.css',
'/styles/highlight.css',
'/styles/style.css'
],
scripts: [
'//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js',
'/scripts/semantic.min.js',
'/scripts/script.js'
],
analytics: {
id: 'UA-47495295-3',
site: 'definitelytyped.org'
}
},
badges: {
basic: {
link: 'http://definitelytyped.org',
label: 'TypeScript definitions on DefinitelyTyped',
svg_base: '//definitelytyped.org/badges/standard.svg',
svg_flat: '//definitelytyped.org/badges/standard-flat.svg'
}
},
link: {
typesearch: {
web: 'https://microsoft.github.io/TypeSearch/'
}
},
getPreparedTitle: function() {
if (this.document.title) {
return '' + this.document.title + ' | ' + this.site.title;
} else {
return this.site.title;
}
},
getPreparedDescription: function() {
return this.document.description || this.site.description;
},
getPreparedKeywords: function() {
return this.site.keywords.concat(this.document.keywords || []).join(', ');
},
getBadgeMarkdown: function(type) {
var link = this.badges.basic.link;
var label = this.badges.basic.label;
var image = this.badges.basic.svg_base;
if (type === 'flat') {
image = this.badges.basic.svg_flat;
}
return '[![' + label +'](' + image +')](' + link +')';
},
getBadgeHTML: function(type) {
var link = this.badges.basic.link;
var label = this.badges.basic.label;
var image = this.badges.basic.svg_base;
if (type === 'flat') {
image = this.badges.basic.svg_flat;
}
return '<a href="' + link +'"><img src="' + image +'" alt="' + label +'"></a>';
}
},
collections: {
pages: function() {
return this.getCollection('documents').findAllLive({
relativeOutDirPath: 'pages'
});
},
guides: function() {
return this.getCollection('documents').findAllLive({
relativeOutDirPath: 'guides'
});
},
directory: function() {
return this.getCollection('documents').findAllLive({
relativeOutDirPath: 'directory'
});
}
},
environments: {
development: {
templateData: {
site: {
url: false
}
}
}
},
plugins: {
marked: {
markedOptions: require('./lib/marked')
}
},
events: {
}
};
module.exports = docpadConfig;