From 9bea2316b4fabd862f056866cd2dd017533f6f6b Mon Sep 17 00:00:00 2001
From: Camil Staps
Date: Wed, 14 May 2025 10:24:54 +0200
Subject: publications page: reduce generated size by turning pug mixin into
 javascript function
---
 resources/pug/finals/publications.pug | 164 +++++++++++++++++-----------------
 1 file changed, 81 insertions(+), 83 deletions(-)
(limited to 'resources')
diff --git a/resources/pug/finals/publications.pug b/resources/pug/finals/publications.pug
index be37638..e3d0939 100644
--- a/resources/pug/finals/publications.pug
+++ b/resources/pug/finals/publications.pug
@@ -15,93 +15,91 @@ block content
 		Journal articles are red; conference proceedings yellow; book chapters blue.
 		Light color indicates time waiting for reviews; dark color typesetting; diamonds date of publication.
 
-	-
-		const colors = {
-			bookchapter: {
-				review: '#3C59C2',
-				editing: '#010D3B',
-				published: '#010D3B'
-			},
-			confproceedings: {
-				review: '#FFCE2B',
-				editing: '#E1AE00',
-				published: '#E1AE00'
-			},
-			journalarticle: {
-				review: '#C5001F',
-				editing: '#53000D',
-				published: '#53000D'
-			},
-		};
-
 	#chart-publications
 
 	script(src='https://code.highcharts.com/gantt/highcharts-gantt.js')
 	script
-		| let shorttitles = [];
-		| let series = [];
-
-		mixin entry(type_, shorttitle, title, review_intervals, editing_intervals = [], published = {})
-			.
-				shorttitles.push(!{JSON.stringify(shorttitle)});
-
-				{
-					let data = [];
-					for (let interval of !{JSON.stringify(review_intervals)})
-						data.push({
-							start: Date.parse(interval[0]),
-							end: Date.parse(interval[1]) || Date.now(),
-							name: 'Review',
-							color: !{JSON.stringify(colors[type_]['review'])},
-							y: shorttitles.length - 1
-						});
-
-					for (let interval of !{JSON.stringify(editing_intervals)})
-						data.push({
-							start: Date.parse(interval[0]),
-							end: Date.parse(interval[1]) || Date.now(),
-							name: 'Copy editing',
-							color: !{JSON.stringify(colors[type_]['editing'])},
-							y: shorttitles.length - 1
-						});
-
-					let published = !{JSON.stringify(published)};
-					for (let way of Object.keys(published))
-						data.push({
-							start: Date.parse(published[way]),
-							milestone: true,
-							name: 'Published (' + way + ')',
-							color: !{JSON.stringify(colors[type_]['published'])},
-							y: shorttitles.length - 1
-						});
-
-					series.push({name: !{JSON.stringify(title)}, data: data, borderRadius: 0});
-				}
-
-		+entry('journalarticle', 'Orientalia (2018)', 'A case study of reciprocal middles in Biblical Hebrew: The niphal of לחם',
-			[['2017-11-8', '2017-11-28'], ['2017-12-21', '2018-1-4']], [['2018-1-9', '2018-1-24']], {print: '2018-12-1'})
-		+entry('journalarticle', 'JSS (2020)', 'Prepositions and the grammaticalization of Ancient Hebrew bipartite reciprocal markers (Journal of Semitic Studies)',
-			[['2018-3-9', '2018-5-1'], ['2018-5-8', '2018-5-21']], [['2018-5-21', '2019-12-16']], {print: '2020-2-17'})
-		+entry('journalarticle', 'JSOT (2020)', '“When dust was poured out”: Creation in Job 38.36–38 (Journal for the Study of the Old Testament)',
-			[['2018-8-11', '2018-9-26']], [['2018-9-27', '2019-7-31']], {online: '2019-12-27', print: '2020-3-12'})
-		+entry('confproceedings', 'IFL (2019)', 'With John van Groningen and Rinus Plasmeijer: Lazy interworking of compiled and interpreted code for sandboxing and distributed systems (Implementation & Application of Functional Languages)',
-			[['2019-6-15', '2019-8-1'], ['2019-11-30', '2020-2-11']], [['2020-3-3', '2021-2-26']], {online: '2021-7-15'})
-		+entry('bookchapter', 'FS Van Wolde (2022)', 'Voice, discourse prominence, and aspect: The niphal and passive qal of yālad',
-			[['2021-1-4', '2021-2-19'], ['2021-3-11', '2022-9-15']], [['2022-9-15', '2022-9-30']], {print: '2022-11-7'})
-		+entry('journalarticle', 'JHS (2022)', 'Lip̄nē ‘in the face of’: A Locative preposition with a threatening connotation (Journal of Hebrew Scriptures)',
-			[['2021-7-8', '2021-9-16'], ['2021-10-4', '2021-12-23']], [['2021-12-23', '2022-9-12']], {online: '2022-9-12'})
-		+entry('journalarticle', 'S&P (2024)', 'With Johan Rooryck: Formalizing spatial-causal polysemy of Agent prepositions (Semantics & Pragmatics)',
-			[['2022-7-4', '2022-9-12'], ['2023-3-6', '2023-6-5'], ['2023-7-30', '2023-10-20'], ['2023-11-10', '2023-12-20'], ['2024-1-8', '2024-1-14'], ['2024-1-15', '2024-3-3']], [['2024-3-4', '2024-5-27']], {online: '2024-3-4', print: '2024-6-4'})
-		+entry('journalarticle', 'Linguistics (2023)', 'With Johan Rooryck: The interpretation of [+distal] in demonstratives and complementizers',
-			[['2022-10-24', '2023-2-23'], ['2023-3-17', '2023-6-9']], [['2023-6-13', '2023-7-18']], {online: '2023-8-5', print: '2023-9-26'})
-		+entry('journalarticle', 'BJALL (2024)', 'With Martijn Beukenhorst: Semantic properties of prepositions: The distinction between causal min ‘from’ and bə ‘in’ (Brill\'s Journal of Afroasiatic Languages & Linguistics)',
-			[['2022-12-29', '2023-5-4'], ['2023-8-22', '2023-9-28'], ['2023-11-2', '2023-11-23'], ['2024-1-5', '2024-1-12']], [['2024-1-22', '2024-3-19']], {online: '2024-4-4', print: '2024-12-16'})
-		+entry('journalarticle', 'HIPHIL Novum (2024)', 'Large Language Models and Biblical Hebrew: Limitations, pitfalls, opportunities',
-			[['2024-3-18', '2024-5-4'], ['2024-5-6', '2024-5-7']], [['2024-5-7', '2024-6-4']], {online: '2024-6-4'})
-		+entry('journalarticle', 'In preparation (a)', 'Complementation and Common Ground: Discursive effects in Biblical Hebrew',
-			[['2023-9-22', '2024-6-30'], ['2024-12-20']])
-		+entry('journalarticle', 'In preparation (b)', 'Iconic features in nominal reduplication',
-			[['2024-5-1', '2024-5-18'], ['2024-9-13', '2024-12-1'], ['2024-12-28']])
+		.
+			const colors = {
+				bookchapter: {
+					review: '#3C59C2',
+					editing: '#010D3B',
+					published: '#010D3B'
+				},
+				confproceedings: {
+					review: '#FFCE2B',
+					editing: '#E1AE00',
+					published: '#E1AE00'
+				},
+				journalarticle: {
+					review: '#C5001F',
+					editing: '#53000D',
+					published: '#53000D'
+				},
+			};
+
+			let shorttitles = [];
+			let series = [];
+
+			function entry(type_, shorttitle, title, review_intervals, editing_intervals = [], published = {}) {
+				shorttitles.push(shorttitle);
+
+				let data = [];
+				for (let interval of review_intervals)
+					data.push({
+						start: Date.parse(interval[0]),
+						end: Date.parse(interval[1]) || Date.now(),
+						name: 'Review',
+						color: colors[type_]['review'],
+						y: shorttitles.length - 1
+					});
+
+				for (let interval of editing_intervals)
+					data.push({
+						start: Date.parse(interval[0]),
+						end: Date.parse(interval[1]) || Date.now(),
+						name: 'Copy editing',
+						color: colors[type_]['editing'],
+						y: shorttitles.length - 1
+					});
+
+				for (let way of Object.keys(published))
+					data.push({
+						start: Date.parse(published[way]),
+						milestone: true,
+						name: 'Published (' + way + ')',
+						color: colors[type_]['published'],
+						y: shorttitles.length - 1
+					});
+
+				series.push({name: title, data: data, borderRadius: 0});
+			}
+
+		.
+			entry('journalarticle', 'Orientalia (2018)', 'A case study of reciprocal middles in Biblical Hebrew: The niphal of לחם',
+				[['2017-11-8', '2017-11-28'], ['2017-12-21', '2018-1-4']], [['2018-1-9', '2018-1-24']], {print: '2018-12-1'})
+			entry('journalarticle', 'JSS (2020)', 'Prepositions and the grammaticalization of Ancient Hebrew bipartite reciprocal markers (Journal of Semitic Studies)',
+				[['2018-3-9', '2018-5-1'], ['2018-5-8', '2018-5-21']], [['2018-5-21', '2019-12-16']], {print: '2020-2-17'})
+			entry('journalarticle', 'JSOT (2020)', '“When dust was poured out”: Creation in Job 38.36–38 (Journal for the Study of the Old Testament)',
+				[['2018-8-11', '2018-9-26']], [['2018-9-27', '2019-7-31']], {online: '2019-12-27', print: '2020-3-12'})
+			entry('confproceedings', 'IFL (2019)', 'With John van Groningen and Rinus Plasmeijer: Lazy interworking of compiled and interpreted code for sandboxing and distributed systems (Implementation & Application of Functional Languages)',
+				[['2019-6-15', '2019-8-1'], ['2019-11-30', '2020-2-11']], [['2020-3-3', '2021-2-26']], {online: '2021-7-15'})
+			entry('bookchapter', 'FS Van Wolde (2022)', 'Voice, discourse prominence, and aspect: The niphal and passive qal of yālad',
+				[['2021-1-4', '2021-2-19'], ['2021-3-11', '2022-9-15']], [['2022-9-15', '2022-9-30']], {print: '2022-11-7'})
+			entry('journalarticle', 'JHS (2022)', 'Lip̄nē ‘in the face of’: A Locative preposition with a threatening connotation (Journal of Hebrew Scriptures)',
+				[['2021-7-8', '2021-9-16'], ['2021-10-4', '2021-12-23']], [['2021-12-23', '2022-9-12']], {online: '2022-9-12'})
+			entry('journalarticle', 'S&P (2024)', 'With Johan Rooryck: Formalizing spatial-causal polysemy of Agent prepositions (Semantics & Pragmatics)',
+				[['2022-7-4', '2022-9-12'], ['2023-3-6', '2023-6-5'], ['2023-7-30', '2023-10-20'], ['2023-11-10', '2023-12-20'], ['2024-1-8', '2024-1-14'], ['2024-1-15', '2024-3-3']], [['2024-3-4', '2024-5-27']], {online: '2024-3-4', print: '2024-6-4'})
+			entry('journalarticle', 'Linguistics (2023)', 'With Johan Rooryck: The interpretation of [+distal] in demonstratives and complementizers',
+				[['2022-10-24', '2023-2-23'], ['2023-3-17', '2023-6-9']], [['2023-6-13', '2023-7-18']], {online: '2023-8-5', print: '2023-9-26'})
+			entry('journalarticle', 'BJALL (2024)', 'With Martijn Beukenhorst: Semantic properties of prepositions: The distinction between causal min ‘from’ and bə ‘in’ (Brill\'s Journal of Afroasiatic Languages & Linguistics)',
+				[['2022-12-29', '2023-5-4'], ['2023-8-22', '2023-9-28'], ['2023-11-2', '2023-11-23'], ['2024-1-5', '2024-1-12']], [['2024-1-22', '2024-3-19']], {online: '2024-4-4', print: '2024-12-16'})
+			entry('journalarticle', 'HIPHIL Novum (2024)', 'Large Language Models and Biblical Hebrew: Limitations, pitfalls, opportunities',
+				[['2024-3-18', '2024-5-4'], ['2024-5-6', '2024-5-7']], [['2024-5-7', '2024-6-4']], {online: '2024-6-4'})
+			entry('journalarticle', 'In preparation (a)', 'Complementation and Common Ground: Discursive effects in Biblical Hebrew',
+				[['2023-9-22', '2024-6-30'], ['2024-12-20']])
+			entry('journalarticle', 'In preparation (b)', 'Iconic features in nominal reduplication',
+				[['2024-5-1', '2024-5-18'], ['2024-9-13', '2024-12-1'], ['2024-12-28']])
 
 		.
 			Highcharts.ganttChart('chart-publications', {
-- 
cgit v1.2.3