Github user dblotsky commented on a diff in the pull request:
https://github.com/apache/cordova-docs/pull/581#discussion_r60313932
--- Diff: www/_layouts/base.html ---
@@ -3,12 +3,27 @@
---
<!DOCTYPE html>
-<html lang="{% if page.language %}{{ page.language }}{% else %}{{
site.language }}{% endif %}">
+{% if page.language %}
+ {% assign language = page.language %}
+{% else %}
+ {% assign language = site.language %}
+{% endif %}
+
+<html lang="{{ language }}">
{% include head.html %}
<body>
{{ content }}
{% include analytics.html %}
<script defer type="text/javascript" src="{{ site.baseurl
}}/static/js/index.js"></script>
<script defer type="text/javascript" src="{{ site.baseurl
}}/static/js/twitter.js"></script>
+ <script type="text/javascript"
src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script>
+ <script type="text/javascript">
+ docsearch({
+ apiKey: '0a916ab198bd93d031aa70611271e42e',
+ indexName: 'cordova',
+ inputSelector: '#header-search-field',
+ algoliaOptions: { 'facetFilters': [
"version:6.x","language: {{ language }}" ] }
--- End diff --
Please use `page.version` for the version here, defaulting to
`site.latest_docs_version`. Also, it is more readable to use the full logic
from line 6. The duplication is ok, since it decouples the code at the top from
this code.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]