Skip to content

Commit 0a39791

Browse files
committed
feat: add initial ISBD documentation and custom homepage component
- Introduced ISBD documentation structure, including sections like about, assessment, examples, glossary, introduction, and vocabularies. - Implemented a `StandardHomePage` component with tabbed navigation (Welcome/Contents) for the ISBD homepage. - Styled the ISBD homepage using SCSS with IFLA-themed colors.
1 parent 2034df2 commit 0a39791

File tree

20 files changed

+959
-35
lines changed

20 files changed

+959
-35
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@
7979
"sheets:export": "ts-node scripts/sheets-export.ts",
8080
"sheets:import": "ts-node scripts/sheets-import.ts",
8181
"sheets:ingest": "node scripts/sheets-to-mdx.js --sheet 'https://docs.google.com/...'",
82-
"start": "pnpm stop:portal && pnpm build:deps && DOCS_ENV=local docusaurus start",
83-
"start:all": "pnpm stop:all && pnpm build:deps && concurrently \"DOCS_ENV=local docusaurus start portal --port 3000\" \"DOCS_ENV=local docusaurus start standards/ISBDM --port 3001\" \"DOCS_ENV=local docusaurus start standards/LRM --port 3002\" \"DOCS_ENV=local docusaurus start standards/FRBR --port 3003\" \"DOCS_ENV=local docusaurus start standards/isbd --port 3004\" \"DOCS_ENV=local docusaurus start standards/muldicat --port 3005\" \"DOCS_ENV=local docusaurus start standards/unimarc --port 3006\"",
82+
"start": "pnpm stop:portal && pnpm build:theme && DOCS_ENV=local docusaurus start",
83+
"start:all": "pnpm stop:all && pnpm build:theme && concurrently \"DOCS_ENV=local docusaurus start portal --port 3000\" \"DOCS_ENV=local docusaurus start standards/ISBDM --port 3001\" \"DOCS_ENV=local docusaurus start standards/LRM --port 3002\" \"DOCS_ENV=local docusaurus start standards/FRBR --port 3003\" \"DOCS_ENV=local docusaurus start standards/isbd --port 3004\" \"DOCS_ENV=local docusaurus start standards/muldicat --port 3005\" \"DOCS_ENV=local docusaurus start standards/unimarc --port 3006\"",
8484
"start:frbr": "pnpm stop:frbr && DOCS_ENV=local docusaurus start standards/FRBR --port 3003",
8585
"start:isbd": "pnpm stop:isbd && DOCS_ENV=local docusaurus start standards/isbd --port 3004",
8686
"start:isbdm": "pnpm stop:isbdm && DOCS_ENV=local docusaurus start standards/ISBDM --port 3001",
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import React, { useState } from 'react';
2+
import clsx from 'clsx';
3+
import useBaseUrl from '@docusaurus/useBaseUrl';
4+
import styles from './styles.module.scss';
5+
6+
export interface StandardHomePageProps {
7+
children: React.ReactNode;
8+
contentsContent?: React.ReactNode;
9+
frontMatter?: {
10+
title?: string;
11+
subtitle?: string;
12+
};
13+
}
14+
15+
const StandardHomePage: React.FC<StandardHomePageProps> = ({
16+
children,
17+
contentsContent,
18+
frontMatter = {}
19+
}) => {
20+
const [activeTab, setActiveTab] = useState<'welcome' | 'contents'>('welcome');
21+
22+
// Hook calls must be unconditional – compute the logo URL here once
23+
const logoUrl = useBaseUrl('/img/logo-ifla_black.png');
24+
25+
const { title = "International Standard Bibliographic Description", subtitle } = frontMatter;
26+
27+
return (
28+
<div className={styles.standardHomepage}>
29+
{/* Tab Navigation */}
30+
<div className={styles.tabNavigation}>
31+
<button
32+
className={clsx(styles.tabButton, {
33+
[styles.tabButtonActive]: activeTab === 'welcome'
34+
})}
35+
onClick={() => setActiveTab('welcome')}
36+
aria-selected={activeTab === 'welcome'}
37+
role="tab"
38+
>
39+
Welcome
40+
</button>
41+
<button
42+
className={clsx(styles.tabButton, {
43+
[styles.tabButtonActive]: activeTab === 'contents'
44+
})}
45+
onClick={() => setActiveTab('contents')}
46+
aria-selected={activeTab === 'contents'}
47+
role="tab"
48+
>
49+
Contents
50+
</button>
51+
</div>
52+
53+
{/* Tab Content */}
54+
<div className={styles.tabContent}>
55+
{activeTab === 'welcome' && (
56+
<div className={styles.welcomeTab} role="tabpanel" aria-labelledby="welcome-tab">
57+
<div className={styles.heroSection}>
58+
<div className={styles.heroContent}>
59+
<div className={styles.logoContainer}>
60+
<img
61+
src={logoUrl}
62+
alt="IFLA Logo"
63+
/>
64+
</div>
65+
<div className={styles.titleContainer}>
66+
<h1 className={styles.heroTitle}>{title}</h1>
67+
{subtitle && <p className={styles.heroSubtitle}>{subtitle}</p>}
68+
</div>
69+
<div className={styles.quickStats}>
70+
<div className={styles.statItem}>
71+
<span className={styles.statLabel}>Current Release</span>
72+
<span className={styles.statValue}>2024.1</span>
73+
</div>
74+
</div>
75+
</div>
76+
</div>
77+
78+
<div className={styles.welcomeContent}>
79+
{children}
80+
</div>
81+
</div>
82+
)}
83+
84+
{activeTab === 'contents' && (
85+
<div className={styles.contentsTab} role="tabpanel" aria-labelledby="contents-tab">
86+
{contentsContent || (
87+
<div className={styles.contentsPlaceholder}>
88+
<p>Contents tab content should be provided via the contentsContent prop.</p>
89+
</div>
90+
)}
91+
</div>
92+
)}
93+
</div>
94+
</div>
95+
);
96+
};
97+
98+
export default StandardHomePage;

0 commit comments

Comments
 (0)