Hello everyone,
I recently started using jekyll to build a little Documentation/Knowledge Base website.
I found this theme which fits my needs and started working with it.
Since the search wasnt live I tried to find a good alternative and found this tutorial. So far its working good, the only issue I have is that the search isnt showing the description, instead it shows the first paragraph of an article.
Here is the Javascript part I am using in the default.html
:
<script type="text/javascript">
SimpleJekyllSearch.init({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('results-container'),
dataSource: '/search.json',
searchResultTemplate: '<a href="{url}" title="{desc}"><div class="search-result"><h3>{title}<\/h3><div class="search-result-text">{desc}<\/div><\/div><\/a>',
noResultsText: 'No results found',
limit: 10,
fuzzy: true,
})
</script>
And here is the front matter and first paragraph of the article:
---
date: 2017-01-16
title: Azure
categories:
- deployment
description: "Deploy your Jekyll site to Azure"
type: Document
---
Jekyll is a simple, blog-aware, static site generator. It takes a template directory containing raw text files in various formats, runs it through a converter (like Markdown) and our Liquid renderer, and spits out a complete, ready-to-publish static website suitable for serving with your favorite web server.
If you already have a full Ruby development environment with all headers and RubyGems installed, you can create a new Jekyll site by doing the following:
I hope you guys can help me out why the search isnt showing the description.
Thanks!