From 40572abc05f7aa3bbb811c54a6000e101d5a5175 Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Thu, 9 Jan 2025 19:45:30 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=99=88=20Change=20hiding=20long=20bibliog?= =?UTF-8?q?raphy=20from=205=20to=2015=20(#518)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on feedback from @dellaert --- .changeset/long-shirts-behave.md | 5 +++++ packages/site/src/components/Bibliography.tsx | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .changeset/long-shirts-behave.md diff --git a/.changeset/long-shirts-behave.md b/.changeset/long-shirts-behave.md new file mode 100644 index 00000000..625ff7d8 --- /dev/null +++ b/.changeset/long-shirts-behave.md @@ -0,0 +1,5 @@ +--- +'@myst-theme/site': patch +--- + +Hide long bibliography changed to 15 diff --git a/packages/site/src/components/Bibliography.tsx b/packages/site/src/components/Bibliography.tsx index c875b973..d60668b9 100644 --- a/packages/site/src/components/Bibliography.tsx +++ b/packages/site/src/components/Bibliography.tsx @@ -3,14 +3,14 @@ import classNames from 'classnames'; import { HashLink } from 'myst-to-react'; import { useState } from 'react'; -const HIDE_OVER_N_REFERENCES = 5; - export function Bibliography({ containerClassName, innerClassName, + hideLongBibliography = 15, }: { containerClassName?: string; innerClassName?: string; + hideLongBibliography?: false | number; }) { const references = useReferences(); const grid = useGridSystemProvider(); @@ -18,14 +18,14 @@ export function Bibliography({ const filtered = order?.filter((l) => l); const [hidden, setHidden] = useState(true); if (!filtered || !data || filtered.length === 0) return null; - const refs = hidden ? filtered.slice(0, HIDE_OVER_N_REFERENCES) : filtered; + const refs = hidden && hideLongBibliography ? filtered.slice(0, hideLongBibliography) : filtered; return (
- {filtered.length > HIDE_OVER_N_REFERENCES && ( + {!!hideLongBibliography && filtered.length > hideLongBibliography && (