Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 50 additions & 3 deletions assets/css/doors/lists.css
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,13 @@ html:has(.tag-az){scroll-padding-top:84px}
@media(max-width:760px){
/* On a phone a panel is a band, not a 16:9 picture, so a run of picture-less posts is not a wall of colour. */
.news-page .ac-panel{aspect-ratio:auto;min-height:96px;padding:14px 18px}
/* A logo or figure shown whole needs less height than a photo, except the lead's. */
.ec-thumb-whole{aspect-ratio:2/1}
.news-page :is(.announcements-grid,.ec-list)>li:nth-child(1 of :not([hidden])) .ec-thumb-whole{aspect-ratio:4/3}
/* Landscape and square logo/emblem cards on phones take a compact 144 px band so headlines lead while emblems stay
legible; portrait covers and teaching diagrams otherwise keep 16:9, except the lead card's 4:3 slot. */
.ec-thumb-whole.ec-thumb-logo{aspect-ratio:auto;height:144px}
Comment thread
LukasWallrich marked this conversation as resolved.
Resolved
.ec-thumb-whole.ec-thumb-logo img{inset:10px 14px;width:calc(100% - 28px);height:calc(100% - 20px)}
.ec-thumb-whole.ec-thumb-diagram{aspect-ratio:16/9}
.news-page :is(.announcements-grid,.ec-list)>li:nth-child(1 of :not([hidden])) .ec-thumb-whole{height:auto;aspect-ratio:4/3}
.news-page :is(.announcements-grid,.ec-list)>li:nth-child(1 of :not([hidden])) .ec-thumb-whole img{inset:14px 18px;width:calc(100% - 36px);height:calc(100% - 28px)}
}
/* Educators' Corner: education's pale ground on every card (DESIGN.md §6). */
.ec-page .announcement-card{background:var(--edu-bg)}
Expand Down Expand Up @@ -359,6 +363,49 @@ html:has(.tag-az){scroll-padding-top:84px}
.ec-write-link:focus-visible{outline:3px solid #fff;outline-offset:3px}
/* The search box takes education's pale ground too. */
.ec-intro .list-filter-posts{background:var(--edu-bg)}

/* Pedagogies list (layouts/section/pedagogies.html): 2-column Education cards first, background prose paired beside
an invitation card below (DESIGN.md §2, §4, §6, §7). */
.ped-head{display:grid;grid-template-columns:minmax(0,1fr) 210px;column-gap:32px;align-items:end;margin-bottom:28px}
.ped-head>*{grid-column:1}
.ped-head>.ped-plate{grid-column:2;grid-row:1/span 3;align-self:end;margin:0;background:var(--edu-bg);border-radius:999px 999px 0 0;padding:24px 16px 6px}
.ped-head>.standfirst{max-width:32em}
@media(max-width:900px){
.ped-head{grid-template-columns:minmax(0,1fr);margin-bottom:20px}
.ped-head>.ped-plate{display:none}
}
ul.ped-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;margin:0 0 48px;padding:0;list-style:none}
@media(max-width:860px){ul.ped-grid{grid-template-columns:1fr;gap:20px;margin-bottom:36px}}
.ped-grid>li{display:flex}
.ped-card{display:flex;flex-direction:column;width:100%}
.ped-card .ec-thumb-whole{aspect-ratio:16/9}
@media(max-width:760px){
.ped-card .ec-thumb-whole{height:auto;aspect-ratio:16/9}
.ped-card .ec-thumb-whole img{inset:10px 14px;width:calc(100% - 28px);height:calc(100% - 20px)}
}
.ped-card .ac-body{display:flex;flex-direction:column;flex:1;padding:20px 24px 22px}
.ped-card h2{margin:0 0 6px;font-size:25px;line-height:1.18}
.ped-subtitle{margin:0 0 8px;font-size:17px;line-height:1.4;color:var(--edu);font-weight:600}
.ped-summary{margin:0 0 16px;font-size:17px;line-height:1.5;color:var(--ink)}
.ped-materials{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;margin-top:auto;padding-top:12px;border-top:1px solid color-mix(in srgb,var(--edu) 22%,transparent);font-size:16px;line-height:1.45}
.ped-materials-label{font-weight:700;color:var(--ink)}
.ped-links{display:flex;flex-wrap:wrap;gap:2px 16px;margin:0;padding:0;list-style:none}
.ped-links li{margin:0}
.ped-links a{position:relative;z-index:1;display:inline-flex;align-items:center;min-height:36px;color:var(--link);font-weight:600;text-decoration:underline;text-underline-offset:3px}
.ped-links a:hover{color:var(--ink)}
@media(max-width:760px){
.ped-card .ac-body{padding:16px 18px 18px}
.ped-card h2{font-size:22px}
.ped-materials-label{flex-basis:100%}
.ped-links{gap:0 18px}
.ped-links a{min-height:44px}
}
.ped-about{display:grid;grid-template-columns:minmax(0,38em) minmax(280px,380px);justify-content:start;gap:28px 56px;align-items:start;padding-top:32px;border-top:1.5px solid var(--line)}
.ped-about-prose h2{margin:0 0 12px;font-size:28px;line-height:1.2}
.ped-about-prose .article-style p{font-size:18px;line-height:1.6}
.ped-about-prose .article-style br{display:none}
.ped-contribute .ec-write-card h3{margin:0 0 8px;font:var(--display-weight) 26px/1.15 var(--display);color:#fff}
@media(max-width:960px){.ped-about{grid-template-columns:1fr;gap:24px}}
/* ==== Taxonomy pages (layouts/_default/terms.html, term.html): the earlier FORRT clusters (/forrt_clusters/),
the news categories (/categories/, /category/<term>/). Keep these rules together in this block. ==== */
/* The illustration in the head of /forrt_clusters/, beside the title; on narrower screens small, below the crumbs. */
Expand Down
26 changes: 17 additions & 9 deletions layouts/partials/doors/card_picture.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{{/* A card's picture (news list, Educators' Corner and end-of-article cards). A photo near the card's 16:9 shape
fills the slot. Anything else is shown whole, on a ground read from its top left corner: a picture on white
blends into the card's tint (article.css), and other pictures sit on a mat of their own background colour.
Where `figures` is true (Educators' Corner, whose pictures are often charts and
logos), a picture with a pale main colour counts as a figure even at a photo's shape.
Input: dict "img" (image resource), "large" (the lead card: about twice as wide), "lazy", "alt", "figures". */}}
{{/* A card's picture (news list, Educators' Corner, Pedagogies and end-of-article cards). A photo near the card's 16:9
shape fills the slot unless `whole` is true (Pedagogies, whose thumbnails are slide stills and seals). Anything
else is shown whole, on a ground read from its top left corner: a picture on white blends into the card's tint
(article.css), and other pictures sit on a mat of their own background colour.
Where `figures` is true (Educators' Corner, whose pictures are often charts and logos), a picture with a pale main
colour counts as a figure even at a photo's shape; wide landscape diagrams (ratio 1.75–2.15) keep full reading
height on phones (.ec-thumb-diagram), while non-portrait logos take a compact phone band (.ec-thumb-logo).
Input: dict "img" (image resource), "large" (the lead card: about twice as wide), "lazy", "alt", "figures", "whole". */}}
{{ $img := .img }}
{{ $ratio := div (float $img.Width) $img.Height }}
{{ $main := index $img.Colors 0 }}
{{ $photo := and (ge $ratio 1.3) (le $ratio 2.05) }}
{{ $photo := and (not .whole) (ge $ratio 1.3) (le $ratio 2.05) }}
{{ if and .figures (ge $main.Luminance 0.8) }}{{ $photo = false }}{{ end }}
{{ $lazy := cond .lazy ` loading="lazy"` "" }}
{{ if $photo }}
Expand All @@ -17,8 +19,14 @@
{{ $fit := $img.Fit (cond .large "1200x640 webp q80" "600x320 webp q80") }}
{{/* The picture's own ground, read from its top left corner; as a JPEG, so a transparent corner reads as white. */}}
{{ $ground := index ($img.Crop "4x4 TopLeft jpg").Colors 0 }}
{{/* A corner far from the picture's main colour is part of the picture, not its ground: then the card's tint. */}}
{{/* A corner far from the picture's main colour is part of the picture, not its ground: then the card's tint.
Only near-pure white grounds (luminance >= 0.93) blend cleanly through multiply onto the card tint. */}}
{{ $odd := gt (math.Abs (sub $ground.Luminance $main.Luminance)) 0.2 }}
{{ $onTint := or (ge $ground.Luminance 0.93) $odd }}
<div class="ac-thumb ec-thumb-whole{{ if $onTint }} ec-thumb-blend{{ end }}"{{ if not $onTint }} style="--mat:{{ $ground.ColorHex }}"{{ end }}><img src="{{ $fit.RelPermalink }}" width="{{ $fit.Width }}" height="{{ $fit.Height }}" alt="{{ .alt }}"{{ $lazy | safeHTMLAttr }}></div>
{{/* Among figure images that took the non-photo branch (pale main colour), wide 1.75–2.15 diagrams keep full phone
height (.ec-thumb-diagram), while non-portrait logos/emblems use the compact 144 px band (.ec-thumb-logo).
Dark 16:9 photos intentionally stay on the full-bleed $photo branch above. */}}
{{ $diagram := and .figures (ge $ratio 1.75) (le $ratio 2.15) }}
{{ $logoBand := and .figures (not $diagram) (ge $ratio 0.85) }}
<div class="ac-thumb ec-thumb-whole{{ if $diagram }} ec-thumb-diagram{{ else if $logoBand }} ec-thumb-logo{{ end }}{{ if $onTint }} ec-thumb-blend{{ end }}"{{ if not $onTint }} style="--mat:{{ $ground.ColorHex }}"{{ end }}><img src="{{ $fit.RelPermalink }}" width="{{ $fit.Width }}" height="{{ $fit.Height }}" alt="{{ .alt }}"{{ $lazy | safeHTMLAttr }}></div>
Comment thread
LukasWallrich marked this conversation as resolved.
Resolved
{{ end }}
86 changes: 71 additions & 15 deletions layouts/section/pedagogies.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,74 @@
{{- define "main" -}}
{{/* A section of articles: its introduction, then the articles newest first, a page at a time. */}}
{{ $pager := .Paginate .Data.Pages }}
<div class="wrap">
<div class="article-layout article-layout-wide">
<article class="reading">
<header class="article-head">
{{ partial "doors/crumbs" (dict "page" .) }}
<h1>{{ .Title }}</h1>
{{ with .Params.subtitle }}<p class="standfirst">{{ . | markdownify | emojify }}</p>{{ end }}
</header>
{{ with .Content }}<div class="article-style">{{ partial "doors/content" . }}</div>{{ end }}
<div class="list-items">{{ range $pager.Pages }}{{ partial "doors/list_item" . }}{{ end }}</div>
{{ partial "doors/pager" $pager }}
</article>
</div>
{{/* Pedagogies: FORRT's worked examples of principled teaching and mentoring. Leads immediately with the pedagogies
as Education-tinted cards (DESIGN.md §2, §4, §6), each showing its course preview, educator, summary and plain
links to its teaching materials. The background prose follows beside an invitation to contribute, so neither
pushes the pedagogies off the first screen nor leaves an empty column on desktop (§7). */}}
{{/* Keep Hugo's /pedagogies/page/1/ redirect stub matching the baseline section list. */}}
{{ $_ := .Paginator }}
{{ $pages := .Data.Pages.ByDate.Reverse }}
<div class="wrap news-page ec-page ped-page">
<header class="article-head ped-head">
{{ partial "doors/crumbs" (dict "page" .) }}
<h1>{{ .Title }}</h1>
{{ with .Params.subtitle }}<p class="standfirst">{{ . | markdownify | emojify }}</p>{{ end }}
{{ with resources.Get "images/doors/area-education.webp" }}
{{ $w := .Resize "440x webp q80" }}
<figure class="topic-plate-head ped-plate" aria-hidden="true"><img src="{{ $w.RelPermalink }}" width="{{ $w.Width }}" height="{{ $w.Height }}" alt=""></figure>
{{ end }}
</header>

<ul class="ped-grid list-items" role="list">
{{ range $i, $p := $pages }}
{{ $link := $p.RelPermalink }}{{ $target := "" }}
{{ with $p.Params.external_link }}{{ $link = . }}{{ $target = ` target="_blank" rel="noopener"` }}{{ end }}
{{ $img := ($p.Resources.ByType "image").GetMatch "*featured*" }}
<li>
<article class="announcement-card ped-card">
{{ with $img }}
{{ partial "doors/card_picture" (dict "img" . "large" false "lazy" (ge $i 4) "alt" $p.Params.image.alt_text "figures" true "whole" true) }}
{{ else }}
<div class="ac-thumb ac-panel ac-panel-edu ac-panel-door" aria-hidden="true"></div>
{{ end }}
<div class="ac-body">
<h2><a class="ac-link" href="{{ $link }}"{{ $target | safeHTMLAttr }}>{{ $p.Title }}</a></h2>
{{ with $p.Params.subtitle }}<p class="ped-subtitle">{{ . | markdownify | emojify }}</p>{{ end }}
<p class="ec-meta">{{ with $p.Params.authors }}<span class="ec-authors">{{ partial "doors/author_links" . }}</span>{{ end }}{{ if $p.Params.date }}<time datetime="{{ $p.Date.Format "2006-01-02" }}">{{ $p.Date.Format "January 2006" }}</time>{{ end }}</p>
<p class="ped-summary">{{ if $p.Params.summary }}{{ $p.Params.summary | plainify | emojify }}{{ else if $p.Params.abstract }}{{ $p.Params.abstract | plainify | emojify }}{{ else }}{{ $p.Summary | plainify | emojify }}{{ end }}</p>
{{ with $p.Params.links }}
<div class="ped-materials">
<span class="ped-materials-label">Materials:</span>
<ul class="ped-links" role="list">
{{ range . }}
{{ $href := .url | htmlUnescape }}
{{ if not (or (hasPrefix $href "http://") (hasPrefix $href "https://") (hasPrefix $href "/")) }}
{{ $href = printf "%s%s" $p.RelPermalink $href }}
{{ end }}
{{ $away := or (hasPrefix $href "http://") (hasPrefix $href "https://") }}
<li><a href="{{ $href }}"{{ if $away }} target="_blank" rel="noopener"{{ end }}>{{ .name | strings.TrimSpace }}{{ if $away }} <i class="fas fa-external-link-alt" aria-hidden="true"></i><span class="visually-hidden"> (another website)</span>{{ end }}</a></li>
{{ end }}
</ul>
</div>
{{ end }}
</div>
</article>
</li>
{{ end }}
</ul>

{{ with .Content }}
<section class="ped-about" aria-labelledby="ped-about-h">
<div class="ped-about-prose">
<h2 id="ped-about-h">About FORRT Pedagogies</h2>
<div class="article-style">{{ partial "doors/content" . }}</div>
</div>
<aside class="ped-contribute" aria-label="Share your pedagogy">
<div class="ec-write-card">
<h3>Share a pedagogy</h3>
<p>Teach a course or module grounded in open and reproducible research? Help other educators adapt your approach.</p>
<a class="ec-write-link" href="{{ relref $ "/submit" }}">Submit your pedagogy</a>
</div>
</aside>
</section>
{{ end }}
</div>
{{- end -}}
Loading