localsearch with Bootstrap3 theme

30 views
Skip to first unread message

J C

unread,
May 21, 2018, 7:00:40 AM5/21/18
to nikola-discuss
Hi,

I'm trying to get localsearch to work on my site. I'm trying to use localsearch with modal instead of another page.

I seem to be having issues with the BODY_END section.

First paste, it looks like it is missing the last """, I have added that in but then 'var siteUrl = """ + json.dumps(SITE_URL) + """ ' doesn't like to play well.
I've tried 'var siteUrl = "\"" + json.dumps(SITE_URL) + "\"" ' but SITE_URL doesn't seem to pick up the configure variable SITE_URL.

So, what am I missing?

Thanks.

JC.

Chris Warrick

unread,
May 21, 2018, 7:30:48 AM5/21/18
to Nikola—Discuss
You seem to be using the alternate (older) config. We recommend using the
new config (and search.html page) instead. The older config was missing """
at the very end, but everything else is fine — json.dumps adds it own
quotes already.


--
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16

J C

unread,
May 22, 2018, 12:27:02 AM5/22/18
to nikola-discuss
Okay, I've tried using the new config.

Need help with 2 things.

1) The SEARCH_FORM references "/search/", where do I put the search.html file? If I put it at root, "nikola build" doesn't pick it up. I put it in /pages/search/ and update SEARCH_FROM to "/pages/search.", it works, but is it supposed to work that way?

2) The search is somewhat hit and miss, how does it index? And I realized that sometimes, it manages to find the link, it shows up shortly and then it kind of self-refreshes and the search result is gone. Has it got to do with the browser cache?

Thanks.

Cheers, JC.

J C

unread,
May 22, 2018, 12:35:22 AM5/22/18
to nikola-discuss
One more thing, once I do a search, when it refreshes the result page, the search box has the search term with a "/" appended to it, is it normal?

Chris Warrick

unread,
May 22, 2018, 7:47:12 AM5/22/18
to Nikola—Discuss
On Tue, 22 May 2018 at 06:27, J C <9tr...@gmail.com> wrote:

> Okay, I've tried using the new config.

> Need help with 2 things.

> 1) The SEARCH_FORM references "/search/", where do I put the search.html
file? If I put it at root, "nikola build" doesn't pick it up. I put it in
/pages/search/ and update SEARCH_FROM to "/pages/search.", it works, but is
it supposed to work that way?

You can set SEARCH_FORM to "/pages/search". You can also change PAGES to
put pages in the root instead of /pages/.

> 2) The search is somewhat hit and miss, how does it index? And I realized
that sometimes, it manages to find the link, it shows up shortly and then
it kind of self-refreshes and the search result is gone. Has it got to do
with the browser cache?

Hard to tell without details, but sounds like it’s this:

On Tue, 22 May 2018 at 06:35, J C <9tr...@gmail.com> wrote:
> One more thing, once I do a search, when it refreshes the result page,
the search box has the search term with a "/" appended to it, is it normal?

It’s a glitch in `nikola serve`. Fixed in the v8 series and wouldn’t occur
with a real web server.

https://github.com/getnikola/nikola/issues/3000

J C

unread,
May 22, 2018, 11:54:41 AM5/22/18
to nikola-discuss
Ah... I see, thanks Chris. I was just getting my testing done properly before deploying into production. So it does look like I’m all set. Most if not all of the kinks have been ironed out.
Reply all
Reply to author
Forward
0 new messages