Created
March 17, 2019 19:04
-
-
Save ataliba/610083ad1ea4c35309d59ee388bc4866 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script language="javascript"> | |
function myFunction(searchboxid) { | |
if (window.location.hostname == "localhost") { | |
console.log( "Running on localhost not a proper domain so cannot search via duckduckgo.com" ); | |
return; | |
} | |
var q = document.getElementById('searchboxid').value; | |
q = encodeURIComponent( q ); | |
// var site = "rv1.tech"; | |
var site = "{{ .Site.BaseURL }}" ; | |
var url = "https://duckduckgo.com?q=" + q + "+site:" + site; | |
console.log( url ); | |
window.open(url, "_self"); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment