{{ .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
- 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
+ +
+
+ {{ 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..c7e6b22d890 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" "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: "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,18 @@ {{- $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) -}} + {{- /* 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 "Show all %d authors" $count) "Show more authors" -}} - {{- $out = printf `%s` $first (strings.TrimPrefix $first $authors) $more $more $after -}} + {{- $more := cond $complete (printf $t.all $count) $t.more -}} + {{- $out = printf `%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 -}} -
- {{ 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/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/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
-
-
-
-
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 }}
{{ $p.Title }}
+ {{ end }}
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.html b/layouts/partials/doors/reading.html
index 2c4b075748e..42b32ba0b01 100644
--- a/layouts/partials/doors/reading.html
+++ b/layouts/partials/doors/reading.html
@@ -30,7 +30,7 @@
{{ $hasDates := and .Params.date (not (in (slice "page") .Type)) }}
{{ $wide := in site.Params.doors.wide_pages .Path }}
{{ $lesson := and .IsPage (eq .Section "neurodiversity-lessonbank") }}
-{{ $hasCard := and (not $wide) (or $hasDates $lesson (gt (len $headings) 1)) }}
+{{ $hasCard := and (not $wide) (or $hasDates $lesson .Params.contact (gt (len $headings) 1)) }}
{{ $hasCallouts := and (not $wide) (strings.Contains $body `
- {{ 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/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/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
-
-
-
-
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 }}
{{ $p.Title }}
+ {{ end }}
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.html b/layouts/partials/doors/reading.html
index 2c4b075748e..42b32ba0b01 100644
--- a/layouts/partials/doors/reading.html
+++ b/layouts/partials/doors/reading.html
@@ -30,7 +30,7 @@
{{ $hasDates := and .Params.date (not (in (slice "page") .Type)) }}
{{ $wide := in site.Params.doors.wide_pages .Path }}
{{ $lesson := and .IsPage (eq .Section "neurodiversity-lessonbank") }}
-{{ $hasCard := and (not $wide) (or $hasDates $lesson (gt (len $headings) 1)) }}
+{{ $hasCard := and (not $wide) (or $hasDates $lesson .Params.contact (gt (len $headings) 1)) }}
{{ $hasCallouts := and (not $wide) (strings.Contains $body `
Supported by
- -
-
- {{ $p.Summary | plainify | emojify }}
+ {{ else }}