Skip to content

Commit 21443cd

Browse files
committed
For search page put js at the beginning.
The search page has embedded js. Needs the libraries loaded in the head.
1 parent d2c76ee commit 21443cd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

website/www/_templates/layout.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
FILE_SUFFIX: '{{ file_suffix }}'
3333
};
3434
</script>
35+
{%- if pagename == 'search' %}
36+
{%- for scriptfile in script_files %}
37+
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
38+
{%- endfor %}
39+
<script type="text/javascript">$('#searchbox').show(0);</script>
40+
{%- endif %}
3541
{%- if pageurl %}
3642
<link rel="canonical" href="{{ pageurl|e }}" />
3743
{%- endif %}
@@ -64,7 +70,6 @@
6470
<link rel="prev" title="{{ prev.title|striptags }}" href="{{ prev.link|e }}" />
6571
{%- endif %}
6672
{%- endblock %}
67-
{%- block extrahead %} {% endblock %}
6873
</head>
6974
<body>
7075
<div id="skiplink"><a href="#main">Skip to main content</a></div>
@@ -138,9 +143,13 @@
138143
integrity="sha384-QGgNMMRFTi8ul5kHJ+vXysPe8gySvSA/Y3rpXZiRLzKPIw8CWY+a3ObKmQsyDr+a"
139144
async="" src="{{ pathto('_static/goatcounter_count.v3.js', 1) }}">
140145
</script>
146+
{%- if pagename != 'search' %}
141147
{%- for scriptfile in script_files %}
142148
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
143149
{%- endfor %}
144150
<script type="text/javascript">$('#searchbox').show(0);</script>
151+
{%- endif %}
152+
{%- block extrahead %} {% endblock %}
153+
145154
</body>
146155
</html>

0 commit comments

Comments
 (0)