1
0
mirror of https://github.com/mbirth/wiki.git synced 2024-11-09 13:16:45 +00: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 %} {% if page.toc %}
<script src="{{ site.url }}/bower_components/jquery.toc/jquery.toc.js" type="text/javascript"></script> <script src="{{ site.url }}/bower_components/jquery.toc/jquery.toc.js" type="text/javascript"></script>
{% endif %} {% endif %}
<script src="{{ site.url }}/javascripts/gcse.js" type="text/javascript"></script>
</head> </head>
<body> <body>
<header> <header>
<div class="container"> <div class="container">
<h1>{{ site.name }}</h1> <div id="headerleft">
<h2>{{ site.description }}</h2> <h1>{{ site.name }}</h1>
<h2>{{ site.description }}</h2>
<section id="downloads"> <section id="downloads">
<a href="https://plus.google.com/+MarkusBirth/about" rel="author" class="btn">Find me on Google+</a> <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> <a href="https://github.com/mbirth/wiki" class="btn btn-github"><span class="icon"></span>View on GitHub</a>
</section> </section>
</div>
<div id="headerright">
<gcse:search></gcse:search>
</div>
</div> </div>
</header> </header>
<div class="container"> <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>