# Instant search - description not showing

**URL:** <https://talk.jekyllrb.com/t/instant-search-description-not-showing/3227>\
**Category:** Uncategorized\
**Created:** [August 22, 2019, 12:09am UTC](https://talk.jekyllrb.com/t/instant-search-description-not-showing/3227 "2019-08-22T00:09:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![menister](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@menister](https://talk.jekyllrb.com/u/menister)\
**Post date:** [August 22, 2019, 12:09am UTC](https://talk.jekyllrb.com/t/instant-search-description-not-showing/3227/1 "2019-08-22T00:09:39Z")

</div>

Hello everyone,

I recently started using jekyll to build a little Documentation/Knowledge Base website.

I found [this](https://github.com/CloudCannon/base-jekyll-template) 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](https://www.supertechcrew.com/instant-search-box-jekyll/) 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.

 ![Screenshot_37](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/a/a8df3547598ab407d08e31a755578fa4ca6f4843.png)

Here is the Javascript part I am using in the `default.html`:

```javascript
      <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:

```auto
---

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!

---

<div class="post-metadata">

**Author:** ![mmistakes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/mmistakes/32/2169_2.png) [@mmistakes](https://talk.jekyllrb.com/u/mmistakes)\
**Post date:** [August 22, 2019, 1:01am UTC](https://talk.jekyllrb.com/t/instant-search-description-not-showing/3227/2 "2019-08-22T01:01:02Z")

</div>

From the tutorial above the, in the `search.json` template there is this line:

```auto
"desc" : "{{ post.excerpt | markdownify | strip_html | strip_newlines | escape_once }}"

```

What it’s doing is taking a post’s excerpt, applying some filters to remove HTML and such and assigns it `{desc}` which the script above is using as your search text.

[Jekyll automatically creates excerpts](https://jekyllrb.com/docs/posts/#post-excerpts) for you taking the first paragraph of text from a post’s body content. What you can do is define that yourself with YAML Front Matter, something like:

```auto
excerpt: "Your custom excerpt text here."

```

Seeing as you’re doing that, but with the `description` variable you could rename it… which may break other things in your theme so you’ll need find/replace anywhere that’s used.

Or you can use [YAML reference/anchors](https://yaml.org/spec/1.2/spec.html#id2760395) like this to keep things DRY so you don’t have to repeat the text in front matter.

```auto
description: &excerpt "Deploy your Jekyll site to Azure"
excerpt: *excerpt

```

Or you could just repeat the text

```auto
description: "Deploy your Jekyll site to Azure"
excerpt: "Deploy your Jekyll site to Azure"

```

---

<div class="post-metadata">

**Author:** ![menister](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@menister](https://talk.jekyllrb.com/u/menister)\
**Post date:** [August 22, 2019, 1:07am UTC](https://talk.jekyllrb.com/t/instant-search-description-not-showing/3227/3 "2019-08-22T01:07:13Z")

</div>

You are my hero!

Thank you very much!!!
