Closed hygorxaraujo closed 5 years ago
search_form
is already available in the global context, don’t add it to GLOBAL_CONTEXT manually.
Ok, thank you for your reply. I got to this configuration by following a sample conf.py (probably outdated). My real problem is that after setting SEARCH_FORM in conf.py the search form is not showing in my theme. Tried with themes zen and zen-forkawesome.
Which conf.py was it?
SEARCH_FORM
needs to be used by the theme. The zen themes might not include it in the default configuration, if that’s the case, you’ll need to manually add ${search_form}
in the template in the place where you want it to appear.
Sorry, can't find or remember where I saw the conf.py.
From this https://github.com/getnikola/nikola-themes/blob/69deab1c6b2b76c154f9e17fb7ac731a7208e51a/v8/zen/templates/base_header.tmpl#L9 it seems that the search form is used by zen. If I move that piece of code to before ${header.html_navigation_links()}
in base.tmpl, the search form is shown, although not properly.
https://github.com/getnikola/nikola-themes/blob/69deab1c6b2b76c154f9e17fb7ac731a7208e51a/v8/zen/templates/base.tmpl#L24
Yeah, that’s a bug. The function you’re seeing is not used anywhere. I’ll fix this.
To make the search_form look nice, you will need custom CSS. If you find something that looks good, feel free to contribute this to the zen
theme itself.
When I try to configure the search form in
conf.py
I get the following error:The setup: