1
0
mirror of https://github.com/mbirth/wiki.git synced 2024-09-19 06:23:25 +01:00

Added Google Custom Search Engine.

This commit is contained in:
Markus Birth 2015-02-19 11:20:39 +01:00
parent ab502482a1
commit b1dcf9479a
3 changed files with 39 additions and 6 deletions

View File

@ -14,19 +14,25 @@
{% if page.toc %}
<script src="{{ site.url }}/bower_components/jquery.toc/jquery.toc.js" type="text/javascript"></script>
{% endif %}
<script src="{{ site.url }}/javascripts/gcse.js" type="text/javascript"></script>
</head>
<body>
<header>
<div class="container">
<h1>{{ site.name }}</h1>
<h2>{{ site.description }}</h2>
<div id="headerleft">
<h1>{{ site.name }}</h1>
<h2>{{ site.description }}</h2>
<section id="downloads">
<a href="https://plus.google.com/+MarkusBirth/about" rel="author" class="btn">Find me on Google+</a>
<a href="https://github.com/mbirth/wiki" class="btn btn-github"><span class="icon"></span>View on GitHub</a>
</section>
<section id="downloads">
<a href="https://plus.google.com/+MarkusBirth/about" rel="author" class="btn">Find me on Google+</a>
<a href="https://github.com/mbirth/wiki" class="btn btn-github"><span class="icon"></span>View on GitHub</a>
</section>
</div>
<div id="headerright">
<gcse:search></gcse:search>
</div>
</div>
</header>
<div class="container">

10
javascripts/gcse.coffee Normal file
View File

@ -0,0 +1,10 @@
---
---
cx = '005859900804634181508:3bt_l7jyk2e'
gcse = document.createElement 'script'
gcse.type = 'text/javascript'
gcse.async = true
gcse.src = '//www.google.com/cse/cse.js?cx=' + cx
s = document.getElementsByTagName('script')[0]
s.parentNode.insertBefore gcse, s

17
search.html Normal file
View File

@ -0,0 +1,17 @@
---
title: Search
---
<script>
(function() {
var cx = '005859900804634181508:3bt_l7jyk2e';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>