mirror of
https://github.com/seigler/dash-docs
synced 2025-07-26 17:26:12 +00:00
Add New Glossary Page And Developer Search Feature
This commit adds the code necessary to generate a new en/developre-glossary page with entry pages in the en/glossary/ directory, e.g. en/glossary/51-percent-attack. The glossary page and the individual term pages feature a JavaScript search engine (no CGI) for just glossary terms. This search box has also been added to the following pages: * Developer Documentation (the index page) * Developer Guide * Developer Reference * Developer Examples The search box requires the following MIT-licensed libraries: * JQuery * JQuery UI * JQuery UI CSS stylesheet These allow our JS code to be almost trivially simple in js/devsearch.js This commit adds only code. Actual glossary entry data will be added in a subsequent commit.
This commit is contained in:
parent
c2bc8edff3
commit
037cd4553a
17 changed files with 609 additions and 11 deletions
31
quality-assurance/devsearch.html
Normal file
31
quality-assurance/devsearch.html
Normal file
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
# This file is licensed under the MIT License (MIT) available on
|
||||
# http://opensource.org/licenses/MIT.
|
||||
---
|
||||
<!DOCTYPE HTML>
|
||||
<head>
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
</head>
|
||||
<body>
|
||||
{% comment %}
|
||||
|
||||
NOTICE: this template is based off of /js/devsearch.js
|
||||
|
||||
Nested loops below:
|
||||
1. site.devsearches: container for all searches defined in _config.yaml in
|
||||
the arbitrary order they should appear
|
||||
2. list: a list item in devsearches; only has two elements:
|
||||
a. the name of the category
|
||||
b. an array containing the sublist items (pre-sorted)
|
||||
3. sublist: a list of the items we want to display as a one-entry hash table
|
||||
4. term: the term as the key [0] and the uri as the value [1]
|
||||
|
||||
{% endcomment %}
|
||||
|
||||
{% for list in site.devsearches %}{% for item in list %}
|
||||
{% if forloop.first %}{% capture category_name %}{{item}}{% endcapture %}
|
||||
{% else %}{% for sublist in item %}{% for term in sublist %}
|
||||
<a href="{{term[1]}}">{{term[0]}}</a>
|
||||
{% endfor %}{% unless forloop.last %},{% endunless %}{% endfor %}{% endif %}{% endfor %}{% unless forloop.last %},{% endunless %}{% endfor %}
|
||||
|
||||
</body></html>
|
Loading…
Add table
Add a link
Reference in a new issue