More work on docs

This commit is contained in:
Zachary Klosko 2020-11-23 13:58:55 -05:00
parent adf8d351f5
commit 68357864b1
11 changed files with 131 additions and 164 deletions

View file

@ -41,36 +41,4 @@
scrollToTop();
}
</script>
<!-- Algolia Search -->
<script>
const search = instantsearch({
appId: 'latency',
apiKey: '6be0576ff61c053d5f9a3225e2a90f76',
indexName: 'instant_search',
routing: true
});
search.start();
</script>
<script>
const search = instantsearch(options);
// initialize SearchBox
search.addWidget(
instantsearch.widgets.searchBox({
container: '#search-searchbox',
placeholder: 'Search the docs'
})
);
// initialize hits widget
search.addWidget(
instantsearch.widgets.hits({
container: '#hits'
})
);
search.start();
</script>

View file

@ -12,11 +12,11 @@ var documents = [{% for page in site.pages %}{% if page.url contains '.xml' or p
"url": "{{ site.url }}{{ page.url }}",
"title": "{{ page.title }}",
"body": "{{ page.content | markdownify | replace: '.', '. ' | replace: '</h2>', ': ' | replace: '</h3>', ': ' | replace: '</h4>', ': ' | replace: '</p>', ' ' | strip_html | strip_newlines | replace: ' ', ' ' | replace: '"', ' ' }}"{% assign counter = counter | plus: 1 %}
}, {% endfor %}{% for page in site.docs %}{
}, {% endfor %}{% for doc in site.docs %}{
"id": {{ counter }},
"url": "{{ site.url }}{{ page.url }}",
"title": "{{ page.title }}",
"body": "{{ page.content | markdownify | replace: '.', '. ' | replace: '</h2>', ': ' | replace: '</h3>', ': ' | replace: '</h4>', ': ' | replace: '</p>', ' ' | strip_html | strip_newlines | replace: ' ', ' ' | replace: '"', ' ' }}"{% assign counter = counter | plus: 1 %}
"url": "{{ site.url }}{{ doc.url }}",
"title": "{{ doc.title }}",
"body": "{{ doc.content | markdownify | replace: '.', '. ' | replace: '</h2>', ': ' | replace: '</h3>', ': ' | replace: '</h4>', ': ' | replace: '</p>', ' ' | strip_html | strip_newlines | replace: ' ', ' ' | replace: '"', ' ' }}"{% assign counter = counter | plus: 1 %}
}{% if forloop.last %}{% else %}, {% endif %}{% endfor %}];
var idx = lunr(function () {