-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Will be useful later for the (static) blog and wiki based on https://chodounsky.com/2015/05/14/full-text-search-on-static-website/
- Loading branch information
1 parent
bf14156
commit 4f17730
Showing
39 changed files
with
259 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: About EasyRPG | ||
priority: 0.8 | ||
menu_weight: 5 | ||
menu_weight: 10 | ||
--- | ||
<div class="info" markdown="1"> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: EasyRPG Editor | ||
title: "EasyRPG Editor: Downloads" | ||
menu_weight: 2 | ||
--- | ||
<div class="info" markdown="1"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: EasyRPG Editor | ||
title: "EasyRPG Editor: Media" | ||
menu_weight: 1 | ||
--- | ||
<div class="info" markdown="1"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: EasyRPG Editor | ||
title: "EasyRPG Editor: Progress" | ||
menu_weight: 3 | ||
--- | ||
<div class="info" markdown="1"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
has_spotlight: true | ||
title: EasyRPG Homepage | ||
--- | ||
<div id="spotlight"> | ||
<div class="maxwidth"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
var pages = <%= make_search_index %> | ||
|
||
document.addEventListener("DOMContentLoaded", function(event) { | ||
var input = document.getElementById("search-input") | ||
var form = document.getElementById("search-form") | ||
var resultsContainer = document.getElementById("search-results") | ||
var resultsHeading = document.getElementById("search-heading") | ||
|
||
var searchIndex = lunr(function () { | ||
this.field('title', { boost: 4 }) | ||
this.field('tags', { boost: 2 }) | ||
this.field('body') | ||
this.ref('id') | ||
// add all pages to search | ||
pages.forEach(function(page) { this.add(page) }, this) | ||
}) | ||
|
||
var clearResults = function() { | ||
resultsContainer.innerHTML = "" | ||
resultsHeading.innerHTML = "" | ||
} | ||
|
||
var search = function(query) { | ||
clearResults(); | ||
|
||
// find | ||
results = searchIndex.search(query).map(function(id) { | ||
for (var i = 0; i < pages.length; i++) { | ||
if (pages[i].id === id.ref) | ||
return pages[i] | ||
} | ||
}) | ||
|
||
// render | ||
resultsHeading.innerHTML = results.length + " results found:" | ||
results.forEach(function(result) { | ||
var li = document.createElement("li") | ||
var a = document.createElement("a") | ||
a.href = result.id | ||
a.innerHTML = result.title | ||
li.appendChild(a) | ||
resultsContainer.appendChild(li) | ||
}) | ||
} | ||
|
||
var searchQueryFromUrl = function() { | ||
var q; | ||
location.search.substr(1).split("&").forEach(function(item) { | ||
if (item[0] === "q") | ||
q = decodeURIComponent(item.substring(2)) | ||
}) | ||
return q; | ||
} | ||
|
||
form.addEventListener("submit", function(e) { | ||
var v = input.value | ||
history.pushState({ q: v }, "", "?q=" + encodeURIComponent(v)) | ||
search(v) | ||
e.preventDefault() | ||
}) | ||
|
||
window.onpopstate = function(event) { | ||
if (event.state !== null) { | ||
input.value = event.state.q | ||
search(input.value) | ||
} else { | ||
// clear | ||
input.value = "" | ||
clearResults() | ||
} | ||
} | ||
|
||
if (searchQueryFromUrl() !== undefined) { | ||
input.value = searchQueryFromUrl() | ||
search(input.value) | ||
} | ||
}) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: "EasyRPG Player" | ||
title: "EasyRPG Player: Guide" | ||
menu_weight: 1 | ||
--- | ||
<div class="info" markdown="1"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: "EasyRPG Player" | ||
title: "EasyRPG Player: Guide game translation" | ||
--- | ||
|
||
<div class="info" markdown="1"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: "EasyRPG Player" | ||
title: "EasyRPG Player: Guide webplayer" | ||
--- | ||
|
||
<div class="info" markdown="1"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: EasyRPG Player | ||
title: "EasyRPG Player: Media" | ||
menu_weight: 2 | ||
--- | ||
<div class="info" markdown="1"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: EasyRPG Player | ||
title: "EasyRPG Player: Progress" | ||
menu_weight: 4 | ||
--- | ||
<div class="info" markdown="1"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: RTP Replacement | ||
title: "RTP Replacement: Media" | ||
menu_weight: 1 | ||
--- | ||
<div class="info" markdown=1> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
title: Search on this site | ||
menu_name: 🔍 Site search | ||
menu_weight: -1 | ||
--- | ||
<form action="/search/" id="search-form" class="search" method="get" > | ||
<input name="q" type="text" id="search-input" placeholder="enter search term..." autofocus required> | ||
<input type="submit" value="Search"> | ||
</form> | ||
<h2 id="search-heading"></h2> | ||
<ul id="search-results"></ul> | ||
<script src="/js/vendor/lunr.min.js"></script> | ||
<script src="/js/search-index.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: EasyRPG Tools | ||
title: "EasyRPG Tools: Downloads" | ||
menu_weight: 2 | ||
--- | ||
<div class="info" markdown="1"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: EasyRPG Tools | ||
title: "EasyRPG Tools: Media" | ||
menu_weight: 1 | ||
--- | ||
<div class="info" markdown=1> | ||
|
Oops, something went wrong.