Sha256: 4a0c3e6d6d6a7d23183b62bb7944b35eafec67cf9b86a089c89072184fda2dc1

Contents?: true

Size: 1.43 KB

Versions: 2

Compression:

Stored size: 1.43 KB

Contents

{% comment %} Start from the language chapter(eg: en-US) or root(/) {% endcomment %}
{%- assign workdir = include.workdir | default: "/" -%}

{%- if page.dir != "/" -%}
    {%- assign chapter = page.dir | remove_first: "/" | split: "/" | first -%}
    {%- if chapter contains "-" -%}
        {%- capture workdir %}/{{ chapter }}/{% endcapture -%}
    {%- endif -%}
{%- endif -%}

{%- assign workdir_level = workdir | append: "temp/" | split: "/" | size | minus: 1 -%}
{%- assign workdir_files = site_files | where_exp: "item", "item.dir == workdir" -%}

{%- capture items -%}
    {%- for item in site_dirs -%}
        {%- assign current_m1 = item.dir | append: "temp/" | split: "/" | size | minus: 2 -%}
        {%- if workdir_level == current_m1 -%}
            {%- assign temp = workdir | append: "@@" -%}
            {%- assign dir = item.dir | replace: workdir, temp | split: "@@" | first -%}
            {% comment %} In the current subdirectory {% endcomment %}
            {%- if workdir == dir -%}
                {% comment %} Root directory does not display other languages {% endcomment %}
                {%- if workdir == "/" -%}
                    {%- unless item.dir contains "-" %}{{ item.dir }}|{% endunless -%}
                {%- else -%}
                    {{ item.dir }}|
                {%- endif -%}
            {%- endif -%}
        {%- endif -%}
    {%- endfor -%}
{%- endcapture -%}
{%- assign workdir_dirs = items | split: "|" -%}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jekyll-rtd-theme-1.0.1 _includes/reset/workdir.liquid
jekyll-rtd-theme-1.0.0 _includes/reset/workdir.liquid