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 lines32333435363726 unmodified lines646566676869708 unmodified lines798081828384858687888931 unmodified linesconst normalizedAuthors: Author[] = normalizeAuthors(authors as any);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? <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><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></div>)}{(!affiliations || affiliations.length === 0) && affiliation && (31 unmodified lines3233343536373839404142434445464748495026 unmodified lines777879808182838 unmodified lines929394959697989910010110210310410510610710810911031 unmodified linesconst 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 = 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>) : (<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 lines78910111213141516171819202112 unmodified lines343536373839407 unmodified lines484950516 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 />6 unmodified lines78910111213141512 unmodified lines2829303132337 unmodified lines4142436 unmodified lines- name: "Thibaud Frere"url: "https://huggingface.co/tfrere"affiliations: [1]affiliations:- name: "Hugging Face"url: "https://huggingface.co"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";<Introduction />7 unmodified lines<BestPractices />
32 unmodified lines33343536373839404142434475 unmodified lines1201211221231241251261271281291305 unmodified lines1361371381391401411421431441451461471481491501511521531541556 unmodified lines1621631641651661671681691704 unmodified lines17517617717817918018118218318432 unmodified linesbox-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);}section.content-grid pre { margin: 0; }75 unmodified lines.code-card .code-copy {position: absolute;top: 6px;right: 6px;z-index: 3;padding: 6px 12px;border: none;}.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 {content: attr(data-language);position: sticky;right: 0;bottom: 0;font-size: 10px;4 unmodified linesborder-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 */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); }32 unmodified lines3334353637383975 unmodified lines1151161171181191201211221231241251261271285 unmodified lines1341351361371381396 unmodified lines1461471481491501511521531544 unmodified lines15916016116216316416516616716832 unmodified linesbox-sizing: border-box;-webkit-overflow-scrolling: touch;padding: 0;margin-bottom: var(--block-spacing-y) !important;}section.content-grid pre { margin: 0; }75 unmodified lines.code-card .code-copy {position: absolute;top: var(--spacing-2);right: var(--spacing-2);z-index: 3;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); }/* 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 {content: attr(data-language);position: absolute;right: 0;bottom: 0;font-size: 10px;4 unmodified linesborder-top: 1px solid var(--border-color);border-left: 1px solid var(--border-color);opacity: 1;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