Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Adding images #30

Closed
NickSarath opened this issue Mar 27, 2015 · 2 comments
Closed

Adding images #30

NickSarath opened this issue Mar 27, 2015 · 2 comments

Comments

@NickSarath
Copy link

How does one add an image next to the text returns?

for example:

I search "Apple"

And I get the result apple and next to it an image.

@daviddarnes
Copy link
Contributor

You would have to add an image path to the post or page front matter.

Maybe have the following in your post (or page):

---
thumbnail: "/images/post-thumbnail.jpg"
---

You'll need to add thumbnail into the json file that the plugin searches through.

"thumbnail" : "{{ post.thumbnail }}",

Then change the result template to include an image:

<li>
     <a href="{url}">{title}</a>
     <a href="{url}">
          <img src="{thumbnail}"/>
     </a>
</li>

@christian-fei
Copy link
Owner

Thanks @daviddarnes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants