-| Sane file_links | {% assign valid_buckets = "exclusive_01,patanjali-yoga-sutra,function-data" | split: "," %}{% assign hostedcontent = site.content | where_exp: "c", "c.file_links.size > 0" %}{% assign fs = '' | split: '' %}{% for c in hostedcontent %}{% for l in c.file_links %}{% assign s = l | split: "/" %}{% if valid_buckets contains s[0] %}{% if s contains "blob" %}{% assign fs = fs | push: c %}{% endif %}{% else %}{% assign fs = fs | push: c %}{% endif %}{% endfor %}{% endfor %}{% if fs.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | {% assign count = hostedcontent.size | minus: fs.size %}{% if count > 0 %}There are {{ count }} sane links{% endif %}{% if fs.size > 0 %}The {{ fs.size }} pieces with bad buckets are: {% for c in fs %}[{{ c.title | split: ":" | first }}]({{ c.url }}) {% endfor %}{% endif %}
0 commit comments