Skip to content

Commit 1a51f79

Browse files
committed
add work sizes to featured_content_list
1 parent f88646e commit 1a51f79

5 files changed

Lines changed: 21 additions & 10 deletions

File tree

‎_includes/content_size.html‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{% if include.content.pages or include.content.minutes %}{% unless include.content.pages contains "," %}<span class="content_size">{% if include.content.pages contains "--" %}{% assign ps = include.content.pages | split: "--" %}{{ 1 | plus: ps[1] | minus: ps[0] }} pages{% elsif include.content.minutes %}{% if include.content.minutes < 70 %}{{ include.content.minutes }} min{% else %}{{ include.content.minutes | divided_by: 60 }}h {{ include.content.minutes | modulo: 60 }}m{% endif %}{% else %}{{ include.content.pages }} page{% if include.content.pages != 1 %}s{% endif %}{% endif %}</span>{% endunless %}{% endif %}
2+

‎_includes/featured_content_list.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<a href="{{ c.url }}"><img src="https://img.youtube.com/vi/{{ c.external_url | ytid }}/0.jpg" alt="{{ c.title }} Video Thumbnail"></a>{% assign supex = true %}{% endunless %}{% endif %}
1515
{% unless supex %}<div class="content_desc">{{ c.excerpt }}</div>{% endunless %}
1616
{% endunless %}
17-
{% include content_filelinks.html content=c newtab=true %}
17+
<div class="data-row"><div class="size-info">{% include content_size.html content=c %}</div>{% include content_filelinks.html content=c newtab=true %}</div>
1818
</li>
1919
{% endfor %}
2020
</ul></div>

‎_layouts/content.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ <h2 class="author">Read by {% if reader %}<a href="{{ reader.url }}">{{ reader.t
7575
</details>
7676
</div>{% endunless %}
7777
{% include content_filelinks.html content=page %}
78-
{% if page.pages or page.minutes %}{% unless page.pages contains "," %}<span class="content_size">{% if page.pages contains "--" %}{% assign ps = page.pages | split: "--" %}{{ 1 | plus: ps[1] | minus: ps[0] }} pages{% elsif page.minutes %}{% if page.minutes < 70 %}{{ page.minutes }} min{% else %}{{ page.minutes | divided_by: 60 }}h {{ page.minutes | modulo: 60 }}m{% endif %}{% else %}{{ page.pages }} page{% if page.pages != 1 %}s{% endif %}{% endif %}</span>{% endunless %}{% endif %}
78+
{% include content_size.html content=page %}
7979
</header>
8080
<div class="post-content">
8181
{% if page.category == "av" and page.external_url contains "youtu" or page.file_links[0] %}{% unless page.external_url contains "list" %}

‎_sass/nimitta.scss‎

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -522,11 +522,6 @@ article.tag .subtopics {
522522
font-family: $ui-font-family;
523523
}
524524

525-
.featured_content_list .content_links {
526-
text-align: end;
527-
margin-top: 10px;
528-
}
529-
530525
.content_links .btn {
531526
padding: 5px 14px 8px;
532527
}
@@ -547,7 +542,7 @@ div.featured_content_list {
547542

548543
li {
549544
width: 47%;
550-
padding: 17px;
545+
padding: 17px 17px 7px;
551546
margin: 5px;
552547
border: 1px solid lightgray;
553548
border-radius: 9px;
@@ -586,8 +581,22 @@ div.featured_content_list {
586581
color: $grey-color-dark;
587582
}
588583

584+
.data-row {
585+
display: flex;
586+
flex-direction: row;
587+
place-content: space-between;
588+
.size-info {
589+
place-self: center;
590+
padding-left: 15px;
591+
}
592+
}
593+
589594
.content_links {
590-
margin-top: 8px;
595+
text-align: end;
596+
margin-top: 10px;
597+
a.btn {
598+
margin-bottom: 10px;
599+
}
591600
}
592601
}
593602

‎_tests/content.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A series of tests checking the integrity of the _content data
1212
| External URLs are Unique | {% assign ac = site.content | where_exp: "c", "c.external_url" %}{% assign seen = "" | split: "" %}{% assign dupes = "" | split: "" %}{% for c in ac %}{% if seen contains c.external_url %}{% unless dupes contains c.external_url %}{% assign dupes = dupes | push: c.external_url %}{% endunless %}{% else %}{% assign seen = seen | push: c.external_url %}{% endif %}{% endfor %}{% if dupes.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | {% if dupes.size > 0 %}Found these duplicate URLs: `{{ dupes | join: " " }}`{% else %}No duplicate URLs found.{% endif %}
1313
| Drive Links are Unique | {% assign ac = site.content | where_exp: "c", "c.drive_links" %}{% assign seen = "" | split: "" %}{% assign dupes = "" | split: "" %}{% for c in ac %}{% for d in c.drive_links %}{% if seen contains d %}{% unless dupes contains d %}{% assign dupes = dupes | push: d %}{% endunless %}{% else %}{% assign seen = seen | push: d %}{% endif %}{% endfor %}{% endfor %}{% if dupes.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | {% if dupes.size > 0 %}Found these duplicate links: `{{ dupes | join: " " }}`{% else %}No duplicate links found.{% endif %}
1414
| Course in tags | {% assign failures = site.content | where_exp: "c", "c.tags contains c.course" %}{% if failures.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | There are {{ failures.size }} pieces with the course in the tags{% if failures.size > 0 %}: {{ failures | map: "slug" | array_to_sentence_string }}{% endif %}.
15-
| Sane file_links | {% assign valid_buckets = "exclusive_01" | 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: "/" %}{% unless valid_buckets contains s[0] %}{% assign fs = fs | push: c %}{% endunless %}{% 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 %}
15+
| Sane file_links | {% assign valid_buckets = "exclusive_01" | 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 %}
1616
| file_links match formats | {% assign fs = '' | split: '' %}{% for c in hostedcontent %}{% for l in c.file_links %}{% assign ee = l | split: "." | last %}{% unless ee == c.formats[forloop.index0] %}{% assign fs = fs | push: c %}{% endunless %}{% endfor %}{% endfor %}{% if fs.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | {% assign count = hostedcontent.size | minus: fs.size %}{% if count > 0 %}There are {{ count }} sane formats.{% endif %}{% if fs.size > 0 %} The {{ fs.size }} pieces with bad formats are: {% for c in fs %}[{{ c.title | split: ":" | first }}]({{ c.url }}) {% endfor %}{% endif %}
1717
| Negative Pages | {% assign fails = '' | split: '' %}{% for cont in site.content %}{% unless cont.pages %}{% continue %}{% endunless %}{% if cont.pages contains "--" %}{% assign ps = cont.pages | split: "--" %}{% assign ps = 1 | plus: ps[1] | minus: ps[0] %}{% if ps < 1 %}{% assign fails = fails | push: cont %}{% endif %}{% else %}{% if cont.pages < 1 %}{% assign fails = fails | push: cont %}{% endif %}{% endif %}{% endfor %}{% if fails.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | Found {{ fails.size }} with negative pages{% if fails.size > 0 %}: {{ fails | map: "path" | array_to_sentence_string }}{% endif %}
1818
| Missing Author Pages | {% assign expect = '' | split: '' %}{% for cont in site.content %}{% for auth in cont.authors %}{% unless auth contains " " %}{% unless expect contains auth %}{% assign expect = expect | push: auth %}{% endunless %}{% endunless %}{% endfor %}{% endfor %}{% assign grouped = expect | group_by_exp: "auth", "site.authors | where: 'slug', auth | size" %}{% for group in grouped %}{% if group.name == 0 %}{% assign failed = group.items %}{% else %}{% assign found = group.items %}{% endif %}{% endfor %}{% if expect.size == found.size %}Pass ✅{% else %}FAIL ❌{% endif %} | Of the {{ expect.size }} authors cited, {{ found.size }} of them are in the database. {% if failed.size > 0 %}Failed to find author pages for: {{ failed | array_to_sentence_string }}{% endif %}

0 commit comments

Comments
 (0)