spaCy/website/_includes/_functions.jade

36 lines
941 B
Plaintext
Raw Normal View History

2016-10-03 18:19:13 +00:00
//- 💫 INCLUDES > FUNCTIONS
2016-10-31 18:04:15 +00:00
//- More descriptive variables for current.path and current.source
- CURRENT = current.source
- SECTION = current.path[0]
- SUBSECTION = current.path[1]
2016-03-31 14:24:48 +00:00
2016-10-03 18:19:13 +00:00
//- Add prefixes to items of an array (for modifier CSS classes)
2016-03-31 14:24:48 +00:00
- function prefixArgs(array, prefix) {
2016-10-03 18:19:13 +00:00
- return array.map(function(arg) {
- return prefix + '--' + arg;
- }).join(' ');
2016-03-31 14:24:48 +00:00
- }
2016-10-31 18:04:15 +00:00
//- Generate GitHub links
- function gh(repo, filepath, branch) {
- var branch = ALPHA ? 'develop' : branch
2016-10-31 18:04:15 +00:00
- return 'https://github.com/' + SOCIAL.github + '/' + repo + (filepath ? '/blob/' + (branch || 'master') + '/' + filepath : '' );
- }
//- Get social images
- function getSocialImg() {
- var base = SITE_URL + '/assets/img/social/preview_'
- var image = 'default'
- if (preview) image = preview
- else if (SECTION == 'docs') image = 'docs'
- return base + image + '.jpg'
- }