#!/usr/bin/env python3 """Script to update all category HTML pages with Font Awesome and navigation bar.""" import re from pathlib import Path # Define category pages and their active nav items CATEGORIES = { 'pocs.html': 'POCs', 'system-prompts.html': 'System Prompts', 'frameworks.html': 'Frameworks', 'claude-code.html': 'Claude Code', 'mcp.html': 'MCP', 'gemini.html': 'Gemini', 'automation.html': 'Automation', 'context.html': 'Context', 'utilities.html': 'Utilities', 'documentation.html': 'Docs', 'miscellaneous.html': 'More' } # Subtitles for each category SUBTITLES = { 'pocs.html': 'Proof of concepts for AI systems and workflows', 'system-prompts.html': 'System prompts for configuring AI assistants and agents', 'frameworks.html': 'Frameworks, tools, and utilities for AI development', 'claude-code.html': 'Projects built with and for Claude Code CLI', 'mcp.html': 'Model Context Protocol servers and implementations', 'gemini.html': 'Projects leveraging Google\'s Gemini AI', 'automation.html': 'N8N workflows and automation tools', 'context.html': 'Context repositories and prompt collections', 'utilities.html': 'Standalone tools and utility applications', 'documentation.html': 'Documentation projects and resource indexes', 'miscellaneous.html': 'Various AI experiments and unique projects' } NAV_BAR = ''' ''' def update_page(file_path: Path, active_nav: str, subtitle: str): """Update a single category page.""" content = file_path.read_text() # Add Font Awesome if not present if 'font-awesome' not in content: content = content.replace( '', '\n ' ) # Update header structure header_pattern = r'
.*?
' new_header = f'''

AI Projects Index

{subtitle}

''' content = re.sub(header_pattern, new_header, content, flags=re.DOTALL) # Create navigation with active state active_states = { 'demos_active': ' class="active"' if active_nav == 'Demos' else '', 'pocs_active': ' class="active"' if active_nav == 'POCs' else '', 'system_prompts_active': ' class="active"' if active_nav == 'System Prompts' else '', 'frameworks_active': ' class="active"' if active_nav == 'Frameworks' else '', 'claude_code_active': ' class="active"' if active_nav == 'Claude Code' else '', 'mcp_active': ' class="active"' if active_nav == 'MCP' else '', 'gemini_active': ' class="active"' if active_nav == 'Gemini' else '', 'automation_active': ' class="active"' if active_nav == 'Automation' else '', 'context_active': ' class="active"' if active_nav == 'Context' else '', 'utilities_active': ' class="active"' if active_nav == 'Utilities' else '', 'documentation_active': ' class="active"' if active_nav == 'Docs' else '', 'miscellaneous_active': ' class="active"' if active_nav == 'More' else '' } nav_html = NAV_BAR.format(**active_states) # Add navigation after header if not present if '