Bing search for China users (#9845)
* Updates readme's site building instructions * Alters dockerfile to use extended hugo build This is necessary for the pipes used w/ TOCSS since node-sass was dropped * WIP for bing search implementation * Implements Bing search instead of google * Makes bing the default result provider and uses google and it's available * Adds pagination to bing and replaces the $.get call with a $.ajax call * front adjust * bing limit pagination * Adds break if there are less than 10 pages worth of results on bing search * Adds proper google script ref and proper config id * Removes console.log call
This commit is contained in:
@@ -1,23 +1,12 @@
|
||||
{{ define "content" }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
<script type="text/javascript">
|
||||
document.write('<gcse:searchresults-only linktarget="_parent"></gcse:searchresults-only>');
|
||||
</script>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
var cx = '013288817511911618469:elfqqbqldzg';
|
||||
var gcse = document.createElement('script');
|
||||
gcse.type = 'text/javascript';
|
||||
gcse.async = true;
|
||||
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
|
||||
'//cse.google.com/cse.js?cx=' + cx;
|
||||
var s = document.getElementsByTagName('script')[0];
|
||||
s.parentNode.insertBefore(gcse, s);
|
||||
<gcse:searchresults-only linktarget="_parent">
|
||||
<div id="bing-results-container">Fetching results..</div>
|
||||
<div id="bing-pagination-container"></div>
|
||||
</gcse:searchresults-only>
|
||||
|
||||
document.querySelector('html').classList.add('search');
|
||||
})();
|
||||
</script>
|
||||
<script src="{{ "js/search.js" | relURL }}"></script>
|
||||
{{ end }}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user