Skip to content

Commit b806cd1

Browse files
committed
Only load docsearch on docs pages
1 parent cd928e0 commit b806cd1

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

docs/source/_layouts/documentation.blade.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,17 @@
115115
</defs>
116116
</svg>
117117
@endsection
118+
119+
@push('scripts')
120+
@if ($page->production)
121+
<!-- Algolia DocSearch -->
122+
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
123+
<script type="text/javascript">
124+
docsearch({
125+
apiKey: '3df93446658cd9c4e314d4c02a052188',
126+
indexName: 'tailwindcss',
127+
inputSelector: '#docsearch',
128+
});
129+
</script>
130+
@endif
131+
@endpush

docs/source/_layouts/master.blade.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@
2525
@yield('body')
2626

2727
@if ($page->production)
28-
<!-- Algolia DocSearch -->
29-
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
30-
<script type="text/javascript">
31-
docsearch({
32-
apiKey: '3df93446658cd9c4e314d4c02a052188',
33-
indexName: 'tailwindcss',
34-
inputSelector: '#docsearch',
35-
});
36-
</script>
37-
3828
<!-- Google Analytics -->
3929
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-109068504-1"></script>
4030
<script>
@@ -46,5 +36,7 @@ function gtag(){dataLayer.push(arguments);}
4636
</script>
4737
@endif
4838

39+
@stack('scripts')
40+
4941
</body>
5042
</html>

0 commit comments

Comments
 (0)