open-navigator / web_docs /sidebars.ts
jcbowyer's picture
Clean HuggingFace deployment without binary files
d15f07c
Raw History Blame Contribute Delete
16.3 kB
import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
/** Show archived development docs in the Developers sidebar when set.
* Default off — set `DOCUSAURUS_SHOW_ARCHIVE=1` (or true/yes/on) to include. */
const showDocsArchive = ['1', 'true', 'yes', 'on'].includes(
(process.env.DOCUSAURUS_SHOW_ARCHIVE || '').trim().toLowerCase(),
);
/** Top-level YouTube category for the Developers menu (#744). */
const youtubeNavCategory = {
type: 'category' as const,
label: 'YouTube',
items: [
{
type: 'doc' as const,
id: 'data-sources/youtube-api-audit',
label: 'API audit (form + diagrams)',
},
'data-sources/youtube-discovery',
'data-sources/video-channels',
'development/youtube-channel-rules',
'deployment/youtube-channels-bronze-migration',
],
};
const archiveNavCategory = {
type: 'category' as const,
label: 'Archive',
collapsed: true,
items: [
{
type: 'autogenerated' as const,
dirName: 'development/archive',
},
],
};
/** Shared Developers technical items (used by developersSidebar + docsSidebar). */
function developersTechnicalItems() {
// civic-tech-sources remains omitted (MDX parse issue).
const dataSourcesItems = [
{
type: 'doc' as const,
id: 'data-sources/citations',
label: 'Citations & Data Sources',
},
{
type: 'doc' as const,
id: 'legal-compliance',
label: 'Legal & Compliance',
},
'data-sources/data-model-erd',
'data-sources/jurisdiction-discovery',
'data-sources/census-data',
'data-sources/huggingface-datasets',
'data-sources/url-datasets',
// YouTube docs live under the top-level YouTube category (#744)
'data-sources/open-source-repositories',
'data-sources/ballot-election-sources',
'data-sources/polling-survey-sources',
'data-sources/factcheck-sources',
];
const items: unknown[] = [
'for-developers',
{
type: 'category' as const,
label: 'Setup & Quick Start',
items: ['quickstart', 'quick-reference', 'architecture'],
},
youtubeNavCategory,
{
type: 'category' as const,
label: 'Data Sources (Technical)',
items: dataSourcesItems,
},
{
type: 'category' as const,
label: 'How-To Guides',
items: [
'guides/accessibility-testing',
'guides/jurisdiction-setup',
'guides/legislative-tracking-maps',
'guides/huggingface-publishing',
'guides/huggingface-quickstart',
'guides/huggingface-features',
'guides/huggingface-limits',
'guides/handling-formats',
'guides/document-libraries',
'guides/scraper-improvements',
'guides/local-llm-web-scraping',
'guides/search-patterns',
'guides/split-screen',
],
},
{
type: 'category' as const,
label: 'Integrations',
items: [{type: 'autogenerated' as const, dirName: 'integrations'}],
},
{
type: 'category' as const,
label: 'Deployment',
items: [{type: 'autogenerated' as const, dirName: 'deployment'}],
},
{
type: 'category' as const,
label: 'AI and LLMs',
items: [
'development/ai-overview',
'development/context-engineering',
'development/transcript-analysis-cost',
'development/jev-transcript-screening',
'development/search-places-handoff',
'development/jev-meeting-kind-gate',
'development/jev-meeting-kind-gate-plan',
'development/jev-meta-and-scale-design',
'development/jev-meta-gate-validation-design',
'development/jev-meta-gate-validation-plan',
'development/jev-meta-gate-validation',
'development/vote-phrase-spotting',
'development/vote-phrase-spotting-plan',
'development/llm-usage-tracking',
'development/data-freshness',
'development/gpu-compute-decisions',
'development/meeting-audio-source-decision',
'development/ai-model-evaluation',
'development/ai-policy-analysis',
'development/ai-model-merging',
],
},
{
type: 'category' as const,
label: 'Guides & decisions',
items: [
'development/code-walkthrough',
'development/dataops-walkthrough',
'development/adding-data-sources',
'development/python-packaging',
'development/dbt-etl-strategy',
'development/cleanup-roadmap',
'development/refactor-plan',
'development/scripts-reconciliation',
'development/state-field-naming-standard',
'development/developing-on-windows',
'development/database-setup',
'development/port-guide',
'development/data-contracts',
'development/development-docs-hygiene-design',
'development/app-docs-linking-design',
],
},
{
type: 'category' as const,
label: 'dbt (Data Build Tool)',
items: [{type: 'autogenerated' as const, dirName: 'dbt'}],
},
{
type: 'category' as const,
label: 'Hackathon',
items: [
'guides/hackathon-video-submission-ideas',
'guides/hackathon/big-timber-tuscaloosa-jurisdiction-ids',
],
},
];
// Archive last, and only when explicitly enabled (#744).
if (showDocsArchive) {
items.push(archiveNavCategory);
}
return items;
}
// Shared "Data and Terms" sidebar. Surfaces the data catalog overview and the
// full Data Sources reference (formerly the standalone "Catalog" tab) alongside
// the citations and legal/terms docs.
const dataAndTermsSidebar = [
{
type: 'category' as const,
label: 'Data and Terms',
collapsed: false,
items: [
{
type: 'doc' as const,
id: 'data-sources/overview',
label: 'Data Catalog',
},
{
type: 'category' as const,
label: 'Data Sources',
items: [{type: 'autogenerated' as const, dirName: 'data-sources'}],
},
{
type: 'doc' as const,
id: 'legal/index',
label: 'Terms and Privacy',
},
],
},
];
const sidebars: SidebarsConfig = {
// ========================================
// DIATAXIS DUAL SIDEBARS
// ----------------------------------------
// Two information-architecture views over the existing docs (no file moves):
// a Developer Handbook for contributors (setup / build / extend) and a
// Public Data Catalog for civic users (what's in the data, how to use it).
// Each is grouped into the four Diataxis quadrants:
// Tutorials - learning-oriented
// How-To - task-oriented
// Reference - information-oriented
// Explanation - understanding-oriented
// Existing audience sidebars (gettingStarted / families / policyMakers /
// developers / docs) are kept intact for now; retire them in a follow-up
// once the dual-sidebar nav settles.
// ========================================
handbookSidebar: [
{type: 'doc', id: 'for-developers', label: 'Developer Handbook'},
{
type: 'category',
label: 'Tutorials',
collapsed: false,
items: [
'quickstart',
'development/code-walkthrough',
'development/dataops-walkthrough',
'for-students',
'quick-reference',
],
},
{
type: 'category',
label: 'How-To Guides',
items: [
'development/adding-data-sources',
'guides/jurisdiction-setup',
'guides/scraper-improvements',
'guides/local-llm-web-scraping',
'guides/huggingface-quickstart',
'guides/huggingface-publishing',
'guides/huggingface-features',
'guides/huggingface-limits',
'guides/legislative-tracking-maps',
'guides/handling-formats',
'guides/document-libraries',
'guides/search-patterns',
'guides/accessibility-testing',
'guides/split-screen',
'guides/social-features',
'guides/debate-grader',
'guides/jurisdiction-website-enrichment',
'guides/terminal-corruption-fix',
],
},
{
type: 'category',
label: 'Reference',
items: [
'architecture',
{
type: 'category',
label: 'dbt (Data Build Tool)',
items: [{type: 'autogenerated', dirName: 'dbt'}],
},
{
type: 'category',
label: 'Integrations',
items: [{type: 'autogenerated', dirName: 'integrations'}],
},
{
type: 'category',
label: 'Deployment',
items: [{type: 'autogenerated', dirName: 'deployment'}],
},
],
},
{
type: 'category',
label: 'Explanation',
items: [
'development/dbt-etl-strategy',
'development/state-field-naming-standard',
'development/cleanup-roadmap',
'development/python-packaging',
'development/scripts-reconciliation',
'development/development-docs-hygiene-design',
],
},
],
// ========================================
// GETTING STARTED - For Everyone
// ========================================
gettingStartedSidebar: [
{
type: 'category',
label: 'Getting Started',
collapsed: false,
items: [
'intro',
'open-navigator',
],
},
{
type: 'doc',
id: 'data-sources/citations',
label: 'Citations & Data Sources',
},
{
type: 'doc',
id: 'legal-compliance',
label: 'Legal & Compliance',
},
],
// ========================================
// CITIZENS & RESIDENTS - Community Resources
// ========================================
citizensSidebar: [
{
type: 'category',
label: 'Citizens and Residents',
collapsed: false,
items: [
'for-citizens',
{
type: 'category',
label: 'Resources for Citizens & Residents',
items: [
'citizens/community-events',
'citizens/training-education',
'citizens/voter-registration',
'citizens/service-requests',
'citizens/community-resources',
'resources/nonprofit-resources',
],
},
{
type: 'doc',
id: 'open-navigator',
label: 'Getting Started with Open Navigator',
},
{
type: 'doc',
id: 'data-sources/citations',
label: 'Citations & Data Sources',
},
{
type: 'doc',
id: 'legal-compliance',
label: 'Legal & Compliance',
},
],
},
],
// ========================================
// POLICY MAKERS - Non-Technical
// ========================================
policyMakersSidebar: [
{
type: 'category',
label: 'Policy Makers & Advocates',
collapsed: false,
items: [
'for-advocates',
{
type: 'category',
label: '1. Define your cause / mission',
items: ['resources/nonprofit-resources'],
},
{
type: 'category',
label: '2. Identify who to engage',
items: [
'data-sources/overview',
{
type: 'doc',
id: 'data-sources/citations',
label: 'Citations & Data Sources',
},
'data-sources/nonprofit-sources',
'data-sources/video-sources',
],
},
{
type: 'category',
label: '3. Choose a strategy',
items: [
'guides/political-economy',
'guides/accountability-strategy',
'guides/impact-navigation',
],
},
{
type: 'category',
label: '4. Define what success looks like',
items: [
{
type: 'autogenerated',
dirName: 'case-studies',
},
],
},
],
},
],
// ========================================
// DEVELOPERS - Technical
// ========================================
developersSidebar: [
{
type: 'category',
label: 'Developers & Technical Users',
collapsed: false,
items: developersTechnicalItems() as SidebarsConfig[string],
},
],
// ========================================
// OPERATIONS - running costs and money-saving decisions (#868)
// ========================================
operationsSidebar: [
{
type: 'category',
label: 'Finance',
collapsed: false,
items: [
'operations/finance/overview',
'operations/finance/expense-log',
'operations/finance/savings-decisions',
],
},
{
type: 'category',
label: 'Search and discovery',
collapsed: false,
items: ['operations/seo-sitelinks'],
},
{
type: 'category',
label: 'Related cost pages',
collapsed: false,
items: [
'development/llm-usage-tracking',
'development/transcript-analysis-cost',
'development/gpu-compute-decisions',
'development/neon-serving-scope',
],
},
],
// ========================================
// MAIN SIDEBAR - All Documentation
// ========================================
docsSidebar: [
{
type: 'category',
label: 'Getting Started',
collapsed: false,
items: [
'intro',
'open-navigator',
],
},
{
type: 'category',
label: 'Citizens and Residents',
collapsed: false,
link: {
type: 'doc',
id: 'for-citizens',
},
items: [
{
type: 'category',
label: 'Resources for Citizens & Residents',
items: [
'citizens/community-events',
'citizens/training-education',
'citizens/voter-registration',
'citizens/service-requests',
'citizens/community-resources',
],
},
{
type: 'doc',
id: 'open-navigator',
label: 'Getting Started with Open Navigator',
},
{
type: 'doc',
id: 'data-sources/citations',
label: 'Citations & Data Sources',
},
],
},
{
type: 'category',
label: 'Policy Makers & Advocates',
collapsed: false,
link: {
type: 'doc',
id: 'for-advocates',
},
items: [
'for-advocates',
{
type: 'category',
label: '1. Define your cause / mission',
items: ['resources/nonprofit-resources'],
},
{
type: 'category',
label: '2. Identify who to engage',
items: [
'data-sources/overview',
{
type: 'doc',
id: 'data-sources/citations',
label: 'Citations & Data Sources',
},
'data-sources/nonprofit-sources',
'data-sources/video-sources',
],
},
{
type: 'category',
label: '3. Choose a strategy',
items: [
'guides/political-economy',
'guides/accountability-strategy',
'guides/impact-navigation',
],
},
{
type: 'category',
label: '4. Define what success looks like',
items: [
{
type: 'autogenerated',
dirName: 'case-studies',
},
],
},
],
},
{
type: 'category',
label: 'Developers & Technical Users',
collapsed: true,
link: {
type: 'doc',
id: 'for-developers',
},
items: developersTechnicalItems() as SidebarsConfig[string],
},
],
// ========================================
// DATA AND TERMS - Standalone Sidebar
// (Absorbs the former "Catalog" data content: the data catalog
// overview and the full Data Sources reference.)
// ========================================
citationsSidebar: dataAndTermsSidebar,
// ========================================
// LEGAL - Uses same sidebar as Data and Terms
// ========================================
legalSidebar: dataAndTermsSidebar,
};
export default sidebars;