From 1ae501f161c14f31ead599ea0b3cf0e3fe90cb0b Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Tue, 24 Nov 2026 10:17:40 +0000 Subject: [PATCH 1/7] Doors polish: resolve remaining #1196 and #1246 template, contrast and copy items --- assets/css/doors/article.css | 19 +++++-- assets/css/doors/clusters.css | 35 ++++++++---- assets/css/doors/hub.css | 2 - assets/css/doors/inner.css | 2 + assets/css/doors/resources.css | 14 ++++- assets/css/doors/sections.css | 1 + assets/js/doors/resources.js | 29 ++++++---- assets/js/doors/site.js | 15 ++++- config/_default/menus.toml | 2 +- content/about/booklet/_index.md | 2 +- content/about/get-involved/intro.md | 2 +- .../index.md | 4 -- .../index.md | 2 +- content/lesson-plans/nd-lessons-plans.md | 4 +- content/replication-hub/_index.md | 10 ++-- layouts/curated_resources/single.html | 5 +- layouts/disciplines/single.html | 18 ++++-- layouts/glossary/single.html | 2 +- layouts/partials/citations/authors.html | 33 ++++++++--- layouts/partials/citations/entry.html | 2 +- .../partials/clusters/cluster_section.html | 4 +- layouts/partials/disciplines/intro.html | 14 ----- layouts/partials/doors/article_card.html | 27 +++++---- layouts/partials/doors/article_header.html | 1 + layouts/partials/doors/crumbs.html | 4 +- layouts/partials/doors/reading_card.html | 5 ++ layouts/partials/doors/resource_keywords.html | 19 ++++--- layouts/resources/list.html | 10 ++-- scripts/tests/test_doors_polish.py | 56 +++++++++++++++++++ static/js/featured-resources.js | 19 ++++++- 30 files changed, 260 insertions(+), 102 deletions(-) create mode 100644 scripts/tests/test_doors_polish.py diff --git a/assets/css/doors/article.css b/assets/css/doors/article.css index 362716a2654..dd29e8dd2d9 100644 --- a/assets/css/doors/article.css +++ b/assets/css/doors/article.css @@ -355,7 +355,8 @@ main:lang(ar) .article-layout .article-style,main:lang(ar) .article-layout .arti .article-layout .article-style .btn-block{display:inline-block;width:auto} @media(max-width:1000px){.profile-head .profile-org{font-weight:400}.profile-head ul.network-icon{margin:4px 0 0}.profile-head ul.network-icon a{text-decoration:none}} .article-layout .article-style .btn.btn-primary,.article-layout .article-style .btn.btn-lg{padding:10px 22px!important;font-size:17px!important} -.byline-date{display:none} +.byline-date,.byline-updated{display:none} +.article-layout:not(:has(>.article-card)) :is(.byline-date,.byline-updated){display:inline} @media(max-width:1000px){.article-layout .byline-date{display:inline}} /* A search over a long list on the page (shortcodes/list_filter.html). */ .article-layout :is(.article-style .list-filter,.list-filter-posts){max-width:520px;margin:8px 0 22px;padding:16px 18px;background:var(--surface);border-radius:var(--r-large)} @@ -601,8 +602,8 @@ html:has(.list-filter-section){scroll-padding-top:calc(var(--list-filter-bar,0px .ac-link::after{content:"";position:absolute;inset:0} .announcement-card:hover .ac-link{color:var(--ink)} @supports selector(:has(*)){.ac-link:focus-visible{outline:none}.announcement-card:has(.ac-link:focus-visible){outline:3px solid var(--ink);outline-offset:3px}} -/* The start of the summary: four lines; the card leads to the rest. */ -.ac-summary{margin:0;overflow-wrap:anywhere;font-size:17px;line-height:1.45;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;line-clamp:4;overflow:hidden} +/* The start of the summary: four lines, breaking between words rather than mid-word; the card leads to the rest. */ +.ac-summary{margin:0;overflow-wrap:break-word;font-size:17px;line-height:1.45;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;line-clamp:4;overflow:hidden} /* Articles (news, Educators' Corner, Pedagogies). The side card names the authors, with their photos, and leads back to the section; Educators' Corner and Pedagogies are education's, on its pale ground (DESIGN.md §6). */ .article-layout .article-card-edu{background:var(--edu-bg);box-shadow:inset 0 6px 0 var(--edu);padding-top:26px} @@ -621,6 +622,7 @@ html:has(.list-filter-section){scroll-padding-top:calc(var(--list-filter-bar,0px .article-layout .card-authors .network-icon li{flex:none;margin:0} .article-layout .card-authors .network-icon a{display:flex;align-items:center;justify-content:center;width:34px;height:34px;color:var(--link);font-size:17px} .article-layout .card-authors .network-icon a:hover{color:var(--ink)} +.article-layout .card-authors .network-icon .ai-google-scholar{font-size:21px;line-height:1;-webkit-text-stroke:.35px currentColor} .article-layout .card-more{margin:0 0 4px} .article-layout .card-more a{display:inline-block;padding:11px 0;font-weight:600;color:var(--link);text-decoration:underline;text-underline-offset:3px} .article-layout .card-more a::after{content:"\2192";margin-inline-start:6px;text-decoration:none} @@ -655,6 +657,13 @@ html:has(.list-filter-section){scroll-padding-top:calc(var(--list-filter-bar,0px .read-next h2{margin:0 0 18px;font-size:30px;line-height:1.15} .read-next .announcements-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,250px),1fr))} .read-next-edu .announcement-card{background:var(--edu-bg)} +.read-next .ac-panel{-webkit-print-color-adjust:exact;print-color-adjust:exact} +.read-next .ac-panel-title{margin:0;font-size:inherit;line-height:1.1} +.read-next .ac-panel-title .ac-link,.read-next .announcement-card:hover .ac-panel-title .ac-link{display:flex;flex-direction:column;gap:2px;color:#fff;text-decoration:none} +.read-next .ac-panel-title span{font:600 15px/1.25 var(--text)} +.read-next .ac-panel-title strong{font:var(--display-weight) 28px/1.1 var(--display);text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:4px} +.read-next .announcement-card:hover .ac-panel-title strong{text-decoration-thickness:2.5px} +.read-next .ac-issue .ac-summary{font-size:16px;-webkit-line-clamp:3;line-clamp:3} @media(max-width:760px){ .read-next{padding-bottom:32px} .read-next h2{font-size:26px} @@ -662,10 +671,12 @@ html:has(.list-filter-section){scroll-padding-top:calc(var(--list-filter-bar,0px .read-next .announcement-card{flex-direction:row} .read-next .ac-thumb{display:flex;flex:0 0 112px} .read-next .ac-thumb:not(.ec-thumb-whole) img{width:112px;height:100%;min-height:112px;aspect-ratio:auto} + .read-next-edu .ac-thumb:not(.ec-thumb-whole){align-items:center;padding:6px;box-sizing:border-box;background:#fff} + .read-next-edu .ac-thumb:not(.ec-thumb-whole) img{width:100%;height:auto;min-height:0;object-fit:contain} .read-next .ec-thumb-whole{aspect-ratio:auto;min-height:112px} .read-next .ac-panel{aspect-ratio:auto;padding:12px} .read-next .ac-panel span{font-size:15px;line-height:1.2} - .read-next .ac-panel strong{font-size:19px} + .read-next .ac-panel strong,.read-next .ac-panel-title strong{font-size:19px} .read-next .ac-body{padding:12px 14px 14px} .read-next .ac-body h3{font-size:19px} } diff --git a/assets/css/doors/clusters.css b/assets/css/doors/clusters.css index 34c0507f5b8..24e55a56369 100644 --- a/assets/css/doors/clusters.css +++ b/assets/css/doors/clusters.css @@ -552,12 +552,12 @@ } .sc-description a { - color: #1c7ed6; + color: var(--link); word-break: break-word; } .sc-description a:hover { - color: #1264ab; + color: var(--ink); } /* ---- Publication list ---- */ @@ -574,12 +574,12 @@ } .publication-item a { - color: #1c7ed6; + color: var(--link); word-break: break-all; } .publication-item a:hover { - color: #1264ab; + color: var(--ink); } /* ---- Responsive ---- */ @@ -1199,7 +1199,7 @@ h1.clusters-site-heading.clusters-hub-page__title { } .clusters-back-to-top:focus { - outline: 2px solid #1c7ed6; + outline: 2px solid var(--link); outline-offset: 2px; } @@ -1851,11 +1851,12 @@ h1.clusters-site-heading.clusters-hub-page__title { font-size: 0.75rem; } .ref-doi-link { - color: #1c7ed6; + color: var(--link); word-break: break-all; - text-decoration: none; + text-decoration: underline; + text-underline-offset: 3px; } -.ref-doi-link:hover { text-decoration: underline; } +.ref-doi-link:hover { color: var(--ink); } .ref-oa-badge { display: inline-flex; @@ -2214,8 +2215,9 @@ h1.clusters-site-heading.clusters-hub-page__title { font-size: 15px; } .rl-detail-doi-link { - color: #006080 !important; - text-decoration: none; + color: var(--link) !important; + text-decoration: underline; + text-underline-offset: 3px; word-break: break-all; } .rl-detail-doi-link:hover { text-decoration: underline; } @@ -2384,9 +2386,19 @@ body.clusters-mobile-nav-open .clusters-back-to-top{display:none} .clusters-head h1.clusters-site-heading{font-weight:var(--display-weight);letter-spacing:-.01em;text-wrap:balance} /* The closed reading-list panel cast its shadow back onto the page edge. */ .rl-panel:not(.open){box-shadow:none} +/* Keep the reading-list pill and its count badge at legible UI sizes (DESIGN.md §7). */ +.rl-pill{font-size:15px;padding:7px 14px 7px 12px} +.rl-pill-count{font-size:14px;min-width:1.5em;height:1.5em} /* Introductions keep to a reading measure; the explorer and diagram keep the full width. */ .clusters-intro .intro-paragraph{max-width:70ch} -/* On a phone the sponsor is a small credit line, so the search follows the introduction closely. */ +/* Closing attribution row on /disciplines/: form + citation beside the UKRN credit on wide screens, stacked on phones. */ +.disciplines-foot{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:20px 40px;margin-top:24px;padding-top:20px;border-top:1px solid var(--line)} +.disciplines-foot__main{flex:1 1 380px;min-width:0} +.disciplines-foot__main .disciplines-form{margin:0 0 10px} +.disciplines-foot__main .disciplines-attribution{margin:0;max-width:none} +.disciplines-foot .disciplines-partner{display:flex;align-items:center;gap:12px;max-width:none;margin:0;text-align:start} +.disciplines-foot .disciplines-partner img{width:64px;height:64px;flex:none} +.disciplines-foot .disciplines-partner__caption{margin:0;font-size:15px} @media (max-width:768px){ .disciplines-partner{display:flex;align-items:center;gap:12px;align-self:flex-start;max-width:none} .disciplines-partner img{width:56px;height:56px} @@ -2607,7 +2619,6 @@ summary.clusters-overview__heading::before{content:"";width:0;height:0;border-le .disciplines-areas{gap:6px 18px} .disc-key{display:inline-flex;align-items:center;gap:7px;font:600 16px/1.3 var(--text);color:var(--ink)} .disc-key::before{content:"";width:14px;height:14px;border-radius:3px;background:var(--k);-webkit-print-color-adjust:exact;print-color-adjust:exact} -#disciplines-layout .cluster-number{background:var(--ink);color:#fff;font-size:15px;width:1.8em;height:1.8em} /* Disciplines: a bar of each field's and discipline's resources by kind, in the key's colours (kinds_bar.html). */ /* A row's bar sits in a fixed track and runs to its share of the largest discipline; the field's bar has its own line. */ diff --git a/assets/css/doors/hub.css b/assets/css/doors/hub.css index c8c93a12b1a..d8ee19bbfa2 100644 --- a/assets/css/doors/hub.css +++ b/assets/css/doors/hub.css @@ -42,8 +42,6 @@ .tool:hover h3 a{text-decoration-thickness:2px} .tool:focus-within{outline:3px solid var(--ink);outline-offset:2px;background:var(--tint)} .tool h3 a:focus-visible{outline:none} -/* Each stage's starting point keeps its emphasis as a title in the stage colour. */ -.tool:first-child h3 a{color:var(--tone)} @media(max-width:600px){ .tool{grid-template-columns:1fr;padding:12px 4px} .tool p.tool-format,.tool h3,.tool p:not(.tool-format){grid-column:1;grid-row:auto} diff --git a/assets/css/doors/inner.css b/assets/css/doors/inner.css index 3cce5307224..a900de70d5a 100644 --- a/assets/css/doors/inner.css +++ b/assets/css/doors/inner.css @@ -43,6 +43,8 @@ ul.network-icon{display:flex;flex-wrap:wrap;gap:6px 10px;margin:6px 0 0;padding: ul.network-icon li{margin:0} ul.network-icon a{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;font-size:18px;color:var(--link)} ul.network-icon a:hover{color:var(--ink)} +/* Academicons' Google Scholar glyph is drawn narrower and thinner than Font Awesome's icons; scale and weight it to match. */ +ul.network-icon .ai-google-scholar{font-size:1.24em;line-height:1;-webkit-text-stroke:.35px currentColor} .cite-dialog{width:min(640px,calc(100% - 32px));padding:22px;border:0;border-radius:var(--r-large);background:var(--page);color:var(--ink)} .cite-dialog::backdrop{background:rgba(38,45,53,.55)} .cite-dialog h2{font-size:26px} diff --git a/assets/css/doors/resources.css b/assets/css/doors/resources.css index f456fb15b6d..a566779ead9 100644 --- a/assets/css/doors/resources.css +++ b/assets/css/doors/resources.css @@ -4,6 +4,8 @@ .filters{background:var(--surface);border-radius:var(--r-large);padding:22px 20px;min-width:0} .filter-drawer>summary{list-style:none;font-weight:700;line-height:1.35} .filter-drawer>summary::-webkit-details-marker{display:none} +/* When open, the three facet legends are right below, so don't repeat them in the summary. */ +.filter-drawer[open] .filter-summary-detail{display:none} .filter-badge{font-weight:600} .facet{border:0;margin:18px 0 0;padding:0;min-width:0} .filter-title{padding:0;font:var(--display-weight) 20px/1.2 var(--display);margin:0 0 10px;color:var(--ink)} @@ -11,8 +13,13 @@ .chip{display:inline-flex;align-items:baseline;gap:7px;background:#fff;border:1.5px solid var(--line);border-radius:999px;padding:7px 12px;font:400 15px/1.3 var(--text);color:var(--ink);text-align:start;max-width:100%;cursor:pointer} .chip:hover{border-color:var(--ink)} .chip[aria-pressed=true]{background:var(--ink);border-color:var(--ink);color:#fff} -.chip-count{color:var(--soft);font-size:15px;font-weight:600} +.chip-count{color:var(--soft);font-size:15px;font-weight:600;font-variant-numeric:tabular-nums} .chip[aria-pressed=true] .chip-count{color:inherit} +/* Cluster filters have multi-word names: stack as uniform full-width rows (two-line height at normal text size, expanding for longer labels or enlarged text) with colour swatch left and count right. */ +.facet[data-facet="cluster"] .chips{flex-direction:column;gap:6px} +.facet[data-facet="cluster"] .chip{width:100%;min-height:56px;box-sizing:border-box;align-items:center;border-radius:var(--r-small);padding:8px 12px;gap:9px} +.facet[data-facet="cluster"] .chip-label{flex:1 1 auto;min-width:0;line-height:1.3} +.facet[data-facet="cluster"] .chip-count{margin-inline-start:auto;flex:none} .filter-note{margin:12px 0 0;font-size:16px} .catalogue{min-width:0} .search-label{display:block;font:var(--display-weight) 22px/1.2 var(--display);margin:0 0 10px} @@ -47,8 +54,13 @@ .collection-note{margin-top:64px;max-width:44em} .collection-note h2{font-size:clamp(28px,2.6vw,36px);margin:0 0 10px} .collection-note p{margin:0 0 12px} +.collection-history{margin-top:24px;padding-top:16px;border-top:1px solid var(--line);max-width:44em} .collection-about p{font-size:16px;line-height:1.55;margin-top:16px} .collection-about a{color:var(--link);text-decoration:underline;text-underline-offset:3px} +/* Keywords on resource pages: non-linked rarer keywords sit cleanly in body ink, separated from linked tags so they never read as broken links. */ +.article-layout .resource-keywords{color:var(--ink)} +.article-layout .resource-keywords-plain{display:block;margin-top:4px;color:var(--ink)} +.article-layout .resource-keywords-sep{color:var(--soft)} @media(max-width:1000px){ .directory{grid-template-columns:minmax(0,250px) minmax(0,1fr);gap:28px} diff --git a/assets/css/doors/sections.css b/assets/css/doors/sections.css index 07beb45f31e..faa54e426d5 100644 --- a/assets/css/doors/sections.css +++ b/assets/css/doors/sections.css @@ -582,6 +582,7 @@ html:has(.contributor-az){scroll-padding-top:calc(var(--contributor-az,72px) + 1 .lesson-plan-pair>div>:is(h2,h3):first-child{margin-top:48px} } .article-layout .article-style .lesson-plan-sheet>h3{margin-top:36px} +@media(min-width:761px){.narrow-screen-only{display:none}} .lesson-plan-motivation{display:flex;flex-direction:column} /* The note on the article about the plans is a pale side panel, so it reads as an aside to the motivation. */ .article-layout .article-style .lesson-plan-article{order:1;margin:8px 0 0;padding:20px 22px;background:var(--edu-bg);border-radius:var(--r-large)} diff --git a/assets/js/doors/resources.js b/assets/js/doors/resources.js index 9d1f7df00f5..87c948852c6 100644 --- a/assets/js/doors/resources.js +++ b/assets/js/doors/resources.js @@ -31,7 +31,8 @@ const PER_OPTIONS = [...perSelect.options].map((option) => Number(option.value)) // What the page shows with nothing chosen, restored when the last filter goes. const serverCards = [...results.children]; -const serverCount = countLine.textContent; +const serverCount = countLine.innerHTML; +const serverCountText = countLine.textContent; let data = null; let searchText = null; @@ -43,7 +44,7 @@ let page = serverPage; let orders = null; const chipsOf = (facet) => [...facet.querySelectorAll('.chip')]; -const labelOf = (chip) => chip.firstChild.textContent.trim(); +const labelOf = (chip) => (chip.querySelector('.chip-label') || chip.firstChild).textContent.trim(); function chosen() { const picks = {}; @@ -210,24 +211,32 @@ function draw() { }); }); - // The order is part of the line, so a new sort is announced even when the range stays the same. + // The order stays in a visually-hidden span so screen readers still hear sort changes without repeating the sort menu. const order = sort === 'newest' ? 'newest first' : 'A to Z'; + const setCount = (visible, hiddenOrder) => { + countLine.textContent = visible; + if (hiddenOrder) { + const sr = document.createElement('span'); + sr.className = 'visually-hidden'; + sr.textContent = `, ${hiddenOrder}`; + countLine.append(sr); + } + }; if (asServed) { results.replaceChildren(...serverCards); - countLine.textContent = serverCount; + countLine.innerHTML = serverCount; } else { const first = (page - 1) * per; const shown = hits.slice(first, first + per); results.replaceChildren(...shown.map(drawCard)); const noun = filtering ? 'matching resources' : 'resources'; const from = filtering ? `, from ${total}` : ''; - if (!hits.length) countLine.textContent = `No matching resources, from ${total}`; + if (!hits.length) setCount(`No matching resources, from ${total}`); else if (pages === 1) { - countLine.textContent = hits.length === 1 - ? `Showing 1 matching resource, from ${total}` - : `Showing all ${fmt(hits.length)} ${noun}, ${order}${from}`; + if (hits.length === 1) setCount(`Showing 1 matching resource, from ${total}`); + else setCount(`Showing all ${fmt(hits.length)} ${noun}${from}`, order); } else { - countLine.textContent = `Showing ${fmt(first + 1)}–${fmt(first + shown.length)} of ${fmt(hits.length)} ${noun}, ${order}${from}`; + setCount(`Showing ${fmt(first + 1)}–${fmt(first + shown.length)} of ${fmt(hits.length)} ${noun}${from}`, order); } } if (pager) pager.hidden = !asServed; @@ -386,5 +395,5 @@ fetch(root.dataset.directoryUrl) draw(); }) .catch(() => { - countLine.textContent = `${serverCount}. Filters could not be loaded, so please use the page links below.`; + countLine.textContent = `${serverCountText}. Filters could not be loaded, so please use the page links below.`; }); diff --git a/assets/js/doors/site.js b/assets/js/doors/site.js index a6b5beb2062..38addec8748 100644 --- a/assets/js/doors/site.js +++ b/assets/js/doors/site.js @@ -693,6 +693,17 @@ if (termFilter && termGrid) { window.addEventListener('hashchange', openAbout); openAbout(); } else if (termFilter) { + if (!termFilter.placeholder) { + const lang = (document.documentElement.lang || 'en').slice(0, 2).toLowerCase(); + const placeholders = { + en: 'e.g. replication', + de: 'z. B. Replikation', + ar: 'اكتب مصطلحًا', + tr: 'Bir terim yazın', + zh: '输入术语', + }; + termFilter.placeholder = placeholders[lang] || placeholders.en; + } const terms = [...document.querySelectorAll('.term-list li')]; // A count, a no-results line and a clear button under the filter. const status = document.createElement('p'); @@ -713,14 +724,14 @@ if (termFilter && termGrid) { status.textContent = !query ? '' : shown ? `${shown} ${shown === 1 ? 'term' : 'terms'}` : 'No matching terms.'; clearTerms.hidden = !query; }); - // On a phone the list moves up, into a "Find another term" disclosure right after the definition. + // On a phone the list moves up, into a disclosure right after the definition, keeping the same label as desktop. const card = document.getElementById('glossary-terms'); const definition = document.querySelector('.term-definition'); if (card && definition && window.matchMedia('(max-width: 1000px)').matches) { const finder = document.createElement('details'); finder.className = 'term-finder'; const summary = document.createElement('summary'); - summary.textContent = document.documentElement.lang.startsWith('en') ? 'Find another term' : (card.querySelector('h2')?.textContent || 'Find another term'); + summary.textContent = card.querySelector('h2')?.textContent || 'List of terms'; finder.append(summary, card); definition.after(finder); document.querySelector('.term-list-jump')?.remove(); diff --git a/config/_default/menus.toml b/config/_default/menus.toml index edc89cb04fd..6cfa8343358 100644 --- a/config/_default/menus.toml +++ b/config/_default/menus.toml @@ -6,7 +6,7 @@ [[main]] name = "About FORRT" - url = "" + url = "about/us" weight = 10 identifier = "about" diff --git a/content/about/booklet/_index.md b/content/about/booklet/_index.md index 5bcc18adf80..e67e8ca663a 100644 --- a/content/about/booklet/_index.md +++ b/content/about/booklet/_index.md @@ -21,7 +21,7 @@ summary = "Learn more about FORRT in the interactive flipbook below: If you pref ] [[inside]] key = "res" - title = "Metascience & Research" + title = "Meta-Science & Research" pages = [ { title = "Replications: FReD and the Annotator", page = 7, url = "replication-hub/" }, { title = "Handbook for reproduction and replication studies", page = 8, url = "https://forrt.org/replication-handbook/" }, diff --git a/content/about/get-involved/intro.md b/content/about/get-involved/intro.md index 3c16b3176f6..6c8edc677a4 100644 --- a/content/about/get-involved/intro.md +++ b/content/about/get-involved/intro.md @@ -54,7 +54,7 @@ classtitle = "" +++ {{< action_cards >}} -Join our Slack | Where most of FORRT's work and conversation happens | https://join.slack.com/t/forrt/shared_invite/zt-alobr3z7-NOR0mTBfD1vKXn9qlOKqaQ +Join FORRT's Slack | Where most of FORRT's work and conversation happens | https://join.slack.com/t/forrt/shared_invite/zt-alobr3z7-NOR0mTBfD1vKXn9qlOKqaQ Find a project | Initiatives looking for collaborators right now | #get-involved Get the newsletter | News, events and opportunities, in your inbox | #newsletter {{< /action_cards >}} diff --git a/content/educators-corner/007-easy-steps-to-elevate-your-mentoring/index.md b/content/educators-corner/007-easy-steps-to-elevate-your-mentoring/index.md index 1a334c1da55..05cc3e049e0 100644 --- a/content/educators-corner/007-easy-steps-to-elevate-your-mentoring/index.md +++ b/content/educators-corner/007-easy-steps-to-elevate-your-mentoring/index.md @@ -44,8 +44,6 @@ To get a handle on how my students are doing, and if there are issues in the lab {{< gform src="1FAIpQLScGCi7iACgmVBhFcE7G90oPwuTs-g9CQkrDmOUoQ4FvoT9CfA" width="100%" height="700px" alt="Loading..." >}} -

- If you would like the direct link to the Google Forms, [please follow this link.](https://docs.google.com/forms/d/e/1FAIpQLScGCi7iACgmVBhFcE7G90oPwuTs-g9CQkrDmOUoQ4FvoT9CfA/viewform) Over time, I forget which new students I’ve given ‘key advice’ and expectations. So I made a document that I give to all new students. There is a different document for undergraduate Honours Thesis, MSc, and Ph.D. students, since my advice and expectations for those students differ. The document has basic things such as how many weeks ahead to give me drafts and that all students are expected to attend group meetings, and life things like you will work long hours sometimes, but this should be the exception, not the rule. @@ -54,7 +52,5 @@ Reading papers is important but not urgent, so gets delayed. Every 6 months I re Lastly, don't be afraid to try out new ways of mentoring, and toss things that don't work. I've tried a lot of things that just didn't work for my group, or didn't work for *this* group. I touch base frequently to see what works and doesn't, and student's like that I ask and it's adaptable. -
- ---- *Editor's note*: The present text is an adapted version of a widely shared [Twitter thread](https://twitter.com/FlyBehaviour/status/1435285335743864835) that resonated with so many of us. We thought it was of general interest and deserved to be memorialized, and hence we approached Amanda to adapt the thread to post it here. \ No newline at end of file diff --git a/content/educators-corner/023-forward-a-unesco-decade-of-science-programme/index.md b/content/educators-corner/023-forward-a-unesco-decade-of-science-programme/index.md index fe978f548d6..640b44d84a1 100644 --- a/content/educators-corner/023-forward-a-unesco-decade-of-science-programme/index.md +++ b/content/educators-corner/023-forward-a-unesco-decade-of-science-programme/index.md @@ -29,7 +29,7 @@ projects: [] {{< forward_unesco_sdgs_card >}} -In a landmark moment for global scientific equity, **FORRT** is one of the few initiatives worldwide to be formally endorsed as a **Programme** of the [International Decade of Sciences for Sustainable Development (IDSSD, 2024–2033)](https://www.un-sciences-decade.org/en/endorsed-activities/forward-forrt-world-development-fostering-open-research-reproducibility-worldwide-accessible?hub=63), led by UNESCO and the United Nations (UN). This endorsement reflects the highest level of UN policy recognition and positions FORRT’s work in Education & Pedagogy (Curriculum Hub), Metascience & Research (Replication Hub) and Social Justice & DEIA as an **essential contribution to the UN’s strategy for achieving the Sustainable Development Goals (SDGs)**. Specifically, FORRT for World Development (FORWARD), is recognized as critical infrastructure for advancing **Outcome 4 (widely and equitably practiced open science) and Outcome 1 (a globally science-literate society)** of the IDSSD. Through this work, FORRT facilitates the international research community to meet its core commitments to rigor, transparency, and global equity while delivering a roadmap for democratizing science worldwide. +In a landmark moment for global scientific equity, **FORRT** is one of the few initiatives worldwide to be formally endorsed as a **Programme** of the [International Decade of Sciences for Sustainable Development (IDSSD, 2024–2033)](https://www.un-sciences-decade.org/en/endorsed-activities/forward-forrt-world-development-fostering-open-research-reproducibility-worldwide-accessible?hub=63), led by UNESCO and the United Nations (UN). This endorsement reflects the highest level of UN policy recognition and positions FORRT’s work in Education & Pedagogy (Curriculum Hub), Meta-Science & Research (Replication Hub) and Social Justice & DEIA as an **essential contribution to the UN’s strategy for achieving the Sustainable Development Goals (SDGs)**. Specifically, FORRT for World Development (FORWARD), is recognized as critical infrastructure for advancing **Outcome 4 (widely and equitably practiced open science) and Outcome 1 (a globally science-literate society)** of the IDSSD. Through this work, FORRT facilitates the international research community to meet its core commitments to rigor, transparency, and global equity while delivering a roadmap for democratizing science worldwide. One of the few programmes of the IDSSD to focus on how research is done, FORWARD provides a concrete, multi-year, and community-driven framework for delivering on the mandate of the UNESCO Science Decade while feeding into the work of the other Programmes and beyond. As an endorsed Programme, we are committed to **accountability and open knowledge sharing**, ensuring that all outputs are openly accessible and utilized by the global community. The resources developed over the next 8 years will serve as **policy tools for the Decade's Secretariat** and other high-level stakeholders to monitor and track progress on equity and quality in science. We are directly contributing to realizing the Decade's vision of an inclusive and effective global science culture by 2033, with the ability to contribute policy recommendations to the World Science Forum, the UN Science Summit, the Global Research Council, the European Commission, and more. diff --git a/content/lesson-plans/nd-lessons-plans.md b/content/lesson-plans/nd-lessons-plans.md index 17de9a09b66..3c6b26b09a9 100644 --- a/content/lesson-plans/nd-lessons-plans.md +++ b/content/lesson-plans/nd-lessons-plans.md @@ -164,13 +164,13 @@ These resources were created as part of the Society for Improving Psychological -{{< click_to_load src="https://docs.google.com/spreadsheets/d/e/2PACX-1vRxqwa1rfgn-mB2hdCd3DzQHYMV7bOpQw6hRwXQodSnKjL1QvV4r5Aaf0kr-AVKc9zk60ejgDhZ-FLV/pubhtml?widget=true&headers=false" provider="Google" label="This document" title="Table of lesson plans" height="700" style="border:0px; width:100%;" >}} +{{< click_to_load src="https://docs.google.com/spreadsheets/d/e/2PACX-1vRxqwa1rfgn-mB2hdCd3DzQHYMV7bOpQw6hRwXQodSnKjL1QvV4r5Aaf0kr-AVKc9zk60ejgDhZ-FLV/pubhtml?widget=true&headers=false" provider="Google" label="This document" title="Table of lesson plans" width="100%" height="700" >}} diff --git a/content/replication-hub/_index.md b/content/replication-hub/_index.md index 47b5f6a9e12..a780568ea96 100644 --- a/content/replication-hub/_index.md +++ b/content/replication-hub/_index.md @@ -45,7 +45,7 @@ cards: - key: explore title: Explore - summary: Find replication evidence for a study or the studies a paper cites. + summary: Discover and explore replications. links: - url: "https://forrt.org/flora-replication-atlas/" format: "Web app" @@ -63,17 +63,19 @@ cards: note: "Find replication evidence in the FORRT Replication Database." - url: "https://forrt.org/fred/index.html" format: "R package" + label: "FReD" note: "Work with replication data in your own analyses." - url: "https://forrt.org/flora-zotero/" - format: "Zotero plug-in" + format: "Plug-in" note: "Check your references for replication evidence." - url: "https://forrt.org/chromium-extension/" format: "Browser extension" + label: "FORRT ORE" note: "See replication evidence, retractions, PubPeer comments and open-access copies for the papers you read." - key: conduct title: Conduct - summary: Plan and run a replication. + summary: Resources and guidance to run high-quality replications. links: - url: "https://forrt.org/replication-handbook/" format: "Guide" @@ -95,7 +97,7 @@ cards: - key: disseminate title: Disseminate - summary: Publish and read replication studies. + summary: Get replications to the people who need them. links: - url: "https://replicationresearch.org" format: "Journal" diff --git a/layouts/curated_resources/single.html b/layouts/curated_resources/single.html index b8e70540da6..e9278753246 100644 --- a/layouts/curated_resources/single.html +++ b/layouts/curated_resources/single.html @@ -53,8 +53,9 @@
- {{/* The trail stops at Resources: the title follows straight after, and repeating a long one pushed the button below a phone's first screen. */}} - + {{/* The trail stops at Teaching resources: the title follows straight after, and repeating a long one pushed the button below a phone's first screen. */}} + {{ $dirTitle := (site.GetPage "/resources").Params.heading | default "Teaching resources" }} + {{ .Title }} {{ with .Params.subtitle }}

{{ . | markdownify | emojify }}

{{ end }} {{ with $clean.creators }} diff --git a/layouts/disciplines/single.html b/layouts/disciplines/single.html index eea6a6bc580..ea054095db6 100644 --- a/layouts/disciplines/single.html +++ b/layouts/disciplines/single.html @@ -34,10 +34,20 @@

Choose your field

{{ partial "disciplines/all_fields.html" . }} -

- If you have resources or disciplines to add, or spot errors, please fill out this form. -

- {{ partial "disciplines/citation.html" . }} +
+
+

+ If you have resources or disciplines to add, or spot errors, please fill out this form. +

+ {{ partial "disciplines/citation.html" . }} +
+
+

Supported by

+ + UK Reproducibility Network (UKRN) + +
+
{{ end }} diff --git a/layouts/glossary/single.html b/layouts/glossary/single.html index ca101caa76f..b6584fbf8f0 100644 --- a/layouts/glossary/single.html +++ b/layouts/glossary/single.html @@ -274,7 +274,7 @@

{{ if gt (len .Params.references) 1 }}{{ ind {{ $keys := partialCached "citations/keys" . "bibliography-keys" }} {{ range .Params.references }} {{ $key := index $keys . | default (printf "local-%s" (md5 .)) }} - {{ partial "citations/entry" (dict "key" $key "apa" .) }} + {{ partial "citations/entry" (dict "key" $key "apa" . "lang" $lang) }} {{ end }} {{ end }} diff --git a/layouts/partials/citations/authors.html b/layouts/partials/citations/authors.html index 85745367c2d..f5fc94512ca 100644 --- a/layouts/partials/citations/authors.html +++ b/layouts/partials/citations/authors.html @@ -1,9 +1,24 @@ {{/* Shortens a long author list in a full reference to its first three authors and "et al.", with a button that shows the rest in place (assets/js/doors/references.js). Takes a reference as rendered - HTML. A reference with five authors or fewer, or whose authors aren't followed by a "(year" date, - comes back unchanged. The hidden authors stay in the page, so copying gives the full APA text, - and without JavaScript they show (layouts/partials/doors/assets.html). */}} -{{- $html := trim (string .) " \n\r\t" -}} + HTML, or a dict with `html` and `lang` (for translated pages). A reference with six authors or fewer + (which would hide three names or fewer), or whose authors aren't followed by a "(year" date, comes + back unchanged. The hidden authors stay in the page, so copying gives the full APA text, and without + JavaScript they show (layouts/partials/doors/assets.html). */}} +{{- $raw := . -}} +{{- $lang := "english" -}} +{{- if reflect.IsMap . -}} + {{- $raw = .html -}} + {{- $lang = .lang | default "english" -}} +{{- end -}} +{{- $html := trim (string $raw) " \n\r\t" -}} +{{- $i18n := dict + "english" (dict "all" "Show all %d authors" "listed" "Show listed authors" "less" "Show fewer authors" "attr" "") + "arabic" (dict "all" "عرض جميع المؤلفين (%d)" "listed" "عرض المؤلفين المدرجين" "less" "إخفاء المؤلفين" "attr" ` lang="ar" dir="rtl"`) + "german" (dict "all" "Alle %d Autor:innen anzeigen" "listed" "Aufgeführte Autor:innen anzeigen" "less" "Weniger Autor:innen anzeigen" "attr" "") + "turkish" (dict "all" "Tüm %d yazarı göster" "listed" "Listelenen yazarları göster" "less" "Daha az yazar göster" "attr" "") + "chinese" (dict "all" "显示全部 %d 位作者" "listed" "显示已列出的作者" "less" "收起作者" "attr" "") +-}} +{{- $t := index $i18n $lang | default (index $i18n "english") -}} {{/* A surname and initials, with "Jr." or a particle where the bibliography generator puts them: "Lewis, Jr., N. A.", "Elm, E. von". */}} {{- $name := `(?:[^,&…<>()]|&[a-z]+;|&#[0-9]+;)+?(?:,\s*[JS]r\.)?,\s*\p{Lu}\p{Ll}?\.(?:[\s-]*\p{Lu}\p{Ll}?\.)*(?:\s+(?:von|van|de|der|den|du|da|di|del|dos|das|la|le|ter|ten)\b)*\*?` -}} @@ -12,16 +27,16 @@ {{- $authors := index (index . 0) 1 -}} {{- $after := strings.TrimPrefix $authors $html -}} {{- $plain := htmlUnescape $authors -}} - {{/* Bibliography entries can end in "& others" or "et al.": then, as after an ellipsis, the - list is incomplete and the button doesn't give a number. */}} + {{/* Bibliography entries can end in "& others", "et al." or an ellipsis: then the list is + incomplete and the button offers the listed authors without claiming an exact total. */}} {{- $complete := not (findRE `…|\.\s?\.\s?\.|\bothers\b|\bet al\b` $plain) -}} {{- $marked := replaceRE `\bet al\.?|\bothers\b` "" (replaceRE $name "§" $plain) -}} {{/* Corporate authors such as "FORRT" are whatever is left between the separators. */}} {{- $count := add (len (findRE `§` $marked)) (len (findRE `[^\s,&…§.][^,&…§]*` $marked)) -}} - {{- with and (gt $count 5) (findRE (printf `^(?:%s\s*,\s*(?:&(?:amp;)?\s*)?){2}%s` $name $name) $authors 1) -}} + {{- with and (gt $count 6) (findRE (printf `^(?:%s\s*,\s*(?:&(?:amp;)?\s*)?){2}%s` $name $name) $authors 1) -}} {{- $first := index . 0 -}} - {{- $more := cond $complete (printf "Show all %d authors" $count) "Show more authors" -}} - {{- $out = printf `%s, et al. %s` $first (strings.TrimPrefix $first $authors) $more $more $after -}} + {{- $more := cond $complete (printf $t.all $count) $t.listed -}} + {{- $out = printf `%s, et al. %s` $first (strings.TrimPrefix $first $authors) $more $t.less $t.attr $more $after -}} {{- end -}} {{- end -}} {{- $out | safeHTML -}} diff --git a/layouts/partials/citations/entry.html b/layouts/partials/citations/entry.html index 665e08eda5e..776d467a498 100644 --- a/layouts/partials/citations/entry.html +++ b/layouts/partials/citations/entry.html @@ -1,2 +1,2 @@ {{- $meta := partialCached "citations/metadata" .apa .apa -}} -
  • {{ partial "citations/authors" (.apa | markdownify) }}
  • +
  • {{ partial "citations/authors" (dict "html" (.apa | markdownify) "lang" (.lang | default "english")) }}
  • diff --git a/layouts/partials/clusters/cluster_section.html b/layouts/partials/clusters/cluster_section.html index f23f16d80eb..6e24cf4d644 100644 --- a/layouts/partials/clusters/cluster_section.html +++ b/layouts/partials/clusters/cluster_section.html @@ -51,7 +51,7 @@

    - {{ len $featuredData }} of {{ len $featuredData }} shown + {{ len $featuredData }} {{ cond (eq (len $featuredData) 1) "reference" "references" }}
    {{ partial "clusters/featured_cards.html" (dict "resources" $featuredData "cluster_number" (int $cluster.number)) }} @@ -67,7 +67,7 @@

    - {{ len $sc.publications }} of {{ len $sc.publications }} shown + {{ len $sc.publications }} {{ cond (eq (len $sc.publications) 1) "reference" "references" }} diff --git a/layouts/partials/disciplines/intro.html b/layouts/partials/disciplines/intro.html index 0c8b7e52a32..c4af348a041 100644 --- a/layouts/partials/disciplines/intro.html +++ b/layouts/partials/disciplines/intro.html @@ -10,13 +10,6 @@ {{ end }} -{{ $webCitation := "" }} -{{ $webCitationHTML := "" }} -{{ with site.Data.disciplines_citation }} - {{ $webCitation = .web | default "" }} - {{ $webCitationHTML = .web_html | default "" }} -{{ end }} -
    @@ -24,13 +17,6 @@ Open research applies to all disciplines. If the concept of open research is new to you, it might be difficult to determine how you can apply open research practices to your research. This page provides resources and examples of open research practices relevant to your discipline. As a starting point, it may be useful to read the UK Reproducibility Network primers.

    - -
    -

    Supported by

    - - UK Reproducibility Network (UKRN) - -
    diff --git a/layouts/partials/doors/article_card.html b/layouts/partials/doors/article_card.html index a2b450223da..af1236ebf7c 100644 --- a/layouts/partials/doors/article_card.html +++ b/layouts/partials/doors/article_card.html @@ -1,25 +1,32 @@ -{{/* One article as a news-list card (section/post.html): its picture, or the brick panel a newsletter has on the - news list, then its date and title, linked as a whole. Input: dict "page", and "rel" ("prev", "next" or ""), - which labels the card Previous or Next. */}} +{{/* One article as a news-list card (section/post.html): its picture, or the brick panel a newsletter or + picture-less post has on the news list (stating each fact once), then its metadata and title, linked as a whole. + Input: dict "page", and "rel" ("prev", "next" or ""), which labels the card Previous or Next. */}} {{ $p := .page }} {{ $cat := "" }}{{ if eq $p.Type "post" }}{{ with $p.Params.categories }}{{ $cat = index . 0 }}{{ end }}{{ end }} {{ $tone := cond (eq $p.Type "post") (index (partialCached "doors/post_panels" site "post-panels") $p.RelPermalink) false }} {{ $img := (($p.Resources.ByType "image").GetMatch "*featured*") }} -
    +{{ $issue := and (eq $p.Type "post") $tone (eq (lower $cat) "newsletter") }} +
    {{ if and $img (not $tone) }} {{ partial "doors/card_picture" (dict "img" $img "lazy" true "alt" $p.Params.image.alt_text "figures" (eq $p.Type "educators-corner")) }} + {{ else if $issue }} + {{/* Newsletter brick: names the issue once as the card's linked title, matching section/post.html. */}} + + {{ else if eq $p.Type "post" }} + {{/* Picture-less news post: brick names the category once (exposed to screen readers as the category chip); metadata below gives date and any Previous/Next label. */}} +
    {{ $cat | default "News" }}
    {{ else }} - {{/* A news post's panel takes its brick colour from the news list; an Educators' Corner or Pedagogies article - without a picture takes education's colour (DESIGN.md §6). */}} {{/* An education article's panel would only repeat the band's heading and the card's date, so it shows a door. */}} - {{ if eq $p.Type "post" }} - - {{ else }} - {{ end }} {{ end }}
    + {{ if $issue }} +

    {{ $p.Summary | plainify | emojify }}

    + {{ else }}

    {{ with .rel }}{{ cond (eq . "prev") "Previous" "Next" }}{{ else }}{{ if and $img (not $tone) }}{{ with $cat }}{{ . }}{{ end }}{{ end }}{{ end }}

    {{ $p.Title }}

    + {{ end }}
    diff --git a/layouts/partials/doors/article_header.html b/layouts/partials/doors/article_header.html index f1d2d810c63..2f38b912ffa 100644 --- a/layouts/partials/doors/article_header.html +++ b/layouts/partials/doors/article_header.html @@ -31,6 +31,7 @@ {{/* The side card carries the date on a wide screen; on a narrow one it would come after the article. */}} {{ if and (in (slice "post" "educators-corner" "pedagogies") .Type) (not .Date.IsZero) }}{{ end }} {{ if and (eq .Type "post") (ge .ReadingTime 3) }}{{ end }} + {{ if and (in (slice "post" "educators-corner" "pedagogies") .Type) (not .Date.IsZero) (ne (.Lastmod.Format "2006-01-02") (.Date.Format "2006-01-02")) }}{{ end }}
    {{/* A pedagogy's materials (syllabus, slides, videos, the interview) are what a teacher came for: bricks, each saying where it leads (DESIGN.md §4 action cards). */}} diff --git a/layouts/partials/doors/crumbs.html b/layouts/partials/doors/crumbs.html index b5f267eeba5..7cb34a6d192 100644 --- a/layouts/partials/doors/crumbs.html +++ b/layouts/partials/doors/crumbs.html @@ -9,11 +9,11 @@ {{ range site.Menus.main }} {{ $top := . }} {{ if eq (strings.TrimSuffix "/" (.URL | relLangURL)) $here }} - {{ $label = .Name }} + {{ if not $.label }}{{ $label = .Name }}{{ end }} {{ else }} {{ range .Children }} {{ if eq (strings.TrimSuffix "/" (.URL | relLangURL)) $here }} - {{ $label = .Name }} + {{ if not $.label }}{{ $label = .Name }}{{ end }} {{ $parent = $top }} {{ end }} {{ end }} diff --git a/layouts/partials/doors/reading_card.html b/layouts/partials/doors/reading_card.html index 32ff8503168..6038b2bc59d 100644 --- a/layouts/partials/doors/reading_card.html +++ b/layouts/partials/doors/reading_card.html @@ -17,9 +17,13 @@ {{ if and $article (eq $p.Type "post") (in ($p.Params.categories | default slice) "Newsletter") }} {{ with site.GetPage "/newsletters" }}{{ $more = .RelPermalink }}{{ $moreLabel = "All newsletters" }}{{ end }} {{ end }} +{{/* On an ordinary news post authored only by FORRT (no newsletter archive link, contents list or citation), a + side card would only repeat the FORRT byline and dates, so it is omitted (the byline shows the date). */}} +{{ $forrtOnly := and $article (eq $p.Type "post") (not $more) (le (len .headings) 1) (not $p.Params.cite_as) (or (not $p.Params.authors) (and (eq (len $p.Params.authors) 1) (eq (lower (index $p.Params.authors 0)) "forrt"))) }} {{/* On a narrow screen the byline shows the publication date for these types (doors/article_header), and the phone contents replace the card's, so a card with nothing more than that date is left out there (article.css). */}} {{ $repeats := and .hasDates (not $updated) $article (not $p.Date.IsZero) (not $authors) (not $more) }} +{{ if not $forrtOnly }}
    {{/* With several authors and a contents list, or more than three authors, the authors go compact (every name, linked), so the card keeps the whole contents in view; the byline beside it then leaves the names out. Photos show only @@ -78,3 +82,4 @@

    Cite as

    {{ end }} +{{ end }} diff --git a/layouts/partials/doors/resource_keywords.html b/layouts/partials/doors/resource_keywords.html index 65d73d0410e..6c95755082d 100644 --- a/layouts/partials/doors/resource_keywords.html +++ b/layouts/partials/doors/resource_keywords.html @@ -1,16 +1,21 @@ -{{/* A resource's tags as one line of keywords. On a resource they describe it, so every tag shows, rare ones - included: a tag on at least `min` pages (functions/tag_counts.html) links to its list on /tags/, and a rarer one, - whose list would hold a page or two, is plain text. Elsewhere `tags` shows only the common ones, as chips. */}} +{{/* A resource's tags as keywords. Tags with a tag page (at least `min` pages in functions/tag_counts.html) link + to /tags/; rarer tags follow separately in plain body text so they never read as broken links between links. */}} {{ $tc := partialCached "functions/tag_counts.html" . }} -{{ $words := slice }} +{{ $linked := slice }} +{{ $plain := slice }} {{ range partial "functions/page_tags.html" . }} {{ $n := int (index $tc.counts (lower .) | default 0) }} {{/* A site-wide tag (on more than `max` pages) describes nothing here, so it is left out. */}} {{ if gt $n $tc.max }}{{ continue }}{{ end }} {{ if ge $n $tc.min }} - {{ $words = $words | append (printf `%s` (printf "tags/?tag=%s" (. | urlquery) | relURL) (. | htmlEscape)) }} + {{ $linked = $linked | append (printf `%s` (printf "tags/?tag=%s" (. | urlquery) | relURL) (. | htmlEscape)) }} {{ else }} - {{ $words = $words | append (. | htmlEscape) }} + {{ $plain = $plain | append . }} {{ end }} {{ end }} -{{ with $words }}

    Keywords {{ delimit . " · " | safeHTML }}

    {{ end }} +{{ if or $linked $plain }} +

    + {{- with $linked }}Keywords {{ delimit . `` | safeHTML }}{{ end -}} + {{- with $plain }}{{ if $linked }}Other keywords {{ delimit . ", " }}{{ else }}Keywords {{ delimit . ", " }}{{ end }}{{ end -}} +

    +{{ end }} diff --git a/layouts/resources/list.html b/layouts/resources/list.html index 4b25dd313dd..42e9e5e2667 100644 --- a/layouts/resources/list.html +++ b/layouts/resources/list.html @@ -10,7 +10,7 @@ {{ $plate := resources.Get "images/doors/area-education.webp" }}
    - {{ partial "doors/crumbs" (dict "page" .) }} + {{ partial "doors/crumbs" (dict "page" . "label" .Params.heading) }}

    {{ .Params.heading }}

    @@ -39,12 +39,12 @@

    Ready to teach with

    - Filter by type, level and cluster + Filter by type, level and cluster {{ range $index.facets }}
    {{ .name }}
    - {{ range .values }}{{ end }} + {{ range .values }}{{ end }}
    {{ end }} @@ -65,7 +65,7 @@

    Ready to teach with

    -

    {{ if gt $pager.TotalPages 1 }}{{ $first := add 1 (mul (sub $pager.PageNumber 1) $pager.PagerSize) }}Showing {{ lang.FormatNumber 0 $first }}–{{ lang.FormatNumber 0 (math.Min $total (add $first (sub $pager.PagerSize 1))) }} of {{ lang.FormatNumber 0 $total }} resources, A to Z{{ else }}Showing all {{ lang.FormatNumber 0 $total }} resources, A to Z{{ end }}

    +

    {{ if gt $pager.TotalPages 1 }}{{ $first := add 1 (mul (sub $pager.PageNumber 1) $pager.PagerSize) }}Showing {{ lang.FormatNumber 0 $first }}–{{ lang.FormatNumber 0 (math.Min $total (add $first (sub $pager.PagerSize 1))) }} of {{ lang.FormatNumber 0 $total }} resources, A to Z{{ else }}Showing all {{ lang.FormatNumber 0 $total }} resources, A to Z{{ end }}

    {{ partial "doors/pager_top" $pager }} @@ -87,6 +87,8 @@

    No resources match these filters.

    Missing a resource?

    Suggest a resource through our form

    +
    +
    How the collection grew{{ .Content }}
    diff --git a/scripts/tests/test_doors_polish.py b/scripts/tests/test_doors_polish.py new file mode 100644 index 00000000000..b712a29ab31 --- /dev/null +++ b/scripts/tests/test_doors_polish.py @@ -0,0 +1,56 @@ +"""Regression tests for Doors template/CSS/JS polish fixes (#1196, #1246).""" +from pathlib import Path +import re +import unittest + +ROOT = Path(__file__).resolve().parents[2] + + +class DoorsPolishContractTests(unittest.TestCase): + def test_disciplines_doi_links_use_accessible_link_token(self): + css = (ROOT / "assets/css/doors/clusters.css").read_text(encoding="utf-8") + self.assertNotIn("#1c7ed6", css, "Low-contrast #1c7ed6 should stay replaced by var(--link)") + self.assertIn(".rl-pill-count{font-size:14px", css) + self.assertIn(".disciplines-foot{", css) + + def test_citations_authors_threshold_and_honest_incomplete_label(self): + tpl = (ROOT / "layouts/partials/citations/authors.html").read_text(encoding="utf-8") + self.assertIn("(gt $count 6)", tpl) + self.assertIn("Show all %d authors", tpl) + self.assertIn("Show listed authors", tpl) + self.assertNotIn("Show more authors", tpl) + self.assertNotIn("Show all %d+ authors", tpl) + self.assertIn('lang="ar" dir="rtl"', tpl) + + def test_article_card_pictureless_news_category_is_accessible(self): + tpl = (ROOT / "layouts/partials/doors/article_card.html").read_text(encoding="utf-8") + self.assertIn('
    ', tpl) + self.assertNotIn('ac-panel-{{ $tone | default 1 }}" aria-hidden="true"', tpl) + + def test_forrt_only_news_keeps_updated_date_in_byline(self): + hdr = (ROOT / "layouts/partials/doors/article_header.html").read_text(encoding="utf-8") + css = (ROOT / "assets/css/doors/article.css").read_text(encoding="utf-8") + self.assertIn('class="byline-updated"', hdr) + self.assertIn(".article-layout:not(:has(>.article-card)) :is(.byline-date,.byline-updated){display:inline}", css) + + def test_edu_read_next_mobile_avoids_cropping_figures(self): + css = (ROOT / "assets/css/doors/article.css").read_text(encoding="utf-8") + self.assertIn(".read-next-edu .ac-thumb:not(.ec-thumb-whole) img{width:100%;height:auto;min-height:0;object-fit:contain}", css) + + def test_resource_keywords_plain_text_not_double_escaped(self): + tpl = (ROOT / "layouts/partials/doors/resource_keywords.html").read_text(encoding="utf-8") + self.assertIn("{{ $plain = $plain | append . }}", tpl) + self.assertIn("Other keywords", tpl) + + def test_crumbs_honors_explicit_label(self): + tpl = (ROOT / "layouts/partials/doors/crumbs.html").read_text(encoding="utf-8") + self.assertEqual(len(re.findall(r"if not \$\.label", tpl)), 2) + + def test_clusters_default_count_explains_hidden_specialist_items(self): + js = (ROOT / "static/js/featured-resources.js").read_text(encoding="utf-8") + self.assertIn("specialist hidden", js) + self.assertIn("if (isFiltered)", js) + + +if __name__ == "__main__": + unittest.main() diff --git a/static/js/featured-resources.js b/static/js/featured-resources.js index d34061f848c..17dbbb4edeb 100644 --- a/static/js/featured-resources.js +++ b/static/js/featured-resources.js @@ -760,9 +760,12 @@ if (!container && !ownText.trim()) return; + var countWrap = section.querySelector('.acc-count'); sectionCache.push({ el: section, countEl: section.querySelector('.acc-count-match'), + countWrap: countWrap, + totalCount: (countWrap && parseInt(countWrap.getAttribute('data-total'), 10)) || cards.length, header: header, body: body, chevron: header ? header.querySelector('.acc-chevron') : null, @@ -912,7 +915,21 @@ sec.cards[c].el.style.display = res.cardVis[c] ? '' : 'none'; } - if (sec.countEl) sec.countEl.textContent = res.matchCount; + if (sec.countWrap) { + if (isFiltered) { + sec.countWrap.textContent = res.matchCount + ' of ' + sec.totalCount + ' shown'; + sec.countWrap.title = 'References shown with the current filters, of all in this group'; + } else if (res.matchCount < sec.totalCount) { + var hiddenSpecialist = sec.totalCount - res.matchCount; + sec.countWrap.textContent = res.matchCount + (res.matchCount === 1 ? ' reference' : ' references') + ' (' + hiddenSpecialist + ' specialist hidden)'; + sec.countWrap.title = 'Tick "Show specialist resources" above to include specialist references'; + } else { + sec.countWrap.textContent = sec.totalCount + (sec.totalCount === 1 ? ' reference' : ' references'); + sec.countWrap.removeAttribute('title'); + } + } else if (sec.countEl) { + sec.countEl.textContent = res.matchCount; + } var header = sec.header; var body = sec.body; From 0feded92f6277516e6d1549fbeedeecc7ecfcbd8 Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Tue, 24 Nov 2026 10:27:45 +0000 Subject: [PATCH 2/7] Address cubic review feedback on mobile panels, UKRN logo sizing, embed width and tests --- assets/css/doors/article.css | 4 ++-- assets/css/doors/clusters.css | 2 +- content/lesson-plans/nd-lessons-plans.md | 2 +- scripts/tests/test_doors_polish.py | 21 +++++++++++++++------ 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/assets/css/doors/article.css b/assets/css/doors/article.css index dd29e8dd2d9..c0da9500dcd 100644 --- a/assets/css/doors/article.css +++ b/assets/css/doors/article.css @@ -671,8 +671,8 @@ html:has(.list-filter-section){scroll-padding-top:calc(var(--list-filter-bar,0px .read-next .announcement-card{flex-direction:row} .read-next .ac-thumb{display:flex;flex:0 0 112px} .read-next .ac-thumb:not(.ec-thumb-whole) img{width:112px;height:100%;min-height:112px;aspect-ratio:auto} - .read-next-edu .ac-thumb:not(.ec-thumb-whole){align-items:center;padding:6px;box-sizing:border-box;background:#fff} - .read-next-edu .ac-thumb:not(.ec-thumb-whole) img{width:100%;height:auto;min-height:0;object-fit:contain} + .read-next-edu .ac-thumb:not(.ec-thumb-whole,.ac-panel){align-items:center;padding:6px;box-sizing:border-box;background:#fff} + .read-next-edu .ac-thumb:not(.ec-thumb-whole,.ac-panel) img{width:100%;height:auto;min-height:0;object-fit:contain} .read-next .ec-thumb-whole{aspect-ratio:auto;min-height:112px} .read-next .ac-panel{aspect-ratio:auto;padding:12px} .read-next .ac-panel span{font-size:15px;line-height:1.2} diff --git a/assets/css/doors/clusters.css b/assets/css/doors/clusters.css index 24e55a56369..2c1eb4393f3 100644 --- a/assets/css/doors/clusters.css +++ b/assets/css/doors/clusters.css @@ -2397,7 +2397,7 @@ body.clusters-mobile-nav-open .clusters-back-to-top{display:none} .disciplines-foot__main .disciplines-form{margin:0 0 10px} .disciplines-foot__main .disciplines-attribution{margin:0;max-width:none} .disciplines-foot .disciplines-partner{display:flex;align-items:center;gap:12px;max-width:none;margin:0;text-align:start} -.disciplines-foot .disciplines-partner img{width:64px;height:64px;flex:none} +.disciplines-partner img{width:64px;height:64px;flex:none} .disciplines-foot .disciplines-partner__caption{margin:0;font-size:15px} @media (max-width:768px){ .disciplines-partner{display:flex;align-items:center;gap:12px;align-self:flex-start;max-width:none} diff --git a/content/lesson-plans/nd-lessons-plans.md b/content/lesson-plans/nd-lessons-plans.md index 3c6b26b09a9..69afaaff659 100644 --- a/content/lesson-plans/nd-lessons-plans.md +++ b/content/lesson-plans/nd-lessons-plans.md @@ -170,7 +170,7 @@ Contribute to [FORRT's Lesson Plans (Google sheets)](https://docs.google.com/spr
    -{{< click_to_load src="https://docs.google.com/spreadsheets/d/e/2PACX-1vRxqwa1rfgn-mB2hdCd3DzQHYMV7bOpQw6hRwXQodSnKjL1QvV4r5Aaf0kr-AVKc9zk60ejgDhZ-FLV/pubhtml?widget=true&headers=false" provider="Google" label="This document" title="Table of lesson plans" width="100%" height="700" >}} +{{< click_to_load src="https://docs.google.com/spreadsheets/d/e/2PACX-1vRxqwa1rfgn-mB2hdCd3DzQHYMV7bOpQw6hRwXQodSnKjL1QvV4r5Aaf0kr-AVKc9zk60ejgDhZ-FLV/pubhtml?widget=true&headers=false" provider="Google" label="This document" title="Table of lesson plans" height="700" style="width:100%;" >}}
    diff --git a/scripts/tests/test_doors_polish.py b/scripts/tests/test_doors_polish.py index b712a29ab31..5190b724430 100644 --- a/scripts/tests/test_doors_polish.py +++ b/scripts/tests/test_doors_polish.py @@ -10,6 +10,9 @@ class DoorsPolishContractTests(unittest.TestCase): def test_disciplines_doi_links_use_accessible_link_token(self): css = (ROOT / "assets/css/doors/clusters.css").read_text(encoding="utf-8") self.assertNotIn("#1c7ed6", css, "Low-contrast #1c7ed6 should stay replaced by var(--link)") + for selector in (".sc-description a", ".publication-item a", ".ref-doi-link", ".rl-detail-doi-link"): + pattern = rf"{re.escape(selector)}\s*\{{[^}}]*color:\s*var\(--link\)" + self.assertRegex(css, pattern, f"{selector} should use color: var(--link)") self.assertIn(".rl-pill-count{font-size:14px", css) self.assertIn(".disciplines-foot{", css) @@ -33,23 +36,29 @@ def test_forrt_only_news_keeps_updated_date_in_byline(self): self.assertIn('class="byline-updated"', hdr) self.assertIn(".article-layout:not(:has(>.article-card)) :is(.byline-date,.byline-updated){display:inline}", css) - def test_edu_read_next_mobile_avoids_cropping_figures(self): + def test_edu_read_next_mobile_avoids_cropping_figures_without_styling_panels(self): css = (ROOT / "assets/css/doors/article.css").read_text(encoding="utf-8") - self.assertIn(".read-next-edu .ac-thumb:not(.ec-thumb-whole) img{width:100%;height:auto;min-height:0;object-fit:contain}", css) + self.assertIn(".read-next-edu .ac-thumb:not(.ec-thumb-whole,.ac-panel){", css) + self.assertIn(".read-next-edu .ac-thumb:not(.ec-thumb-whole,.ac-panel) img{width:100%;height:auto;min-height:0;object-fit:contain}", css) - def test_resource_keywords_plain_text_not_double_escaped(self): + def test_resource_keywords_template_avoids_double_escape_on_plain_keywords(self): tpl = (ROOT / "layouts/partials/doors/resource_keywords.html").read_text(encoding="utf-8") self.assertIn("{{ $plain = $plain | append . }}", tpl) + self.assertNotIn("$plain | append (. | htmlEscape)", tpl) self.assertIn("Other keywords", tpl) def test_crumbs_honors_explicit_label(self): tpl = (ROOT / "layouts/partials/doors/crumbs.html").read_text(encoding="utf-8") self.assertEqual(len(re.findall(r"if not \$\.label", tpl)), 2) - def test_clusters_default_count_explains_hidden_specialist_items(self): + def test_clusters_default_count_gates_hidden_specialist_label_on_is_filtered(self): js = (ROOT / "static/js/featured-resources.js").read_text(encoding="utf-8") - self.assertIn("specialist hidden", js) - self.assertIn("if (isFiltered)", js) + pattern = ( + r"if \(sec\.countWrap\) \{\s*" + r"if \(isFiltered\) \{[^}]*' of '[^}]*\}\s*" + r"else if \(res\.matchCount < sec\.totalCount\) \{[^}]*specialist hidden" + ) + self.assertRegex(js, pattern) if __name__ == "__main__": From 498ab7d4d334f7643f6c72ced4f6722411ee6227 Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Tue, 24 Nov 2026 10:47:34 +0000 Subject: [PATCH 3/7] Treat incomplete 6-author-plus-others references as 7+ authors when collapsing --- layouts/partials/citations/authors.html | 4 +++- scripts/tests/test_doors_polish.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/layouts/partials/citations/authors.html b/layouts/partials/citations/authors.html index f5fc94512ca..6b741bd2388 100644 --- a/layouts/partials/citations/authors.html +++ b/layouts/partials/citations/authors.html @@ -33,7 +33,9 @@ {{- $marked := replaceRE `\bet al\.?|\bothers\b` "" (replaceRE $name "§" $plain) -}} {{/* Corporate authors such as "FORRT" are whatever is left between the separators. */}} {{- $count := add (len (findRE `§` $marked)) (len (findRE `[^\s,&…§.][^,&…§]*` $marked)) -}} - {{- with and (gt $count 6) (findRE (printf `^(?:%s\s*,\s*(?:&(?:amp;)?\s*)?){2}%s` $name $name) $authors 1) -}} + {{- /* Collapse only when at least four authors would be hidden: > 6 on a complete list, or >= 6 named authors plus "& others"/"et al."/"…" (7+ authors in total). */ -}} + {{- $collapse := cond $complete (gt $count 6) (ge $count 6) -}} + {{- with and $collapse (findRE (printf `^(?:%s\s*,\s*(?:&(?:amp;)?\s*)?){2}%s` $name $name) $authors 1) -}} {{- $first := index . 0 -}} {{- $more := cond $complete (printf $t.all $count) $t.listed -}} {{- $out = printf `%s, et al. %s` $first (strings.TrimPrefix $first $authors) $more $t.less $t.attr $more $after -}} diff --git a/scripts/tests/test_doors_polish.py b/scripts/tests/test_doors_polish.py index 5190b724430..8525154adf7 100644 --- a/scripts/tests/test_doors_polish.py +++ b/scripts/tests/test_doors_polish.py @@ -18,7 +18,7 @@ def test_disciplines_doi_links_use_accessible_link_token(self): def test_citations_authors_threshold_and_honest_incomplete_label(self): tpl = (ROOT / "layouts/partials/citations/authors.html").read_text(encoding="utf-8") - self.assertIn("(gt $count 6)", tpl) + self.assertIn("cond $complete (gt $count 6) (ge $count 6)", tpl) self.assertIn("Show all %d authors", tpl) self.assertIn("Show listed authors", tpl) self.assertNotIn("Show more authors", tpl) From be9b1fd2020b7b53db7d7ff4cdaf0e0e1051b866 Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Tue, 24 Nov 2026 17:34:17 +0000 Subject: [PATCH 4/7] Follow up on review: remove Include resources checkbox, revert keywords split, use Show all authors, restore FORRT card with optional Contact --- assets/css/doors/article.css | 3 +- assets/css/doors/resources.css | 4 --- layouts/partials/citations/authors.html | 12 ++++---- layouts/partials/disciplines/controls.html | 4 --- layouts/partials/doors/article_header.html | 1 - layouts/partials/doors/reading_card.html | 16 +++++----- layouts/partials/doors/resource_keywords.html | 19 +++++------- scripts/create_announcements.R | 8 ++++- scripts/tests/test_doors_polish.py | 29 ++++++++++--------- 9 files changed, 45 insertions(+), 51 deletions(-) diff --git a/assets/css/doors/article.css b/assets/css/doors/article.css index c0da9500dcd..6a0545f6217 100644 --- a/assets/css/doors/article.css +++ b/assets/css/doors/article.css @@ -355,8 +355,7 @@ main:lang(ar) .article-layout .article-style,main:lang(ar) .article-layout .arti .article-layout .article-style .btn-block{display:inline-block;width:auto} @media(max-width:1000px){.profile-head .profile-org{font-weight:400}.profile-head ul.network-icon{margin:4px 0 0}.profile-head ul.network-icon a{text-decoration:none}} .article-layout .article-style .btn.btn-primary,.article-layout .article-style .btn.btn-lg{padding:10px 22px!important;font-size:17px!important} -.byline-date,.byline-updated{display:none} -.article-layout:not(:has(>.article-card)) :is(.byline-date,.byline-updated){display:inline} +.byline-date{display:none} @media(max-width:1000px){.article-layout .byline-date{display:inline}} /* A search over a long list on the page (shortcodes/list_filter.html). */ .article-layout :is(.article-style .list-filter,.list-filter-posts){max-width:520px;margin:8px 0 22px;padding:16px 18px;background:var(--surface);border-radius:var(--r-large)} diff --git a/assets/css/doors/resources.css b/assets/css/doors/resources.css index a566779ead9..170fc748f48 100644 --- a/assets/css/doors/resources.css +++ b/assets/css/doors/resources.css @@ -57,10 +57,6 @@ .collection-history{margin-top:24px;padding-top:16px;border-top:1px solid var(--line);max-width:44em} .collection-about p{font-size:16px;line-height:1.55;margin-top:16px} .collection-about a{color:var(--link);text-decoration:underline;text-underline-offset:3px} -/* Keywords on resource pages: non-linked rarer keywords sit cleanly in body ink, separated from linked tags so they never read as broken links. */ -.article-layout .resource-keywords{color:var(--ink)} -.article-layout .resource-keywords-plain{display:block;margin-top:4px;color:var(--ink)} -.article-layout .resource-keywords-sep{color:var(--soft)} @media(max-width:1000px){ .directory{grid-template-columns:minmax(0,250px) minmax(0,1fr);gap:28px} diff --git a/layouts/partials/citations/authors.html b/layouts/partials/citations/authors.html index 6b741bd2388..c7e6b22d890 100644 --- a/layouts/partials/citations/authors.html +++ b/layouts/partials/citations/authors.html @@ -12,11 +12,11 @@ {{- end -}} {{- $html := trim (string $raw) " \n\r\t" -}} {{- $i18n := dict - "english" (dict "all" "Show all %d authors" "listed" "Show listed authors" "less" "Show fewer authors" "attr" "") - "arabic" (dict "all" "عرض جميع المؤلفين (%d)" "listed" "عرض المؤلفين المدرجين" "less" "إخفاء المؤلفين" "attr" ` lang="ar" dir="rtl"`) - "german" (dict "all" "Alle %d Autor:innen anzeigen" "listed" "Aufgeführte Autor:innen anzeigen" "less" "Weniger Autor:innen anzeigen" "attr" "") - "turkish" (dict "all" "Tüm %d yazarı göster" "listed" "Listelenen yazarları göster" "less" "Daha az yazar göster" "attr" "") - "chinese" (dict "all" "显示全部 %d 位作者" "listed" "显示已列出的作者" "less" "收起作者" "attr" "") + "english" (dict "all" "Show all %d authors" "more" "Show all authors" "less" "Show fewer authors" "attr" "") + "arabic" (dict "all" "عرض جميع المؤلفين (%d)" "more" "عرض جميع المؤلفين" "less" "إخفاء المؤلفين" "attr" ` lang="ar" dir="rtl"`) + "german" (dict "all" "Alle %d Autor:innen anzeigen" "more" "Alle Autor:innen anzeigen" "less" "Weniger Autor:innen anzeigen" "attr" "") + "turkish" (dict "all" "Tüm %d yazarı göster" "more" "Tüm yazarları göster" "less" "Daha az yazar göster" "attr" "") + "chinese" (dict "all" "显示全部 %d 位作者" "more" "显示全部作者" "less" "收起作者" "attr" "") -}} {{- $t := index $i18n $lang | default (index $i18n "english") -}} {{/* A surname and initials, with "Jr." or a particle where the bibliography generator puts them: @@ -37,7 +37,7 @@ {{- $collapse := cond $complete (gt $count 6) (ge $count 6) -}} {{- with and $collapse (findRE (printf `^(?:%s\s*,\s*(?:&(?:amp;)?\s*)?){2}%s` $name $name) $authors 1) -}} {{- $first := index . 0 -}} - {{- $more := cond $complete (printf $t.all $count) $t.listed -}} + {{- $more := cond $complete (printf $t.all $count) $t.more -}} {{- $out = printf `%s, et al. %s` $first (strings.TrimPrefix $first $authors) $more $t.less $t.attr $more $after -}} {{- end -}} {{- end -}} diff --git a/layouts/partials/disciplines/controls.html b/layouts/partials/disciplines/controls.html index fb7a66f399d..755253edcc3 100644 --- a/layouts/partials/disciplines/controls.html +++ b/layouts/partials/disciplines/controls.html @@ -7,10 +7,6 @@ -
    diff --git a/layouts/partials/doors/article_header.html b/layouts/partials/doors/article_header.html index 2f38b912ffa..f1d2d810c63 100644 --- a/layouts/partials/doors/article_header.html +++ b/layouts/partials/doors/article_header.html @@ -31,7 +31,6 @@ {{/* The side card carries the date on a wide screen; on a narrow one it would come after the article. */}} {{ if and (in (slice "post" "educators-corner" "pedagogies") .Type) (not .Date.IsZero) }}{{ end }} {{ if and (eq .Type "post") (ge .ReadingTime 3) }}{{ end }} - {{ if and (in (slice "post" "educators-corner" "pedagogies") .Type) (not .Date.IsZero) (ne (.Lastmod.Format "2006-01-02") (.Date.Format "2006-01-02")) }}{{ end }}
    {{/* A pedagogy's materials (syllabus, slides, videos, the interview) are what a teacher came for: bricks, each saying where it leads (DESIGN.md §4 action cards). */}} diff --git a/layouts/partials/doors/reading_card.html b/layouts/partials/doors/reading_card.html index 6038b2bc59d..e5aee2fe6f3 100644 --- a/layouts/partials/doors/reading_card.html +++ b/layouts/partials/doors/reading_card.html @@ -17,13 +17,9 @@ {{ if and $article (eq $p.Type "post") (in ($p.Params.categories | default slice) "Newsletter") }} {{ with site.GetPage "/newsletters" }}{{ $more = .RelPermalink }}{{ $moreLabel = "All newsletters" }}{{ end }} {{ end }} -{{/* On an ordinary news post authored only by FORRT (no newsletter archive link, contents list or citation), a - side card would only repeat the FORRT byline and dates, so it is omitted (the byline shows the date). */}} -{{ $forrtOnly := and $article (eq $p.Type "post") (not $more) (le (len .headings) 1) (not $p.Params.cite_as) (or (not $p.Params.authors) (and (eq (len $p.Params.authors) 1) (eq (lower (index $p.Params.authors 0)) "forrt"))) }} {{/* On a narrow screen the byline shows the publication date for these types (doors/article_header), and the phone contents replace the card's, so a card with nothing more than that date is left out there (article.css). */}} -{{ $repeats := and .hasDates (not $updated) $article (not $p.Date.IsZero) (not $authors) (not $more) }} -{{ if not $forrtOnly }} +{{ $repeats := and .hasDates (not $updated) $article (not $p.Date.IsZero) (not $authors) (not $more) (not $p.Params.contact) }}
    {{/* With several authors and a contents list, or more than three authors, the authors go compact (every name, linked), so the card keeps the whole contents in view; the byline beside it then leaves the names out. Photos show only @@ -60,10 +56,17 @@ {{ end }} {{ end }} - {{ if .hasDates }} + {{ if or .hasDates $p.Params.contact }}
    + {{ with $p.Params.contact }} + {{ $contact := trim (string .) " " }} + {{ $contactProfile := site.GetPage (printf "/authors/%s" (urlize $contact)) }} +
    Contact
    {{ if $contactProfile }}{{ $contactProfile.Title }}{{ else if findRE `^[^\s@]+@[^\s@]+\.[^\s@]+$` $contact }}{{ $contact }}{{ else }}{{ $contact | markdownify }}{{ end }}
    + {{ end }} + {{ if .hasDates }}
    Published
    {{ $p.Date.Format "2 January 2006" }}
    {{ if $updated }}
    Updated
    {{ $p.Lastmod.Format "2 January 2006" }}
    {{ end }} + {{ end }}
    {{ end }} {{ with $more }}

    {{ $moreLabel }}

    {{ end }} @@ -82,4 +85,3 @@

    Cite as

    {{ end }} -{{ end }} diff --git a/layouts/partials/doors/resource_keywords.html b/layouts/partials/doors/resource_keywords.html index 6c95755082d..65d73d0410e 100644 --- a/layouts/partials/doors/resource_keywords.html +++ b/layouts/partials/doors/resource_keywords.html @@ -1,21 +1,16 @@ -{{/* A resource's tags as keywords. Tags with a tag page (at least `min` pages in functions/tag_counts.html) link - to /tags/; rarer tags follow separately in plain body text so they never read as broken links between links. */}} +{{/* A resource's tags as one line of keywords. On a resource they describe it, so every tag shows, rare ones + included: a tag on at least `min` pages (functions/tag_counts.html) links to its list on /tags/, and a rarer one, + whose list would hold a page or two, is plain text. Elsewhere `tags` shows only the common ones, as chips. */}} {{ $tc := partialCached "functions/tag_counts.html" . }} -{{ $linked := slice }} -{{ $plain := slice }} +{{ $words := slice }} {{ range partial "functions/page_tags.html" . }} {{ $n := int (index $tc.counts (lower .) | default 0) }} {{/* A site-wide tag (on more than `max` pages) describes nothing here, so it is left out. */}} {{ if gt $n $tc.max }}{{ continue }}{{ end }} {{ if ge $n $tc.min }} - {{ $linked = $linked | append (printf `%s` (printf "tags/?tag=%s" (. | urlquery) | relURL) (. | htmlEscape)) }} + {{ $words = $words | append (printf `%s` (printf "tags/?tag=%s" (. | urlquery) | relURL) (. | htmlEscape)) }} {{ else }} - {{ $plain = $plain | append . }} + {{ $words = $words | append (. | htmlEscape) }} {{ end }} {{ end }} -{{ if or $linked $plain }} -

    - {{- with $linked }}Keywords {{ delimit . `` | safeHTML }}{{ end -}} - {{- with $plain }}{{ if $linked }}Other keywords {{ delimit . ", " }}{{ else }}Keywords {{ delimit . ", " }}{{ end }}{{ end -}} -

    -{{ end }} +{{ with $words }}

    Keywords {{ delimit . " · " | safeHTML }}

    {{ end }} diff --git a/scripts/create_announcements.R b/scripts/create_announcements.R index 25fe24d61b0..dbb2816ffa9 100644 --- a/scripts/create_announcements.R +++ b/scripts/create_announcements.R @@ -10,7 +10,7 @@ # Run on a schedule by .github/workflows/create_announcements.yml. # # Sheet columns: Slug, Title, Description, imageUrl, webUrl, LinkText, Date, -# Author, Category, Show +# Author, Category, Show (optional: Contact) library(googlesheets4) library(httr) @@ -161,6 +161,11 @@ get_image <- function(url, bundle_dir) { # Writes content/post//index.md for one sheet row (a named list) and fetches its image. create_post <- function(row) { date <- row[["Date"]] + contact <- if ("Contact" %in% names(row) && !is.null(row[["Contact"]]) && !is.na(row[["Contact"]])) { + trimws(as.character(row[["Contact"]])) + } else { + "" + } post_content <- paste0( "---\n", "title: \"", row["Title"], "\"\n", @@ -169,6 +174,7 @@ create_post <- function(row) { "categories:\n", " - ", row["Category"], "\n", "authors: [\"", row["Author"], "\"]\n", + if (nzchar(contact)) paste0("contact: \"", gsub("\"", "\\\\\"", contact), "\"\n") else "", "---\n\n", gsub("\n", "\n ", row["Description"]), "\n \n", # Spaces keep the sheet's line breaks in the rendered Markdown "\n\n", # Card teasers show only the text above this divider, so the link stays out of them diff --git a/scripts/tests/test_doors_polish.py b/scripts/tests/test_doors_polish.py index 8525154adf7..9f17f44601a 100644 --- a/scripts/tests/test_doors_polish.py +++ b/scripts/tests/test_doors_polish.py @@ -16,13 +16,18 @@ def test_disciplines_doi_links_use_accessible_link_token(self): self.assertIn(".rl-pill-count{font-size:14px", css) self.assertIn(".disciplines-foot{", css) - def test_citations_authors_threshold_and_honest_incomplete_label(self): + def test_disciplines_search_removes_include_resources_checkbox(self): + tpl = (ROOT / "layouts/partials/disciplines/controls.html").read_text(encoding="utf-8") + self.assertNotIn("clusters-search-include-refs", tpl) + self.assertNotIn("Include resources", tpl) + + def test_citations_authors_threshold_and_labels(self): tpl = (ROOT / "layouts/partials/citations/authors.html").read_text(encoding="utf-8") self.assertIn("cond $complete (gt $count 6) (ge $count 6)", tpl) self.assertIn("Show all %d authors", tpl) - self.assertIn("Show listed authors", tpl) + self.assertIn("Show all authors", tpl) self.assertNotIn("Show more authors", tpl) - self.assertNotIn("Show all %d+ authors", tpl) + self.assertNotIn("Show listed authors", tpl) self.assertIn('lang="ar" dir="rtl"', tpl) def test_article_card_pictureless_news_category_is_accessible(self): @@ -30,23 +35,19 @@ def test_article_card_pictureless_news_category_is_accessible(self): self.assertIn('
    ', tpl) self.assertNotIn('ac-panel-{{ $tone | default 1 }}" aria-hidden="true"', tpl) - def test_forrt_only_news_keeps_updated_date_in_byline(self): - hdr = (ROOT / "layouts/partials/doors/article_header.html").read_text(encoding="utf-8") - css = (ROOT / "assets/css/doors/article.css").read_text(encoding="utf-8") - self.assertIn('class="byline-updated"', hdr) - self.assertIn(".article-layout:not(:has(>.article-card)) :is(.byline-date,.byline-updated){display:inline}", css) + def test_reading_card_keeps_forrt_box_and_supports_contact(self): + card = (ROOT / "layouts/partials/doors/reading_card.html").read_text(encoding="utf-8") + self.assertNotIn("$forrtOnly", card) + self.assertIn("$p.Params.contact", card) + self.assertIn("
    Contact
    ", card) + ann = (ROOT / "scripts/create_announcements.R").read_text(encoding="utf-8") + self.assertIn('"Contact" %in% names(row)', ann) def test_edu_read_next_mobile_avoids_cropping_figures_without_styling_panels(self): css = (ROOT / "assets/css/doors/article.css").read_text(encoding="utf-8") self.assertIn(".read-next-edu .ac-thumb:not(.ec-thumb-whole,.ac-panel){", css) self.assertIn(".read-next-edu .ac-thumb:not(.ec-thumb-whole,.ac-panel) img{width:100%;height:auto;min-height:0;object-fit:contain}", css) - def test_resource_keywords_template_avoids_double_escape_on_plain_keywords(self): - tpl = (ROOT / "layouts/partials/doors/resource_keywords.html").read_text(encoding="utf-8") - self.assertIn("{{ $plain = $plain | append . }}", tpl) - self.assertNotIn("$plain | append (. | htmlEscape)", tpl) - self.assertIn("Other keywords", tpl) - def test_crumbs_honors_explicit_label(self): tpl = (ROOT / "layouts/partials/doors/crumbs.html").read_text(encoding="utf-8") self.assertEqual(len(re.findall(r"if not \$\.label", tpl)), 2) From 965134fa20ffc603e0d44b8379a20c3fe7ea20a6 Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Tue, 24 Nov 2026 17:42:45 +0000 Subject: [PATCH 5/7] Parse Name (email) contacts in reading_card.html into profile and mailto links --- layouts/partials/doors/reading_card.html | 16 +++++++++++++++- scripts/tests/test_doors_polish.py | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/layouts/partials/doors/reading_card.html b/layouts/partials/doors/reading_card.html index e5aee2fe6f3..69a3a77492b 100644 --- a/layouts/partials/doors/reading_card.html +++ b/layouts/partials/doors/reading_card.html @@ -60,8 +60,22 @@
    {{ with $p.Params.contact }} {{ $contact := trim (string .) " " }} + {{ $pair := findRESubmatch `^(.+?)\s*[(\<]([^\s@()<>]+@[^\s@()<>]+\.[^\s@()<>]+)[)\>]$` $contact 1 }} {{ $contactProfile := site.GetPage (printf "/authors/%s" (urlize $contact)) }} -
    Contact
    {{ if $contactProfile }}{{ $contactProfile.Title }}{{ else if findRE `^[^\s@]+@[^\s@]+\.[^\s@]+$` $contact }}{{ $contact }}{{ else }}{{ $contact | markdownify }}{{ end }}
    +
    Contact
    + {{- if $pair -}} + {{- $name := trim (index (index $pair 0) 1) " " -}} + {{- $email := index (index $pair 0) 2 -}} + {{- $np := site.GetPage (printf "/authors/%s" (urlize $name)) -}} + {{- if $np }}{{ $np.Title }}{{ else }}{{ $name }}{{ end }}
    {{ $email }} + {{- else if $contactProfile -}} + {{ $contactProfile.Title }} + {{- else if findRE `^[^\s@]+@[^\s@]+\.[^\s@]+$` $contact -}} + {{ $contact }} + {{- else -}} + {{ $contact | markdownify }} + {{- end -}} +
    {{ end }} {{ if .hasDates }}
    Published
    {{ $p.Date.Format "2 January 2006" }}
    diff --git a/scripts/tests/test_doors_polish.py b/scripts/tests/test_doors_polish.py index 9f17f44601a..6f1b2389e57 100644 --- a/scripts/tests/test_doors_polish.py +++ b/scripts/tests/test_doors_polish.py @@ -40,6 +40,7 @@ def test_reading_card_keeps_forrt_box_and_supports_contact(self): self.assertNotIn("$forrtOnly", card) self.assertIn("$p.Params.contact", card) self.assertIn("
    Contact
    ", card) + self.assertIn("mailto:{{ $email }}", card) ann = (ROOT / "scripts/create_announcements.R").read_text(encoding="utf-8") self.assertIn('"Contact" %in% names(row)', ann) From 2fef8e6b64d65343b26670c4de7c8ebb32bd9ef4 Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Tue, 24 Nov 2026 17:45:52 +0000 Subject: [PATCH 6/7] Show contact email as envelope icon instead of raw address text --- assets/css/doors/article.css | 3 +++ layouts/partials/doors/reading_card.html | 8 +++++--- scripts/tests/test_doors_polish.py | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/assets/css/doors/article.css b/assets/css/doors/article.css index 6a0545f6217..08ff4c9e911 100644 --- a/assets/css/doors/article.css +++ b/assets/css/doors/article.css @@ -622,6 +622,9 @@ html:has(.list-filter-section){scroll-padding-top:calc(var(--list-filter-bar,0px .article-layout .card-authors .network-icon a{display:flex;align-items:center;justify-content:center;width:34px;height:34px;color:var(--link);font-size:17px} .article-layout .card-authors .network-icon a:hover{color:var(--ink)} .article-layout .card-authors .network-icon .ai-google-scholar{font-size:21px;line-height:1;-webkit-text-stroke:.35px currentColor} +.article-layout .article-card .card-contact{display:flex;align-items:center;flex-wrap:wrap;gap:4px} +.article-layout .article-card .card-contact-email{display:inline-flex;align-items:center;justify-content:center;min-width:32px;min-height:32px;color:var(--link);font-size:16px;text-decoration:none} +.article-layout .article-card .card-contact-email:hover{color:var(--ink)} .article-layout .card-more{margin:0 0 4px} .article-layout .card-more a{display:inline-block;padding:11px 0;font-weight:600;color:var(--link);text-decoration:underline;text-underline-offset:3px} .article-layout .card-more a::after{content:"\2192";margin-inline-start:6px;text-decoration:none} diff --git a/layouts/partials/doors/reading_card.html b/layouts/partials/doors/reading_card.html index 69a3a77492b..1047ad45320 100644 --- a/layouts/partials/doors/reading_card.html +++ b/layouts/partials/doors/reading_card.html @@ -62,16 +62,18 @@ {{ $contact := trim (string .) " " }} {{ $pair := findRESubmatch `^(.+?)\s*[(\<]([^\s@()<>]+@[^\s@()<>]+\.[^\s@()<>]+)[)\>]$` $contact 1 }} {{ $contactProfile := site.GetPage (printf "/authors/%s" (urlize $contact)) }} -
    Contact
    +
    Contact
    {{- if $pair -}} {{- $name := trim (index (index $pair 0) 1) " " -}} {{- $email := index (index $pair 0) 2 -}} {{- $np := site.GetPage (printf "/authors/%s" (urlize $name)) -}} - {{- if $np }}{{ $np.Title }}{{ else }}{{ $name }}{{ end }}
    {{ $email }} + {{- $label := $name -}}{{- with $np -}}{{- $label = .Title -}}{{- end -}} + {{- if $np }}{{ $np.Title }}{{ else }}{{ $name }}{{ end }} + {{- else if $contactProfile -}} {{ $contactProfile.Title }} {{- else if findRE `^[^\s@]+@[^\s@]+\.[^\s@]+$` $contact -}} - {{ $contact }} + {{- else -}} {{ $contact | markdownify }} {{- end -}} diff --git a/scripts/tests/test_doors_polish.py b/scripts/tests/test_doors_polish.py index 6f1b2389e57..f2b2f754a6c 100644 --- a/scripts/tests/test_doors_polish.py +++ b/scripts/tests/test_doors_polish.py @@ -41,6 +41,8 @@ def test_reading_card_keeps_forrt_box_and_supports_contact(self): self.assertIn("$p.Params.contact", card) self.assertIn("
    Contact
    ", card) self.assertIn("mailto:{{ $email }}", card) + self.assertIn('class="fas fa-envelope"', card) + self.assertNotIn("{{ $email }}", card) ann = (ROOT / "scripts/create_announcements.R").read_text(encoding="utf-8") self.assertIn('"Contact" %in% names(row)', ann) From fb42e65516f55ebe373267d63471a57b33254027 Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Tue, 24 Nov 2026 18:03:39 +0000 Subject: [PATCH 7/7] Address cubic feedback: 44px phone tap target for contact icon and test bare-email guard --- assets/css/doors/article.css | 2 +- scripts/tests/test_doors_polish.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/css/doors/article.css b/assets/css/doors/article.css index 54988485053..1e457d485c8 100644 --- a/assets/css/doors/article.css +++ b/assets/css/doors/article.css @@ -777,7 +777,7 @@ html:has(.list-filter-section){scroll-padding-top:calc(var(--list-filter-bar,0px .article-layout .card-authors .network-icon a:hover{color:var(--ink)} .article-layout .card-authors .network-icon .ai-google-scholar{font-size:21px;line-height:1;-webkit-text-stroke:.35px currentColor} .article-layout .article-card .card-contact{display:flex;align-items:center;flex-wrap:wrap;gap:4px} -.article-layout .article-card .card-contact-email{display:inline-flex;align-items:center;justify-content:center;min-width:32px;min-height:32px;color:var(--link);font-size:16px;text-decoration:none} +.article-layout .article-card .card-contact-email{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;color:var(--link);font-size:16px;text-decoration:none} .article-layout .article-card .card-contact-email:hover{color:var(--ink)} .article-layout .card-more{margin:0 0 4px} .article-layout .card-more a{display:inline-block;padding:11px 0;font-weight:600;color:var(--link);text-decoration:underline;text-underline-offset:3px} diff --git a/scripts/tests/test_doors_polish.py b/scripts/tests/test_doors_polish.py index f2b2f754a6c..aa3881415b5 100644 --- a/scripts/tests/test_doors_polish.py +++ b/scripts/tests/test_doors_polish.py @@ -43,6 +43,7 @@ def test_reading_card_keeps_forrt_box_and_supports_contact(self): self.assertIn("mailto:{{ $email }}", card) self.assertIn('class="fas fa-envelope"', card) self.assertNotIn("{{ $email }}", card) + self.assertNotIn("{{ $contact }}", card) ann = (ROOT / "scripts/create_announcements.R").read_text(encoding="utf-8") self.assertIn('"Contact" %in% names(row)', ann)