thibaud frere commited on
Commit ·
aaf7841
1
Parent(s): efb32fc
remove numbers if all authors are affiliated to the same entity
Browse filesFiles changed (3)
31 unmodified lines3233343536373839404142434445464748495026 unmodified lines77787967808182838 unmodified lines9293949582838485869697989910010110210310410510610710810911031 unmodified lines
const normalizedAuthors: Author[] = normalizeAuthors(authors as any);
// Determine if affiliation superscripts should be shown (only when there are multiple distinct affiliations referenced by authors)const authorAffiliationIndexSet = new Set<number>();for (const author of normalizedAuthors) { const indices = Array.isArray(author.affiliationIndices) ? author.affiliationIndices : []; for (const idx of indices) { if (typeof idx === 'number') { authorAffiliationIndexSet.add(idx); } }}const shouldShowAffiliationSupers = authorAffiliationIndexSet.size > 1;const hasMultipleAffiliations = Array.isArray(affiliations) && affiliations.length > 1;
function stripHtml(text: string): string { return String(text || '').replace(/<[^>]*>/g, '');}26 unmodified lines <h3>Author{normalizedAuthors.length > 1 ? 's' : ''}</h3> <ul class="authors"> {normalizedAuthors.map((a, i) => { const supers = Array.isArray(a.affiliationIndices) && a.affiliationIndices.length const supers = shouldShowAffiliationSupers && Array.isArray(a.affiliationIndices) && a.affiliationIndices.length ? <sup>{a.affiliationIndices.join(',')}</sup> : null; return (8 unmodified lines {(Array.isArray(affiliations) && affiliations.length > 0) && ( <div class="meta-container-cell"> <h3>Affiliation{affiliations.length > 1 ? 's' : ''}</h3> {hasMultipleAffiliations ? ( <ol class="affiliations"> {affiliations.map((af) => ( <li value={af.id}>{af.url ? <a href={af.url} target="_blank" rel="noopener noreferrer">{af.name}</a> : af.name}</li> ))} </ol> <ol class="affiliations"> {affiliations.map((af) => ( <li value={af.id}>{af.url ? <a href={af.url} target="_blank" rel="noopener noreferrer">{af.name}</a> : af.name}</li> ))} </ol> ) : ( <p> {affiliations[0]?.url ? <a href={affiliations[0].url} target="_blank" rel="noopener noreferrer">{affiliations[0].name}</a> : affiliations[0]?.name} </p> )} </div> )} {(!affiliations || affiliations.length === 0) && affiliation && (6 unmodified lines78910111213101112171813141512 unmodified lines282930373132337 unmodified lines414243516 unmodified lines - name: "Thibaud Frere" url: "https://huggingface.co/tfrere" affiliations: [1] - name: "Alice Example" url: "https://example.com/~alice" affiliations: [1, 2] - name: "Bob Researcher"affiliations: - name: "Hugging Face" url: "https://huggingface.co" - name: "Example University" url: "https://example.edu"published: "Sep. 01, 2025"doi: 10.1234/abcd.efghlicence: >12 unmodified linesimport GettingStarted from "./chapters/getting-started.mdx";import Markdown from "./chapters/markdown.mdx";import Components from "./chapters/components.mdx";import DebugComponents from "./chapters/debug-components.mdx";
<Introduction />
7 unmodified lines
<BestPractices />
<DebugComponents />32 unmodified lines3334353637383940413637383975 unmodified lines1151161171231241181191201261271211221231241251261271285 unmodified lines1341351361391401411421431441451461471481491501511521371381396 unmodified lines1461471481651491501671511521531544 unmodified lines15916016117816216316418116516616716832 unmodified lines box-sizing: border-box; -webkit-overflow-scrolling: touch; padding: 0;}
/* Consistent vertical spacing for code blocks */.astro-code,section.content-grid pre { margin: 0 0 var(--block-spacing-y); margin-bottom: var(--block-spacing-y) !important;}
section.content-grid pre { margin: 0; }75 unmodified lines
.code-card .code-copy { position: absolute; top: 6px; right: 6px; top: var(--spacing-2); right: var(--spacing-2); z-index: 3; padding: 6px 12px; border: none; display: none;}
.code-card:hover .code-copy { display: block;}
.code-card .code-copy svg {5 unmodified lines
.code-card pre { margin: 0 0 var(--spacing-1); }
/* Discreet filetype/language label shown under the Copy button */.code-card::after { content: attr(data-language); position: absolute; top: 8px; right: 56px; /* leave room for copy button */ font-size: 10px; line-height: 1; text-transform: uppercase; color: var(--muted-color); pointer-events: none; z-index: 2;}
/* When no copy button (single-line), keep the label in the top-right corner */.code-card.no-copy::after { top: 8px; right: 8px; }
6 unmodified lines/* ============================================================================ *//* Language/extension vignette (bottom-right, discreet) *//* ============================================================================ */.astro-code::after {/* .astro-code::after { content: attr(data-language); position: sticky; position: absolute; right: 0; bottom: 0; font-size: 10px;4 unmodified lines border-top: 1px solid var(--border-color); border-left: 1px solid var(--border-color); opacity: 1; border-radius: 8px 0 0 0; /* round only top-left */ border-radius: 8px 0 0 0; padding: 4px 6px; pointer-events: none;}} */
/* Fallback if Shiki uses data-lang instead of data-language */.astro-code[data-lang]::after { content: attr(data-lang); }app/src/components/Hero.astro+27-6
app/src/content/article.mdx-8
app/src/styles/components/_code.css+12-28