-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcontent.js
95 lines (86 loc) · 1.75 KB
/
content.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
var swig = require('swig');
swig.setFilter('format_tag', function(input, id) {
return input[id];
});
swig.setFilter('format_date', function(input, id) {
return '2014-11-10';
});
swig.setFilter('format_tag', function(input, id) {
return 'tag';
});
swig.setFilter('truncate', function(input, len, bool, end) { // added bool to match jinja, not used
end = (typeof end === 'undefined') ? '...' : end;
if(typeof input === 'string') {
return input.substring(0, len) + ((input.length > len) ? end : '');
}
return input;
});
module.exports = function(type) {
var global = {
assets: function(location) {
return '/assets/' + location;
},
static: function(location) {
return 'http://postach.io/static/' + location;
},
set_active: function(location) {
return 'active';
},
header_meta: '',
footer_meta: '',
login_form: '',
is_login: false,
is_home: false,
is_tag: false,
site: {
avatar: '',
author: '',
name: '',
analytics: false,
cover_photo: '',
facebook: '',
twitter: '',
googleplus: '',
linkedin: '',
atom_url: '',
disqus: '',
base_url: '/'
},
post: {
title: ''
},
posts: [{
permalink: '',
title: '',
content: '',
created_at: '',
type: 'post',
url: '',
tags: ['tag-one', 'another-tag', 'content']
}],
tag: {
name: ''
},
page: {
permalink: '',
title: ''
},
pages: [{
_id: '',
permalink: '',
title: '',
content: ''
}],
pagination: {
prev: '',
next: ''
}
};
var data = {
page: global,
post: global,
tag: global,
home: global
}
return data[type];
};