Permalink
Browse files

Don't regen the TOC every time the page is accessed

  • Loading branch information...
autarch committed Sep 2, 2012
1 parent c483e7e commit a565b6af9b7204eae7ba3f25eac8c49843c83ba4
Showing with 11 additions and 5 deletions.
  1. +11 −5 share/mason/site/api-docs
View
@@ -9,14 +9,20 @@
</div>
</div>
+<%once>
+my $toc;
+</%once>
+
<%init>
my $docs = $m->scomp('.docs');
-my $toc = Text::TOC::HTML->new();
-$toc->add_file(
- file => $m->request_comp()->name(),
- content => $docs,
-);
+unless ($toc) {
+ $toc = Text::TOC::HTML->new();
+ $toc->add_file(
+ file => $m->request_comp()->name(),
+ content => $docs,
+ );
+}
</%init>
<%def .docs>

0 comments on commit a565b6a

Please sign in to comment.