Public Repository

Last pushed: a year ago
Short Description
ARMHF Bleve for Hugo
Full Description

ARMHF Bleve for Hugo

Built on hypriot/rpi-golang

Build the index

docker run --rm -it -v <path to Hugo site>:/hugo mrraph/armhf-bleve-hugo hugoidx

Run the search daemon

docker run -itd --name=hugo-bleve -p 8080:8080 \ --restart=always \ -v <path to Hugo site>:/hugo \ mrraph/armhf-bleve-hugo

Let's configure Hugo

cd <path to Hugo site>
docker cp hugo-bleve:/gopath1.5/src/github.com/blevesearch/hugoidx/search.md content/
mkdir -p static/js/
docker cp hugo-bleve:/gopath1.5/src/github.com/blevesearch/hugoidx/handlebars.js static/js/
docker cp hugo-bleve:/gopath1.5/src/github.com/blevesearch/hugoidx/search.js static/js/
docker cp hugo-bleve:/gopath1.5/src/github.com/blevesearch/hugoidx/jquery.min.js static/js/
wget -O ./static/js/jquery.min.js http://code.jquery.com/jquery-2.2.2.min.js

Edit layouts/partial/footer.html or themes/<your theme>/layouts/partials/footer.html

<script src="/js/jquery.min.js"></script>
<script src="/js/handlebars.js"></script>
<script src="/js/search.js"></script>

Edit static/js/search.js

On line 2, change :
var searchURL = 'http://wikisearch.blevesearch.com:8080/api/search.bleve/_search'

To match your Bleve search URL.

Add the search field in your site

Add the following code where you want to have the search filed in you site's template.

<div class="dropdown pull-right"> <form class="navbar-form" role="search" action="/search"> <div class="input-group"> <input type="text" class="form-control" placeholder="Search" name="q" id="srch-term"> <div class="input-group-btn"> <button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button> </div> </div> </form> </div>

Docker Pull Command
Owner
mrraph

Comments (0)