This repository has been archived by the owner on Apr 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathconfig.js
69 lines (64 loc) · 1.82 KB
/
config.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
/*
* # DEPENDENCIES #
*/
var path = require('path')
var globby = require('globby')
/*
* Variables that depend on each other
*/
// paths
var lessonRoot = path.resolve('..')
var buildRoot = path.join(lessonRoot, 'build')
var builderRoot = path.basename(__dirname)
var assetRoot = path.join(buildRoot, 'assets')
var sourceFolder = 'src'
var sourceRoot = path.join(lessonRoot, sourceFolder)
/**
* Collections
* Collections are folders which contain an index.md file.
* This allows for redirections, e.g., empty index.html with
* <script> window.location = "newUrl" </script>
*/
var collectionIndexPath = sourceRoot + '/*/index.md'
var collectionIndexes = globby.sync(collectionIndexPath)
var collections = collectionIndexes.map(function (value) {
// ["../src/python/index.md", ...] -> ["python", ...]
var start = sourceRoot.length + 1
var length = value.indexOf('/index.md') - start
return value.substr(start, length)
})
/*
* Export. Independent variables can be put here directly.
*/
var config = {
assetRoot: assetRoot,
buildRoot: buildRoot,
builderRoot: builderRoot,
lessonRoot: lessonRoot,
// folder names
playlistFolder: 'playlists',
sourceFolder: sourceFolder,
sourceRoot: sourceRoot,
// collections
collections: collections,
// github webhook for automatic building
// Payload URL will be http://ghHost:ghPort/ghPath
ghHost: '0.0.0.0', // 0.0.0.0 listen on all interfaces
ghPort: 3034,
ghPath: '/',
ghMergeCommand: '../deploy.sh',
ghSecret: 'secret',
// link crawling
productionCrawlStart: 'http://kodeklubben.github.io/',
showFlags: false,
locales: ['nb-NO', 'nn-NO', 'en-US'],
// for improve links in lessons
repo: 'https://github.com/kodeklubben/oppgaver',
levelNames: {
'1': 'Introduksjon',
'2': 'Nybegynner',
'3': 'Erfaren',
'4': 'Ekspert'
}
}
module.exports = config