Skip to content

Commit e101809

Browse files
committedAug 23, 2018
basic search
1 parent 812fc8c commit e101809

7 files changed

+162
-2
lines changed
 

‎_site/feed.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<description>The plain text recipe database for hackers</description>
66
<link>http://localhost:4000/</link>
77
<atom:link href="http://localhost:4000/feed.xml" rel="self" type="application/rss+xml"/>
8-
<pubDate>Wed, 22 Aug 2018 20:59:28 -0500</pubDate>
9-
<lastBuildDate>Wed, 22 Aug 2018 20:59:28 -0500</lastBuildDate>
8+
<pubDate>Wed, 22 Aug 2018 21:07:33 -0500</pubDate>
9+
<lastBuildDate>Wed, 22 Aug 2018 21:07:33 -0500</lastBuildDate>
1010
<generator>Jekyll v3.8.3</generator>
1111

1212
<item>

‎_site/plugins/simple-jekyll-search.min.js

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎_site/search.html

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!-- Html Elements for Search -->
2+
<div id="search-container">
3+
<input type="text" id="search-input" placeholder="search...">
4+
<ul id="results-container"></ul>
5+
</div>
6+
7+
<!-- Script pointing to search-script.js -->
8+
<script src="/plugins/simple-jekyll-search.min.js" type="text/javascript"></script>
9+
10+
<!-- Configuration -->
11+
<script>
12+
SimpleJekyllSearch({
13+
searchInput: document.getElementById('search-input'),
14+
resultsContainer: document.getElementById('results-container'),
15+
json: '/search.json',
16+
searchResultTemplate: '<div><a href="{url}"><h1>{title}</h1></a><span>{date}</span></div>'
17+
})
18+
</script>

‎_site/search.json

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
[
2+
3+
{
4+
5+
"title" : "Broccoli Beer Cheese Soup",
6+
"url" : "/recipes/broccoli-cheese-soup.html",
7+
"date" : "2018-08-22 21:07:33 -0500"
8+
9+
} ,
10+
11+
{
12+
13+
"title" : "Crockpot Buffalo Chicken",
14+
"url" : "/recipes/crockpot-buffalo-chicken.html",
15+
"date" : "2018-08-22 21:07:33 -0500"
16+
17+
} ,
18+
19+
{
20+
21+
"title" : "Green Chile Stew",
22+
"url" : "/recipes/green-chile-stew.html",
23+
"date" : "2018-08-22 21:07:33 -0500"
24+
25+
} ,
26+
27+
{
28+
29+
"title" : "Mongolian Beef",
30+
"url" : "/recipes/mongolian-beef.html",
31+
"date" : "2018-08-22 21:07:33 -0500"
32+
33+
} ,
34+
35+
{
36+
37+
"title" : "New York Strip",
38+
"url" : "/recipes/new-york-strip.html",
39+
"date" : "2018-08-22 21:07:33 -0500"
40+
41+
} ,
42+
43+
{
44+
45+
"title" : "One Minute Muffin",
46+
"url" : "/recipes/one-minute-muffin.html",
47+
"date" : "2018-08-22 21:07:33 -0500"
48+
49+
} ,
50+
51+
{
52+
53+
"title" : "Pork Steaks",
54+
"url" : "/recipes/pork-steaks.html",
55+
"date" : "2018-08-22 21:07:33 -0500"
56+
57+
} ,
58+
59+
{
60+
61+
"title" : "Red Berry Tart",
62+
"url" : "/recipes/red-berry-tart.html",
63+
"date" : "2018-08-22 21:07:33 -0500"
64+
65+
} ,
66+
67+
{
68+
69+
"title" : "Roasted Brussels Sprouts",
70+
"url" : "/recipes/roasted-brussels-sprouts.html",
71+
"date" : "2018-08-22 21:07:33 -0500"
72+
73+
} ,
74+
75+
{
76+
77+
"title" : "Roasted Okra",
78+
"url" : "/recipes/roasted-okra.html",
79+
"date" : "2018-08-22 21:07:33 -0500"
80+
81+
} ,
82+
83+
{
84+
85+
"title" : "Smashed Carrots",
86+
"url" : "/recipes/smashed-carrots.html",
87+
"date" : "2018-08-22 21:07:33 -0500"
88+
89+
} ,
90+
91+
{
92+
93+
"title" : "Stuffed Peppers",
94+
"url" : "/recipes/stuffed-peppers.html",
95+
"date" : "2018-08-22 21:07:33 -0500"
96+
97+
}
98+
99+
]

‎plugins/simple-jekyll-search.min.js

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎search.html

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!-- Html Elements for Search -->
2+
<div id="search-container">
3+
<input type="text" id="search-input" placeholder="search...">
4+
<ul id="results-container"></ul>
5+
</div>
6+
7+
<!-- Script pointing to search-script.js -->
8+
<script src="/plugins/simple-jekyll-search.min.js" type="text/javascript"></script>
9+
10+
<!-- Configuration -->
11+
<script>
12+
SimpleJekyllSearch({
13+
searchInput: document.getElementById('search-input'),
14+
resultsContainer: document.getElementById('results-container'),
15+
json: '/search.json',
16+
searchResultTemplate: '<div><a href="{url}"><h1>{title}</h1></a><span>{date}</span></div>'
17+
})
18+
</script>

‎search.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
---
3+
[
4+
{% for post in site.recipes %}
5+
{
6+
7+
"title" : "{{ post.title | escape }}",
8+
"url" : "{{ site.baseurl }}{{ post.url }}",
9+
"date" : "{{ post.date }}"
10+
11+
} {% unless forloop.last %},{% endunless %}
12+
{% endfor %}
13+
]

0 commit comments

Comments
 (0)