diff options
| author | Yehonal <yehonal.azeroth@gmail.com> | 2018-12-17 16:16:43 +0100 |
|---|---|---|
| committer | Yehonal <yehonal.azeroth@gmail.com> | 2018-12-17 21:00:26 +0100 |
| commit | 4feaace4929a07cc34c4bcd6c57334be2d95ec31 (patch) | |
| tree | 8b2b272a40a9c002d8d0c18831fd95bd03a246e3 /_includes | |
| parent | 1ffe35e8bed26b833bf873f6062a548aa26e2598 (diff) | |
| download | wiki-4feaace4929a07cc34c4bcd6c57334be2d95ec31.tar.gz wiki-4feaace4929a07cc34c4bcd6c57334be2d95ec31.tar.bz2 wiki-4feaace4929a07cc34c4bcd6c57334be2d95ec31.zip | |
Implemented js search and SEO optimizations
Diffstat (limited to '_includes')
| -rw-r--r-- | _includes/gw_head/meta.html | 3 | ||||
| -rw-r--r-- | _includes/gw_tools/search_github.html | 10 | ||||
| -rw-r--r-- | _includes/gw_tools/search_google.html | 12 | ||||
| -rw-r--r-- | _includes/gw_tools/search_js.html | 15 | ||||
| -rw-r--r-- | _includes/gw_tools/search_module.html | 28 |
5 files changed, 42 insertions, 26 deletions
diff --git a/_includes/gw_head/meta.html b/_includes/gw_head/meta.html index 141ab05..bfae3da 100644 --- a/_includes/gw_head/meta.html +++ b/_includes/gw_head/meta.html @@ -5,7 +5,8 @@ <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="chrome=1"> <meta name="viewport" content="width=device-width"> -<title>{{ site.title | default: site.github.repository_name }} by {{ site.github.owner_name }}</title> + +{% seo %} {% if site.inc_after_meta %} {% include {{ site.inc_after_meta }} %} diff --git a/_includes/gw_tools/search_github.html b/_includes/gw_tools/search_github.html new file mode 100644 index 0000000..efcc5e8 --- /dev/null +++ b/_includes/gw_tools/search_github.html @@ -0,0 +1,10 @@ +<form method="GET" action="{{ site.github.repository_url }}/search"> + <input type="text" name="q[]" placeholder="Text to search"> + {% if site.use_github_wiki %} + <input type="hidden" name="type" value="Wikis"> + {% else %} + <!-- <input type="hidden" name="l" value="Markdown"> --> + <input type="hidden" name="q[]" value="path:/{{ site.wiki_folder }}"> + {% endif %} + <input type="submit" value="Search"> +</form>
\ No newline at end of file diff --git a/_includes/gw_tools/search_google.html b/_includes/gw_tools/search_google.html new file mode 100644 index 0000000..0c3e675 --- /dev/null +++ b/_includes/gw_tools/search_google.html @@ -0,0 +1,12 @@ +<script> + (function () { + var cx = "{{site.google_cse_token}}"; + 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> +<gcse:search></gcse:search>
\ No newline at end of file diff --git a/_includes/gw_tools/search_js.html b/_includes/gw_tools/search_js.html new file mode 100644 index 0000000..673fb39 --- /dev/null +++ b/_includes/gw_tools/search_js.html @@ -0,0 +1,15 @@ +<div class="container"> + <div class="well" id="searchbox"> + <input id="search-field" placeholder="Search the Site"/> + <ul id="results"></ul> + </div> +</div> + +<script src="{{ '/assets/js/jquery.camelhunter.min.js' | relative_url }}"></script> +<script type="text/javascript"> + $("#search-field").camelHunter({ + onKeyUp : true, + rss: "/sitemap_full.xml", + results : "#results" + }); +</script>
\ No newline at end of file diff --git a/_includes/gw_tools/search_module.html b/_includes/gw_tools/search_module.html index f79335a..7664e19 100644 --- a/_includes/gw_tools/search_module.html +++ b/_includes/gw_tools/search_module.html @@ -1,25 +1,3 @@ -{% if site.google_cse_token %} -<script> - (function () { - var cx = "{{site.google_cse_token}}"; - 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> -<gcse:search></gcse:search> -{% else %} -<form method="GET" action="{{ site.github.repository_url }}/search"> - <input type="text" name="q[]" placeholder="Text to search"> - {% if site.use_github_wiki %} - <input type="hidden" name="type" value="Wikis"> - {% else %} - <!-- <input type="hidden" name="l" value="Markdown"> --> - <input type="hidden" name="q[]" value="path:/{{ site.wiki_folder }}"> - {% endif %} - <input type="submit" value="Search"> -</form> -{% endif %}
\ No newline at end of file +{% assign se = site.search_engine | default: "github" %} +{% assign file = "gw_tools/search_" | append: se | append: ".html" %} +{% include {{file}} %}
\ No newline at end of file |
