Skip to content

Commit

Permalink
Don't regen the TOC every time the page is accessed
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Sep 2, 2012
1 parent c483e7e commit a565b6a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions share/mason/site/api-docs
Expand Up @@ -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>
Expand Down

0 comments on commit a565b6a

Please sign in to comment.