Generate navigation html only once for all pages.

This reduces the time for apidoc generation by ~30%.
This commit is contained in:
Maximilian Krög
2020-02-03 23:37:44 +01:00
parent 35569a8427
commit 0c04293d5f
2 changed files with 2 additions and 1 deletions

View File

@@ -477,6 +477,7 @@ exports.publish = function(taffyData, opts, tutorials) {
// index page displays information from package.json and lists files
const files = find({kind: 'file'});
view.navigationHtml = helper.resolveLinks(view.partial('navigation.tmpl'));
generate('Index',
[{kind: 'mainpage', readme: opts.readme, longname: (opts.mainpagetitle) ? opts.mainpagetitle : 'Main Page'}].concat(files),
indexUrl);

View File

@@ -92,7 +92,7 @@ var version = obj.packageInfo.version;
</div>
<div id="wrap" class="clearfix">
<?js= this.partial('navigation.tmpl', this) ?>
<?js= this.navigationHtml ?>
<div class="main">
<h1 class="page-title" data-filename="<?js= filename ?>"><?js= title ?></h1>
<div id="latest-check" class="alert alert-warning alert-dismissible" role="alert" style="display:none">