Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localsearch non root context #243

Merged
merged 4 commits into from Jul 27, 2017

Conversation

@uli-heller
Copy link
Contributor

uli-heller commented Jul 26, 2017

Fixes #242.

Please note: I reordered conf.py.sample to match the ordering within conf.py. This is not required for #242.

Related to #242: It is important to prepend the SITE_URL when loading via javascript. My python skills
are very low. I didn't succeed in adding a .format() to the complete BODY_END, maybe since there are
extra brackets within the string. So I splitted BODY_END into parts and used format() only on the middle
part.

uli-heller added 2 commits Jul 26, 2017
... to match the order of conf.py: SEARCH_FORM -> EXTRA_HEAD_DATA -> BODY_END
@@ -28,17 +32,22 @@ BODY_END = """
</div>
</div>
<script>
"""
BODY_END += """

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Jul 26, 2017

Member

Do it in one assignment, using string concatenation instead. Also, use json.dumps() to escape the URL properly (adds quotes).

@uli-heller

This comment has been minimized.

Copy link
Contributor Author

uli-heller commented Jul 27, 2017

@Kwpolska

This comment has been minimized.

Copy link
Member

Kwpolska commented Jul 27, 2017

Put import json at the top of your conf.py.sample file, and then use:

var siteUrl = """ + json.dumps(SITE_URL) + """

(note the removed single quotes)

@uli-heller

This comment has been minimized.

Copy link
Contributor Author

uli-heller commented Jul 27, 2017

@Kwpolska Kwpolska merged commit e71ff03 into getnikola:master Jul 27, 2017
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
@Kwpolska

This comment has been minimized.

Copy link
Member

Kwpolska commented Jul 27, 2017

Thanks for fixing this!

@uli-heller

This comment has been minimized.

Copy link
Contributor Author

uli-heller commented Jul 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.