Skip to content

Commit 39c6b71

Browse files
first go at a page of crosswords grouped by author
1 parent 8fff418 commit 39c6b71

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

_layouts/byauthor.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
layout: default
3+
---
4+
5+
<div class="page-container">
6+
7+
<div class="page-title">
8+
<div class="page-inner-container">
9+
<h1 class="page-heading">FT Crosswords</h1>
10+
11+
<div class="page-subheading">
12+
Welcome to our new, experimental crosswords, which can be filled in on-line.
13+
</div>
14+
</div>
15+
</div>
16+
17+
{% assign dynamic-posts = site.posts | where: "type", 'dynamic' %}
18+
{% assign dynamic-posts-grouped = dynamic-posts | group_by: 'author' | sort: 'name' %}
19+
{% for author-group in dynamic-posts-grouped %}
20+
{% assign dynamic-posts = author-group.items %}
21+
22+
<div class="crossword-list-container page-inner-container">
23+
<div class="crossword-list">
24+
<div class="o-teaser-collection">
25+
<h2 class="o-teaser-collection__heading">Crosswords by {{ author-group.name }}</h2>
26+
<div class="o-grid-container no-padding">
27+
<div class="o-grid-row">
28+
{% for post in dynamic-posts limit:9 %}
29+
{% comment %} make a persistent mapping from each post's crossword-id to a panel image {% endcomment %}
30+
{% assign handle = post.crossword-id | default: "001" %}
31+
{% assign img-index = handle | split: " " | last | split: "," | last | to_integer | modulo:9 %}
32+
{% assign panel = "assets/imgs/panel" | append: img-index | append: ".png" %}
33+
{% assign panel-class = "crossword-panel-" | append: img-index %}
34+
<div data-o-grid-colspan="12 S12 M6 L4">
35+
<a class="crossword-link" href="{{ post.url | relative_url }}">
36+
<div class="crossword-info crossword-info--dynamic">
37+
<div class="crossword-title">{{ post.title | escape }}</div>
38+
<div class="crossword-date">{{ post.date | date: "%B %d, %Y" }}</div>
39+
</div>
40+
<div class="crossword-link-cell crossword-link-cell--dynamic {{ panel-class }}"></div>
41+
</a>
42+
</div>
43+
{% endfor %}
44+
</div>
45+
</div>
46+
</div>
47+
</div>
48+
</div>
49+
{% endfor %}
50+
</div>

byauthor.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
# You don't need to edit this file, it's empty on purpose.
3+
# Edit theme's home layout instead if you wanna make some changes
4+
# See: https://jekyllrb.com/docs/themes/#overriding-theme-defaults
5+
layout: byauthor
6+
---

0 commit comments

Comments
 (0)