Skip to content

Commit e99c88f

Browse files
qzhou1607-zzalrra
authored andcommitted
Load treeview.js only on pages where it's needed
Close #148
1 parent 0da789b commit e99c88f

File tree

1 file changed

+2
-0
lines changed
  • src/hexo/themes/documentation/layout

1 file changed

+2
-0
lines changed

src/hexo/themes/documentation/layout/index.hbs

+2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@
7777
<script src="{{url_for "js/nav.js "}}"></script>
7878
<script src="{{url_for "core/scripts/form-validation.js "}}"></script>
7979
<script src="{{url_for "components/accordion/accordion.js "}}"></script>
80+
{{#compare page.category 'belongsTo' 'developer-guide, user-guide'}}
8081
<script src="{{url_for "components/treeview/treeview.js "}}"></script>
82+
{{/compare}}
8183
{{>docsearch}}
8284
<script>(function(G,o,O,g,l){G.GoogleAnalyticsObject=O;G[O]||(G[O]=function(){(G[O].q=G[O].q||[]).push(arguments)});G[O].l=+new Date;g=o.createElement('script'),l=o.scripts[0];g.src='https://www.google-analytics.com/analytics.js';l.parentNode.insertBefore(g,l)}(this,document,'ga'));ga('create','{{ theme.google_analytics }}');ga('send','pageview')</script>
8385
</body>

0 commit comments

Comments
 (0)