spaCy/website/_includes/_functions.jade

36 lines
941 B
Plaintext
Raw Normal View History

2016-10-03 21:19:13 +03:00
//- 💫 INCLUDES > FUNCTIONS
2016-10-31 21:04:15 +03:00
//- More descriptive variables for current.path and current.source
- CURRENT = current.source
- SECTION = current.path[0]
- SUBSECTION = current.path[1]
2016-03-31 17:24:48 +03:00
2016-10-03 21:19:13 +03:00
//- Add prefixes to items of an array (for modifier CSS classes)
2016-03-31 17:24:48 +03:00
- function prefixArgs(array, prefix) {
2016-10-03 21:19:13 +03:00
- return array.map(function(arg) {
- return prefix + '--' + arg;
- }).join(' ');
2016-03-31 17:24:48 +03:00
- }
2016-10-31 21:04:15 +03:00
//- Generate GitHub links
- function gh(repo, filepath, branch) {
- var branch = ALPHA ? 'develop' : branch
2016-10-31 21:04:15 +03: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'
- }