Skip to content

Commit 80dd41c

Browse files
committed
fix build
Removed helper functions with untyped params (formatAuthors, formatVenue, doiUrl) that triggered ts(7006) in astro check.
1 parent 8eb973b commit 80dd41c

2 files changed

Lines changed: 36 additions & 41 deletions

File tree

src/data/related-research.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"sourceBibtexUrl": "https://paperpile.com/eb/VDzRdyJpus",
33
"sharedPageUrl": "https://paperpile.com/shared/sfRoEJyQ5QA2Oe4GSpZo2~A",
4-
"generatedAt": "2026-02-25T07:34:35.205Z",
4+
"generatedAt": "2026-02-25T08:29:10.981Z",
55
"count": 23,
66
"papers": [
77
{

src/pages/docs/research/publications/index.astro

Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,6 @@ const generatedAt = relatedResearch?.generatedAt
1212
day: 'numeric',
1313
})
1414
: null;
15-
16-
function formatAuthors(authorText) {
17-
if (!authorText) return 'Unknown authors';
18-
return authorText.replace(/\s+and\s+/gi, ', ');
19-
}
20-
21-
function formatVenue(paper) {
22-
const parts = [];
23-
if (paper.venue) parts.push(paper.venue);
24-
if (paper.year) parts.push(String(paper.year));
25-
return parts.join('');
26-
}
27-
28-
function doiUrl(doi) {
29-
if (!doi) return null;
30-
const normalized = doi.replace(/^https?:\/\/doi\.org\//i, '');
31-
return `https://doi.org/${normalized}`;
32-
}
3315
---
3416

3517
<DocsLayout title="Publications - Dasher Research" description="Academic publications about Dasher">
@@ -257,28 +239,41 @@ function doiUrl(doi) {
257239

258240
<div class="papers">
259241
{
260-
relatedPapers.map((paper) => (
261-
<article class="paper">
262-
<h2>{paper.title}</h2>
263-
<p class="paper-meta">{formatAuthors(paper.authors)}</p>
264-
{formatVenue(paper) && <p class="paper-meta">{formatVenue(paper)}</p>}
265-
{(paper.url || paper.doi) && (
266-
<p class="paper-meta">
267-
{paper.url && (
268-
<a href={paper.url} target="_blank" rel="noopener noreferrer">
269-
Open paper
270-
</a>
271-
)}
272-
{paper.url && paper.doi && <> • </>}
273-
{paper.doi && (
274-
<a href={doiUrl(paper.doi)} target="_blank" rel="noopener noreferrer">
275-
DOI
276-
</a>
277-
)}
278-
</p>
279-
)}
280-
</article>
281-
))
242+
relatedPapers.map((paper) => {
243+
const authors = paper.authors
244+
? paper.authors.replace(/\s+and\s+/gi, ', ')
245+
: 'Unknown authors';
246+
const venueParts = [];
247+
if (paper.venue) venueParts.push(paper.venue);
248+
if (paper.year) venueParts.push(String(paper.year));
249+
const venue = venueParts.join('');
250+
const doiLink = paper.doi
251+
? `https://doi.org/${paper.doi.replace(/^https?:\/\/doi\.org\//i, '')}`
252+
: null;
253+
254+
return (
255+
<article class="paper">
256+
<h2>{paper.title}</h2>
257+
<p class="paper-meta">{authors}</p>
258+
{venue && <p class="paper-meta">{venue}</p>}
259+
{(paper.url || paper.doi) && (
260+
<p class="paper-meta">
261+
{paper.url && (
262+
<a href={paper.url} target="_blank" rel="noopener noreferrer">
263+
Open paper
264+
</a>
265+
)}
266+
{paper.url && paper.doi && <> • </>}
267+
{doiLink && (
268+
<a href={doiLink} target="_blank" rel="noopener noreferrer">
269+
DOI
270+
</a>
271+
)}
272+
</p>
273+
)}
274+
</article>
275+
);
276+
})
282277
}
283278
</div>
284279

0 commit comments

Comments
 (0)