-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathworkdir.liquid
More file actions
19 lines (17 loc) · 887 Bytes
/
workdir.liquid
File metadata and controls
19 lines (17 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{%- assign workdir = include.workdir | default: "/" -%}
{%- assign workdir_level = workdir | append: "temp" | replace_first: "/", "" | split: "/" | size -%}
{%- 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" | replace_first: "/", "" | split: "/" | size | minus: 1 -%}
{%- 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 -%}
{{ item.dir }}|
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- endcapture -%}
{%- assign workdir_dirs = items | split: "|" -%}