Added support for Google Custom Search Engine

This commit is contained in:
Li-Wen Yip 2017-03-25 16:17:01 +00:00
commit 0465584c2b
4 changed files with 54 additions and 0 deletions

View file

@ -205,5 +205,17 @@
<script src="{{ .Site.BaseURL }}/js/highlight.min.js"></script>
<script> hljs.initHighlightingOnLoad(); </script>
<script> renderMathInElement(document.body); </script>
<!-- Google Custom Search Engine -->
<script>
(function() {
var cx = '{{ .Site.Params.gcse }}';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
{{ template "_internal/google_analytics.html" . }}