do not use root in templates directly (in favor of rawRootUrl)
This commit is contained in:
		
							parent
							
								
									7fa8225d80
								
							
						
					
					
						commit
						56dcda5619
					
				| 
						 | 
					@ -1,3 +1,3 @@
 | 
				
			||||||
<form action="{{root}}search/">
 | 
					<form action="{{#rawRootUrl}}search{{/rawRootUrl}}">
 | 
				
			||||||
  <input name="search_query" id="search_query" />
 | 
					  <input name="search_query" id="search_query" />
 | 
				
			||||||
</form>
 | 
					</form>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
<link rel="prefetch" href="{{root}}search-index.json" />
 | 
					<link rel="prefetch" href="{{#rawRootUrl}}search-index.json{{/rawRootUrl}}" />
 | 
				
			||||||
<link rel="prefetch" href="{{root}}search-metadata.json" />
 | 
					<link rel="prefetch" href="{{#rawRootUrl}}search-metadata.json{{/rawRootUrl}}" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<div id="search_placeholder">
 | 
					<div id="search_placeholder">
 | 
				
			||||||
  <p>Search is loading. If you cannot see any results after a few seconds, check that JavaScript is enabled in your browser.</p>
 | 
					  <p>Search is loading. If you cannot see any results after a few seconds, check that JavaScript is enabled in your browser.</p>
 | 
				
			||||||
| 
						 | 
					@ -28,7 +28,7 @@
 | 
				
			||||||
  <p>The error description is: <span style="color: red" id="search_error_text"></span></p>
 | 
					  <p>The error description is: <span style="color: red" id="search_error_text"></span></p>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script src="{{root}}static/lunr.min.js"></script>
 | 
					<script src="{{#rawRootUrl}}static/lunr.min.js{{/rawRootUrl}}"></script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
  lunr.QueryLexer.termSeparator = /(\p{P}|\p{S}|\p{Z}|\p{C})+/u;
 | 
					  lunr.QueryLexer.termSeparator = /(\p{P}|\p{S}|\p{Z}|\p{C})+/u;
 | 
				
			||||||
| 
						 | 
					@ -117,10 +117,10 @@
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Promise.all([
 | 
					  Promise.all([
 | 
				
			||||||
    fetch('{{root}}search-index.json').then(response => response.text()).then(text => {
 | 
					    fetch('{{#rawRootUrl}}search-index.json{{/rawRootUrl}}').then(response => response.text()).then(text => {
 | 
				
			||||||
      window.search_index = lunr.Index.load(JSON.parse(text))
 | 
					      window.search_index = lunr.Index.load(JSON.parse(text))
 | 
				
			||||||
    }),
 | 
					    }),
 | 
				
			||||||
    fetch('{{root}}search-metadata.json').then(response => response.text()).then(text => {
 | 
					    fetch('{{#rawRootUrl}}search-metadata.json{{/rawRootUrl}}').then(response => response.text()).then(text => {
 | 
				
			||||||
      window.search_metadata = JSON.parse(text)
 | 
					      window.search_metadata = JSON.parse(text)
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
  ]).then(() => {
 | 
					  ]).then(() => {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue