CloudCannon / bakery-store-jekyll-template

:bread: Template used on CloudCannon Academy screencasts
81 stars 186 forks source link

How do i add a site.baseurl in the hyperlinking for search section #2

Closed IamManchanda closed 7 years ago

IamManchanda commented 7 years ago

In the lunrjs tutorial ( Episode #20 ),

i am unable to use {{ site.baseurl }} for the links within the search results as its a js file and not html . Just wanna know, is there any way to do the same ?

Special note: I am trying to implement the same on the creative bootstrap project. ( Episode #29 ) Here is my code and issue --> Line no 10 Line no 10

As i cant add {{ site.baseurl }} in the js file, so how do i implement it

mneumegen commented 7 years ago

Hi @IamManchanda ,

If you add empty front matter to the top of the file like this:

---
---

You can use liquid variables inside your JS file

IamManchanda commented 7 years ago

Thanks a lot buddy .. it worked !

Thanks for quick help @mneumegen Closing the issue now.