site/_includes/docs_option.html (9 lines of code) (raw):
{% assign items = include.items %}
{% for item in items %}
{% assign item_url = item | prepend:"/docs/" | append:".html" %}
{% for p in site.docs %}
{% if p.url == item_url %}
<option value="{{ site.url }}{{ p.url }}">{{ p.title }}</option>
{% endif %}
{% endfor %}
{% endfor %}