Commit 5e9ce1c5 authored by Christopher Guindon's avatar Christopher Guindon
Browse files

allow website to host their own search page


Signed-off-by: Christopher Guindon's avatarChristopher Guindon <chris.guindon@eclipse-foundation.org>
parent 4ea7ca67
......@@ -15,7 +15,9 @@ googleAnalytics = ""
# favicon = "images/favicon.ico"
styles = "css/styles.css"
js = "js/solstice.js"
gcse = ""
gcse = "011805775785170369411:p3ec0igo0qq"
gcse_result_url = "/search"
# eclipse_search_icon = "<i data-feather=\"search\" stroke-width=\"1\"></i>"
header_wrapper_class = "header-default-bg-img"
call_for_action_text = "Download"
call_for_action_url = "/downloads"
......
---
title: "Search"
date: 2021-05-04T10:00:00-04:00
---
{{< search_results >}}
\ No newline at end of file
<!--
<!--
Copyright (c) 2018 Eclipse Foundation, Inc.
This program and the accompanying materials are made available under the
......@@ -12,8 +12,10 @@
-->
{{ if .Site.Params.gcse }}
<li class="dropdown eclipse-more hidden-xs">
<a data-toggle="dropdown" class="dropdown-toggle" role="button"><i class="fa fa-search"></i> <b class="caret"></b></a>
<li class="dropdown eclipse-more eclipse-gcse hidden-xs">
<a data-toggle="dropdown" class="dropdown-toggle" role="button">
{{- .Site.Params.eclipse_search_icon | default "<i class=\"fa fa-search\"></i> <b class=\"caret\"></b>" | safeHTML}}
</a>
<ul class="dropdown-menu">
<li>
<!-- Content container to add padding -->
......@@ -24,19 +26,8 @@
<div class="row">
<div class="col-md-24">
<div id="custom-search-form" class="reset-box-sizing">
<script>
(function() {
var cx = '{{ .Site.Params.gcse }}';
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);
})();
</script>
<gcse:searchbox-only gname="main" resultsUrl="https://www.eclipse.org/home/search.php"></gcse:searchbox-only>
<script async src="https://cse.google.com/cse.js?cx={{ .Site.Params.gcse }}"></script>
<gcse:searchbox-only gname="main" resultsUrl="{{- .Site.Params.gcse_result_url | default "https://www.eclipse.org/home/search.php" }}"></gcse:searchbox-only>
</div>
</div>
</div>
......
{{ if .Site.Params.gcse }}
<style type="text/css">
<!--
/* Relevance button */
.gsc-control-cse div{
width:auto!important;
}
.cse .gsc-control-cse, .gsc-control-cse,
.gsc-results .gsc-cursor-box,
.gsc-result-info, .gsc-thumbnail-inside, .gsc-url-top{
padding:0!important;
margin-left:0!important;
margin-right:0!important;
}
.gsc-results .gsc-cursor-box{
text-align:center;
border-top:1px solid #ccc;
padding-top:20px!important;
}
.gsc-result .gs-title{
height:1.4em!important;
overflow: visible !important;
}
-->
</style>
<div class="reset-box-sizing">
<script async src="https://cse.google.com/cse.js?cx={{ .Site.Params.gcse }}"></script>
<gcse:searchbox-only resultsUrl="{{ .Page.Permalink | absURL }}"></gcse:searchbox-only>
<gcse:searchresults-only resultsUrl="{{ .Page.Permalink | absURL }}"></gcse:searchresults-only>
</div>
{{ end }}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment