forked from projectOpenRAP/projectOpenRAP.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.html
90 lines (78 loc) · 2.35 KB
/
search.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
title: Search
description: Search OpenRAP
language: en-Gb
keywords:
allowSearch: false
---
<!DOCTYPE html>
<html prefix="og: http://ogp.me/ns/website#" lang="en">
<head>
{% include head.html %}
<meta name="robots" content="noindex,nofollow">
</head>
<body>
<!-- Header -->
{% include header.html %}
<!-- /Header -->
<!-- Help Navigation-->
<!-- /Help Navigation--->
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="search-inner p-20 mt-20">
<p>
<span id="search-process">Loading</span> results <span id="search-query-container" style="display: none;">for "<strong id="search-query"></strong>"</span>
</p>
<ul id="search-results"></ul>
</div>
</div>
</div>
</div>
<script>
window.data = {
{% for post in site.pages %}
{% if post.allowSearch %}
{% if post.title %}
{% if added %},{% endif %}
{% assign added = false %}
"{{ post.url | slugify }}": {
"id": "{{ post.url | slugify }}",
"title": "{{ post.title | xml_escape }}",
"keywords": "{{ post.keywords | join: ", " | xml_escape }}",
"description": "{{ post.description | xml_escape }}",
"category": "{{ post.categories | join: ", " | xml_escape }}",
"userRole": "{{ post.SubCategories}}",
"url": " {{ post.url | xml_escape }}",
"content": {{ post.content | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }}
}
{% assign added = true %}
{% endif %}
{% endif %}
{% endfor %}
};
</script>
<script>
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
};
var searchQuery = getUrlParameter('q');
$("#searchBoxInput").val(searchQuery);
</script>
<script type="text/javascript" src="/js/lunr.min.js?{{ site.time}}"></script>
<script type="text/javascript" src="/js/search.js?{{ site.time}}"></script>
<!-- Footer -->
<div class="footer-fix"> </div>
{% include footer.html %}
<!-- /Footer -->
</body>
</html>