Skip to content

Commit 4f17730

Browse files
committed
Add a search option
Will be useful later for the (static) blog and wiki based on https://chodounsky.com/2015/05/14/full-text-search-on-static-website/
1 parent bf14156 commit 4f17730

39 files changed

+259
-35
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ Included are the following 3rd party software:
8383
* Magnific Popup - http://dimsemenov.com/plugins/magnific-popup/ -
8484
Copyright (c) 2014-2016 Dmitry Semenov, provided under the MIT license
8585

86+
* lunr - https://lunrjs.com - Copyright (c) 2013 by Oliver Nightingale,
87+
provided under the MIT license
88+
8689
* Favicons have been processed by https://realfavicongenerator.net
8790

8891
* IRC contact page is provided by https://kiwiirc.com

Rules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ compile '/**/*.scss' do
1919
write item.identifier.without_ext + '.css'
2020
end
2121

22-
compile '/sitemap.xml' do
22+
compile '/{sitemap.xml,js/search-index.js}' do
2323
filter :erb
24-
write '/sitemap.xml'
24+
write item.identifier
2525
end
2626

2727
compile '/htaccess.txt' do

content/about/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: About EasyRPG
33
priority: 0.8
4-
menu_weight: 5
4+
menu_weight: 10
55
---
66
<div class="info" markdown="1">
77

content/about/website.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ title: About the EasyRPG Homepage
3030

3131
- Nanoc static site generator - <https://nanoc.app>
3232
- kramdown markdown superset converter - <https://kramdown.gettalong.org/>
33-
- Sass <https://sass-lang.com>
33+
- Sass - <https://sass-lang.com>
34+
- lunr client search engine - <https://lunrjs.com>
3435

3536
### 3rd party software
3637

@@ -40,6 +41,8 @@ Included are the following 3rd party software:
4041
contributors, provided under the MIT license
4142
- Magnific Popup - <https://dimsemenov.com/plugins/magnific-popup/>
4243
\- Copyright © 2014-2016 Dmitry Semenov, provided under the MIT license
44+
- lunr - Copyright © 2013 by Oliver Nightingale, provided under the
45+
MIT license
4346
- Favicons have been processed by <https://realfavicongenerator.net>
4447
- IRC contact page is provided by <https://kiwiirc.com>
4548

content/contribute/artists.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: How to Contribute
2+
title: "How to Contribute: Artists"
33
menu_weight: 3
44
---
55
<div class="info" markdown="1">

content/contribute/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: How to Contribute
2+
title: "How to Contribute: Introduction"
33
priority: 0.8
4-
menu_weight: 0
4+
menu_weight: 1
55
---
66
<div class="info" markdown="1">
77

content/contribute/programmers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: How to Contribute
2+
title: "How to Contribute: Programmers"
33
menu_weight: 4
44
---
55
<div class="info" markdown="1">

content/contribute/testers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: How to Contribute
2+
title: "How to Contribute: Testers"
33
menu_weight: 2
44
---
55
<div class="info" markdown="1">

content/contribute/translators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: How to Contribute
2+
title: "How to Contribute: Translators"
33
menu_weight: 1
44
---
55
<div class="info" markdown="1">

content/css/easyrpg.scss

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,53 @@ $darkgrey: #202020;
245245
}
246246
}
247247

248+
/* Search box and results */
249+
form#search-form {
250+
margin: 1em 0;
251+
252+
input {
253+
border: 2px solid $normalgreen;
254+
margin: 4px 2px;
255+
padding: 10px 12px;
256+
border-radius: 5px;
257+
}
258+
input[type=text] {
259+
border-collapse: collapse;
260+
width: 300px;
261+
}
262+
input[type=submit] {
263+
background-color: $lightgrey;
264+
color: black;
265+
cursor: pointer;
266+
}
267+
}
268+
ul#search-results {
269+
// entry height
270+
$eheight: 32px;
271+
272+
margin-top: -1px;
273+
margin-bottom: 0;
274+
padding: 0 0.5em;
275+
276+
li {
277+
display: inline-block;
278+
line-height: $eheight;
279+
vertical-align: middle;
280+
white-space: nowrap;
281+
282+
a {
283+
display: inline-block;
284+
height: $eheight;
285+
padding: 0 1em;
286+
text-decoration: none;
287+
288+
&:hover {
289+
color: $normalgreen;
290+
}
291+
}
292+
}
293+
}
294+
248295
/* Footer */
249296
#footer {
250297
font-size: 11px;

0 commit comments

Comments
 (0)