2017-01-01 14:45:37 +03:00
|
|
|
|
//- 💫 INCLUDES > SCRIPTS
|
|
|
|
|
|
2017-10-03 15:18:49 +03:00
|
|
|
|
if quickstart
|
2017-10-30 16:06:25 +03:00
|
|
|
|
script(src="/assets/js/vendor/quickstart.min.js")
|
2017-10-03 15:18:49 +03:00
|
|
|
|
|
|
|
|
|
if IS_PAGE
|
2017-10-30 16:06:25 +03:00
|
|
|
|
script(src="/assets/js/vendor/in-view.min.js")
|
2017-10-03 15:18:49 +03:00
|
|
|
|
|
|
|
|
|
if environment == "deploy"
|
|
|
|
|
script(async src="https://www.google-analytics.com/analytics.js")
|
|
|
|
|
|
2017-10-30 16:06:25 +03:00
|
|
|
|
script(src="/assets/js/vendor/prism.min.js")
|
2017-01-01 14:45:37 +03:00
|
|
|
|
|
2017-11-03 20:51:03 +03:00
|
|
|
|
if compare_models
|
2017-10-30 16:06:25 +03:00
|
|
|
|
script(src="/assets/js/vendor/chart.min.js")
|
2017-10-03 15:18:49 +03:00
|
|
|
|
|
2017-10-30 16:06:25 +03:00
|
|
|
|
script
|
2017-05-17 13:03:42 +03:00
|
|
|
|
if quickstart
|
2017-10-03 15:18:49 +03:00
|
|
|
|
| new Quickstart("#qs");
|
2017-05-17 13:03:42 +03:00
|
|
|
|
|
2017-10-30 16:06:25 +03:00
|
|
|
|
if environment == "deploy"
|
|
|
|
|
| window.ga=window.ga||function(){
|
|
|
|
|
| (ga.q=ga.q||[]).push(arguments)}; ga.l=+new Date;
|
|
|
|
|
| ga('create', '#{ANALYTICS}', 'auto'); ga('send', 'pageview');
|
|
|
|
|
|
2017-11-03 13:29:21 +03:00
|
|
|
|
if IS_PAGE
|
2017-10-03 15:18:49 +03:00
|
|
|
|
| ((window.gitter = {}).chat = {}).options = {
|
|
|
|
|
| useStyles: false,
|
|
|
|
|
| activationElement: '.js-gitter-button',
|
|
|
|
|
| targetElement: '.js-gitter',
|
|
|
|
|
| room: '!{SOCIAL.gitter}'
|
|
|
|
|
| };
|
2017-11-03 13:29:21 +03:00
|
|
|
|
|
|
|
|
|
if IS_PAGE
|
2017-10-30 16:06:25 +03:00
|
|
|
|
script(src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer)
|
|
|
|
|
|
2017-01-01 14:45:37 +03:00
|
|
|
|
|
2017-10-30 16:06:25 +03:00
|
|
|
|
//- JS modules – slightly hacky, but necessary to dynamically instantiate the
|
|
|
|
|
classes with data from the Harp JSON files, while still being able to
|
|
|
|
|
support older browsers that can't handle JS modules. More details:
|
|
|
|
|
https://medium.com/dev-channel/es6-modules-in-chrome-canary-m60-ba588dfb8ab7
|
|
|
|
|
|
|
|
|
|
- ProgressBar = "new ProgressBar('.js-progress');"
|
2017-11-05 18:08:13 +03:00
|
|
|
|
- Accordion = "new Accordion('.js-accordion');"
|
2017-10-30 16:06:25 +03:00
|
|
|
|
- Changelog = "new Changelog('" + SOCIAL.github + "', 'spacy');"
|
|
|
|
|
- NavHighlighter = "new NavHighlighter('data-section', 'data-nav');"
|
|
|
|
|
- GitHubEmbed = "new GitHubEmbed('" + SOCIAL.github + "', 'data-gh-embed');"
|
|
|
|
|
- ModelLoader = "new ModelLoader('" + MODELS_REPO + "'," + JSON.stringify(CURRENT_MODELS) + "," + JSON.stringify(MODEL_LICENSES) + "," + JSON.stringify(MODEL_BENCHMARKS) + ");"
|
2017-10-30 16:09:43 +03:00
|
|
|
|
- ModelComparer = "new ModelComparer('" + MODELS_REPO + "'," + JSON.stringify(MODEL_LICENSES) + "," + JSON.stringify(MODEL_BENCHMARKS) + "," + JSON.stringify(LANGUAGES) + "," + JSON.stringify(MODEL_META) + "," + JSON.stringify(default_models || false) + ");"
|
2017-10-30 16:06:25 +03:00
|
|
|
|
|
2017-11-03 13:29:21 +03:00
|
|
|
|
if environment == "deploy"
|
|
|
|
|
//- DEPLOY: use compiled rollup.js and instantiate classes directly
|
2017-11-05 21:23:45 +03:00
|
|
|
|
script(src="/assets/js/rollup.js?v#{V_JS}")
|
2017-11-03 13:29:21 +03:00
|
|
|
|
script
|
|
|
|
|
!=ProgressBar
|
|
|
|
|
if changelog
|
|
|
|
|
!=Changelog
|
|
|
|
|
if IS_PAGE
|
|
|
|
|
!=NavHighlighter
|
|
|
|
|
!=GitHubEmbed
|
2017-11-05 18:08:13 +03:00
|
|
|
|
!=Accordion
|
2017-11-03 13:29:21 +03:00
|
|
|
|
if HAS_MODELS
|
2017-11-03 20:51:03 +03:00
|
|
|
|
!=ModelLoader
|
2017-11-03 13:29:21 +03:00
|
|
|
|
if compare_models
|
|
|
|
|
!=ModelComparer
|
|
|
|
|
else
|
|
|
|
|
//- DEVELOPMENT: Use ES6 modules
|
|
|
|
|
script(type="module")
|
|
|
|
|
| import ProgressBar from '/assets/js/progress.js';
|
|
|
|
|
!=ProgressBar
|
|
|
|
|
if changelog
|
|
|
|
|
| import Changelog from '/assets/js/changelog.js';
|
|
|
|
|
!=Changelog
|
|
|
|
|
if IS_PAGE
|
|
|
|
|
| import NavHighlighter from '/assets/js/nav-highlighter.js';
|
|
|
|
|
!=NavHighlighter
|
|
|
|
|
| import GitHubEmbed from '/assets/js/github-embed.js';
|
|
|
|
|
!=GitHubEmbed
|
2017-11-05 18:08:13 +03:00
|
|
|
|
| import Accordion from '/assets/js/accordion.js';
|
|
|
|
|
!=Accordion
|
2017-11-03 13:29:21 +03:00
|
|
|
|
if HAS_MODELS
|
|
|
|
|
| import { ModelLoader } from '/assets/js/models.js';
|
|
|
|
|
!=ModelLoader
|
|
|
|
|
if compare_models
|
|
|
|
|
| import { ModelComparer } from '/assets/js/models.js';
|
|
|
|
|
!=ModelComparer
|