jekyll-lunr-js-search
jekyll-lunr-js-search copied to clipboard
baseurl not honored in Mustache url variable
When setting a baseurl in _config.yml, the links that the Mustache template produces don't contain the baseurl prefix, and so fail. I think the url variable should contain the full url to the post or page, otherwise one would need to hardcode it in the Mustache template. I'm not sure if I'm missing something.
@jgabrielygalan with https://github.com/slashdotdash/jekyll-lunr-js-search/pull/42 base_url comes with the entry so you can do a {{baseurl}} on your mustache template. cheers!
Thanks for your answer, I got it working. That looks like a workaround, though, cause if you setup a baseurl you'll want it in the href, and it would seem nicer to use a single mustache variable, instead of always having to have:
{{baseurl}}{{url}}
Anyway, I'll write the template like that, cause it works.
Thanks.
Yeap, I thought about that. But there are cases where you don't need the baseurl. In my case was the integration with angularJS where baseurl would mess up with the routing.
Cheers!
So, there are two use cases: one in which you always want the baseurl cause you need regular links, and one special one where the links need not have the baseurl for a specific case. Would you be opposed to having two mustache variables, one for each use case? Something like full_url and relative_url or such? I can provide the patch if needed, implementation is quite simple.
I cannot see this anywhere in my installation (used gem to install). How can I add this?