mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(docs-generator): make demos take less time to load
This commit is contained in:
@@ -135,6 +135,17 @@ module.exports = {
|
||||
)
|
||||
});
|
||||
|
||||
//Write the demo list to current version (eg at /nightly);
|
||||
docs.push({
|
||||
docType: 'demo',
|
||||
template: 'demo_list.template.js',
|
||||
outputPath: path.join(
|
||||
config.get('demos.outputFolder'),
|
||||
config.get('versionData.current.folder'),
|
||||
'demo-list.js'
|
||||
)
|
||||
});
|
||||
|
||||
extraData.demos = allDemos;
|
||||
}
|
||||
};
|
||||
|
||||
1
docs/templates/demo_index.template.html
vendored
1
docs/templates/demo_index.template.html
vendored
@@ -8,6 +8,7 @@
|
||||
<link rel="stylesheet" href="/<$ doc.demoData.css.path $>">
|
||||
<@ endif @>
|
||||
<script src="http://code.ionicframework.com/<$ version.current.name $>/js/ionic.bundle.min.js"></script>
|
||||
<script src="<@if version.current.folder @><$ '/'+version.current.folder @><@ endif @>/demo-list.js"></script>
|
||||
<@ if doc.demoData and doc.demoData.javascript @>
|
||||
<script src="/<$ doc.demoData.javascript.path $>"></script>
|
||||
<@ endif @>
|
||||
|
||||
1
docs/templates/demo_list.template.js
vendored
Normal file
1
docs/templates/demo_list.template.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var DEMOS = <$ demos | json $>;
|
||||
3
docs/templates/demo_script.template.js
vendored
3
docs/templates/demo_script.template.js
vendored
@@ -1,4 +1,3 @@
|
||||
var DEMOS = <$ demos | json $>;
|
||||
var DEMO;
|
||||
<@ if doc.demoData @>
|
||||
DEMO = <$ doc.demoData | json $>;
|
||||
@@ -65,7 +64,7 @@ angular.module(<@ if doc.demoData @>'<$ doc.demoData.module $>'
|
||||
})
|
||||
.filter('humanize', function() {
|
||||
return function(input) {
|
||||
return input.charAt(0).toUpperCase() +
|
||||
return input.charAt(0).toUpperCase() +
|
||||
input.substring(1).replace(/[A-Z]/g, function(match, i) {
|
||||
return ' ' + match.toUpperCase();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user