Sha256: 583ef260a6472eccd485e044cf8191789c56af4798c408702569adcd0a00b97f

Contents?: true

Size: 1.94 KB

Versions: 3

Compression:

Stored size: 1.94 KB

Contents

{%- include reset/workdir.liquid %}

{% comment %} display the directory name {% endcomment %}
{%- assign dir = site_pages | where: "url", workdir | first -%}
{%- if site_lang != lang -%}
    {% comment %} current in language directory (level-1) {% endcomment %}
    {%- assign workdir_level = workdir_level | minus: 1 -%}
{%- endif -%}
{%- if workdir_level == 2 %}
    {% comment %} display the root sub-directory as "p.caption" {% endcomment %}
    <p class="caption"><span class="caption-text">{{ dir.title | default: dir.url }}</span></p>
{%- else %}
    <a class="reference internal" href="{{ dir.url | relative_url }}">{{ dir.title | default: dir.url }}</a>
{%- endif -%}

<ul>
    {% comment %} list file {% endcomment %}
    {%- for item in workdir_files -%}
        {%- assign level = item.dir | append: "temp" | replace_first: "/", "" | split: "/" | size | minus: 1 -%}
        {%- capture current -%}
            {%- if page.url == item.url %}current{% endif -%}
        {%- endcapture %}
        {%- if site_lang != lang -%}
            {%- assign level = level | minus: 1 -%}
        {%- endif -%}

        <li class="toctree-l{{ level }} {{ current }}">
            <a class="reference internal {{ current }}" href="{{ item.url | relative_url }}">
                {%- if item.sort and site.show_sorted != false -%}
                    {{ item.sort }}. {{ item.title | default: item.url }}
                {%- else -%}
                    {{ item.title | default: item.url }}
                {%- endif -%}
            </a>
        </li>
    {%- endfor -%}

    {% comment %} list dirs {% endcomment %}
    {%- for workdir in workdir_dirs -%}
        {%- assign level = workdir | append: "temp" | replace_first: "/", "" | split: "/" | size | minus: 2 %}
        {%- if site_lang != lang -%}
            {%- assign level = level | minus: 1 -%}
        {%- endif -%}
        <li class="toctree-l{{ level }}">{% include extend/toctree.liquid %}</li>
    {%- endfor -%}
</ul>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jekyll-rtd-theme-1.1.3 _includes/extend/toctree.liquid
jekyll-rtd-theme-1.1.2 _includes/extend/toctree.liquid
jekyll-rtd-theme-1.1.1 _includes/extend/toctree.liquid