Commit Graph

87 Commits

Author SHA1 Message Date
kennethreitz efced60c35 Serve raw files (images, etc.) from data directory in catch-all
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 14:20:35 -04:00
kennethreitz dd751105ec Fix data file serving for nested paths (images in galleries)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 14:18:58 -04:00
kennethreitz 029083d526 Fix static file serving — add explicit route before catch-all
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 14:10:35 -04:00
kennethreitz 5cd48abb90 Port site to Responder (#8)
* Initial Responder port — core content serving working

Homepage, markdown pages, directory listings, image galleries
all rendering. Flask template compatibility via RequestWrapper
and FakeConfig shims.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Complete Responder port — all routes working

Ported all routes from Flask blueprints: archive, search, OG images,
RSS, sitemap, robots.txt, API endpoints, directory browser.
All 25+ routes returning 200.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Update Dockerfile for Responder, warm caches on import

CMD now runs engine_responder:api via uvicorn.
Cache warming happens on module import for production.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Rename engine_responder.py to engine.py

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Update colophon for Responder

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix essay pages, OG images, and PDF export

- Fix find_related_posts and find_adjacent_posts call signatures
- Fix OG image route to use path:path for nested paths
- Add PDF export route with WeasyPrint
- All test plan items passing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 14:03:05 -04:00
kennethreitz f50dad4574 Switch to uvicorn, fix breadcrumbs for all content pages
- Replace gunicorn/gevent with uvicorn for ASGI support
- Add asgiref to wrap Flask WSGI app for uvicorn compatibility
- Enable auto-reload in docker-compose for development
- Add current_path to all content render_template calls
- Simplify breadcrumb template to exclude current page
- Only show breadcrumbs for nested paths (> 1 segment)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 16:58:17 -05:00
kennethreitz 60f1046204 Refactor search functionality and enhance caching mechanisms
- Removed the engine_new.py file as part of restructuring.
- Implemented actual search functionality in api.py, allowing for searching through blog posts with relevance scoring and snippet extraction.
- Enhanced caching in cache.py with a clear_cache function and improved content cleaning for search indexing.
- Deleted outdated homepage-revised.html template and ensured search.html template displays search results with additional metadata such as date and matches found.
2025-09-26 13:05:29 -04:00
kennethreitz c677b8fc98 all working / black 2025-09-26 12:34:57 -04:00
kennethreitz a353ccfaa7 Add folder icon support for directory links in icon API
- Detect directory paths (ending with / or pointing to directories)
- Use generate_folder_icon() for directories instead of regular article icons
- Read index.md files for directory titles when available
- Fallback to directory name for folder icon generation
- Fixes AI personalities link and other directory links to show proper folder icons

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 15:06:05 -04:00
kennethreitz bd62ba8550 Enhance icon system for themes and improve positioning
- Add themes directory to content cache for proper icon generation
- Remove colored dots from themes/index.md to enable icon display
- Fix JavaScript to handle links wrapped in strong tags
- Improve icon positioning with refined margins and alignment
- Prevent icons from loading on index/archive pages
- Fix navigation link to point to /themes instead of /themes/
- Optimize icon spacing and vertical alignment across devices

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 14:45:14 -04:00
kennethreitz 5f126491f9 Fix article link icons and improve icon generation system
- Fix data URL display issue by using inline SVG instead of img src
- Add LRU cache to icon API for better performance
- Expand icon coverage to all internal links (not just essays)
- Add software, poetry, and talks directories to content cache
- Implement fallback logic to read files directly when not in blog cache
- Fix Requests icon to use full title "Requests: HTTP for Humans"
- Improve icon positioning with negative margins and vertical alignment
- Add graceful fallback icons for missing content

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 14:18:00 -04:00
kennethreitz e4fb17097a Fix archive excerpts - remove all markdown images and improve filtering
- Enhanced simple_extract_excerpt() function to filter markdown images
- Added support for linked images [![](url)](url)
- Improved line-by-line filtering to find meaningful content
- Reduced excerpt length to 150 characters for better display
- Removed prebuild cache system to simplify architecture
- Fixed markdown filtering in all excerpt generation functions
2025-09-17 10:32:00 -04:00
kennethreitz 77e5ef9623 Fix major performance bottleneck in directory listings
- Add cached markdown title extraction with @lru_cache(maxsize=1000)
- Replace expensive render_markdown_file() calls with fast regex title extraction
- Only read first 1000 chars instead of full file content for title extraction
- Essays directory and other large directories now load significantly faster
- First load: fast title extraction, subsequent loads: instant cache lookup

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 10:07:03 -04:00
kennethreitz 6491c26ac1 Add memoization to SVG icon generation for significant performance improvement
- Add @lru_cache(maxsize=1000) to generate_unique_svg_icon() in svg_icon_generator.py
- Add @lru_cache(maxsize=500) to generate_folder_icon() in engine.py
- Import functools.lru_cache in both files
- Directory pages with many items (like /essays) now load much faster on repeat visits
- Icons generated once per unique title, then served from memory cache

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 10:00:57 -04:00
kennethreitz 7f51a2a028 Add support for .bak files in directory structure filtering 2025-09-17 09:25:29 -04:00
kennethreitz 3640827e5b Add folder icon generation for themes and update navigation links 2025-09-17 09:15:19 -04:00
kennethreitz 37f580a345 Add performance optimizations: lazy loading and caching
- Implement lazy loading for images using IntersectionObserver
- Add HTTP caching headers for static assets (images: 7 days, others: 1 hour)
- Preload critical CSS resources for faster initial page load

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 08:37:44 -04:00
kennethreitz 2cce051bc8 Add reading progress indicator and enhance search with result highlighting
- Add reading progress bar for longer essays with smooth animation
- Implement search result snippets with highlighted query terms
- Tighten directory listing styles for better compactness
- Add back-to-parent navigation links in directory views

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 08:36:43 -04:00
kennethreitz 3287eed5ac Add parent directory navigation with icon in directory view 2025-09-17 08:31:25 -04:00
kennethreitz 16cf23a11d Add unique icons for articles and adjust layout in search results and templates 2025-09-17 08:18:00 -04:00
kennethreitz b4e7ec873d Enhance directory and archive layouts with unique icons and responsive styles
- Added a new SVG icon generator to create unique procedural icons for posts and directories.
- Implemented a grid layout for directory contents with hover effects and responsive adjustments.
- Updated archive and connections templates to display unique icons alongside article titles.
- Improved styling for archive posts, including flexbox layout for better alignment.
- Enhanced directory listing with icons and improved visual hierarchy.
- Refactored post template to include an icon next to the post title and added parent navigation links.
- Updated styles across templates for consistent icon sizes and responsive behavior.
2025-09-17 08:11:32 -04:00
kennethreitz d64bee05e9 Fix missing page titles on directory pages
- Use actual title from index.md content instead of directory name
- Falls back to directory name if no index.md or title exists
- Fixes issue where pages like /talks/#major-talks showed no title
- Now "Conference Talks" will properly display instead of generic "Talks"

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 06:48:47 -04:00
kennethreitz 91999af2c5 Fix archive date parsing and optimize When Values essay
- Replace brittle filename-only date parsing with robust extract_intelligent_date function
- Fix archive to show all ~225 essays instead of just 71 from 2025
- Optimize "When Values Eat Their Young" essay with enhanced sidenotes and formatting
- Add authentic Sarah appreciation and improve contemplative depth
- Reduce bold formatting in failure modes section for better flow

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 20:42:46 -04:00
kennethreitz 7e91aca569 Fix archive page date parsing to handle both YYYY-MM-DD and YYYY-MM formats
Archive was only showing 2025 posts because older essays use YYYY-MM format
while newer ones use YYYY-MM-DD. Added conditional logic to handle both formats
in unified cache generation, defaulting to 1st of month for YYYY-MM files.

Now properly displays all 223 posts spanning 2008-2025 across 15 years.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 20:22:40 -04:00
kennethreitz 2239cd0744 Optimize cache generation with gevent async I/O for faster file processing
- Add gevent monkey patching for async I/O operations
- Create _process_single_file() helper for concurrent file processing
- Replace sequential file loop with gevent Pool for parallel processing
- Reduce cache generation time from sequential to ~1.5s for 563 files
- Maintain full compatibility with existing cache data structures

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 19:55:18 -04:00
kennethreitz 8ede239751 Fix incoming connections to show proper titles instead of 'Unknown'
- Added title extraction from markdown files for incoming connections when URL mapping is unavailable
- Looks for markdown titles (# Title) and YAML frontmatter (title:) in first 10 lines
- Handles files not in blog_posts collection (e.g., Lumina reactions, AI writings, themes)
- Improves connections page display by showing actual titles instead of 'Unknown'
- Falls back gracefully to 'Unknown' if file reading fails

Example: 'Dancing in the Primordial Soup: A Love Letter to Kenneth's Absurd Truth' instead of 'Unknown'

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 19:48:09 -04:00
kennethreitz e9743c5dfa Fix cross-reference graph to use MetadataCache
- Updated graph_data() endpoint to use metadata_cache.get_connections() instead of old _extract_all_connections_cached()
- Graph now uses same optimized single-sweep cache as other endpoints
- Improved from 0 nodes/edges to 128 nodes/662 edges with proper cross-reference data
- Ensures consistent performance across all index pages

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 19:43:30 -04:00
kennethreitz 09a307bda0 Fix connections and terms index display issues
- Fix jinja2 template error: change terms cache from list to dictionary structure
- Fix connections showing 0: add missing file_path field to blog_posts for proper file-to-URL mapping
- Fix terms index being empty: same file_path mapping enables terms to link to articles
- Fix incoming links showing "Unknown": proper source file mapping resolves article titles
- Both indexes now display correct cross-reference data with fast performance

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 19:40:43 -04:00
kennethreitz 3d6dfae01b Refactor cache generation and improve metadata handling
- Updated docker-compose.yml to mount data directory for improved file access.
- Implemented a unified cache generation function in engine.py to streamline cache creation for blog posts, sidenotes, outlines, quotes, connections, and terms.
- Replaced individual cache extraction functions with a single MetadataCache class for cleaner access to cached data.
- Modified prebuild_cache.py to utilize the new unified cache function, ensuring all cache files are generated in a single sweep.
- Enhanced outlines.html template to simplify anchor URL generation for headings.
2025-09-16 19:37:23 -04:00
kennethreitz b14a1bf2a5 Improve top navigation with dynamic index dropdown
- Replace static nav links with dropdown containing all indexes
- Add Flask context processor for dynamic index counts from cache
- Organize indexes by content type with visual separators
- Add hover-friendly padding and eliminate gap issues
- Order indexes: Sidenotes, Outlines, Connections, Quotes, Terms, Graph, Search
- Include exact counts for each index pulled from live cache data
- Add proper punctuation and descriptions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 16:56:35 -04:00
kennethreitz e1245511d6 Implement Docker build-time cache pre-generation for instant startup
Added prebuild_cache.py script that generates all site caches (blog posts, sidenotes, outlines, quotes, connections, terms) as JSON files during Docker build. Modified engine.py to load pre-built caches on startup, eliminating the 30-40 second cache preload delay and making the site instantly responsive.

Key improvements:
- Zero startup delay with pre-built caches
- Proper datetime serialization/deserialization
- Graceful fallback to runtime caching if pre-built files missing
- Technology serving human consciousness - mechanical work during build, instant experience for users

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 10:29:51 -04:00
kennethreitz f36d1848e1 Implement bidirectional connections tracking in backend
- Enhanced _extract_all_connections_cached() with two-pass algorithm
- First pass: collect articles and outgoing connections
- Second pass: map incoming connections to target articles
- Added incoming_connections and outgoing_connections fields to article data
- Maintains backward compatibility with existing connections field
- Updated connections route to pass bidirectional statistics

Now tracks 1,535 outgoing and 1,391 incoming cross-references across the digital garden.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 03:47:00 -04:00
kennethreitz fac4c05d09 test 2025-09-16 01:08:14 -04:00
kennethreitz d3e2b2e180 test 2025-09-15 23:28:55 -04:00
kennethreitz b7d3fa9c5d test 2025-09-15 22:36:14 -04:00
kennethreitz d975d7b937 test 2025-09-15 20:59:35 -04:00
kennethreitz d6fe03a9d3 test 2025-09-15 07:14:59 -04:00
kennethreitz 1abdf56943 test 2025-09-15 06:15:36 -04:00
kennethreitz f0d9393db4 test 2025-09-14 20:16:03 -04:00
kennethreitz 13570e2888 Fix Fly.io deployment issues and restore blue-green strategy
- Added /health endpoint for more reliable health checks
- Increased health check timeout from 2s to 10s with 15s grace period
- Fixed cache preloading to run only once using file locking mechanism
- Prevents multiple Gunicorn workers from running cache preloading simultaneously
- Restored blue-green deployment strategy for zero-downtime deployments
- Deployment now completes successfully with all health checks passing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 17:18:01 -04:00
kennethreitz 3b88fdf56c test 2025-09-14 16:59:47 -04:00
kennethreitz 46bef60b75 Add cross-reference graph visualization and external links index
- Created interactive D3.js network graph showing connections between essays
- Added external links index showing all outbound references by article
- Moved content guide to base template footer for site-wide access
- Optimized startup: background cache preloading, sequential for lower RAM usage
- Fixed duplicate images issue in growing open source seeds essay
- Updated archive page with new index links and improved browse-by-type styling
- Removed saved-customizations.css file
- Changed Fly.io deployment strategy from bluegreen to rolling

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 16:34:41 -04:00
kennethreitz ce6fc9a609 test 2025-09-14 16:18:53 -04:00
kennethreitz 3953649bd4 test 2025-09-14 16:10:52 -04:00
kennethreitz 0d85df1293 test 2025-09-14 15:40:40 -04:00
kennethreitz afee645299 test 2025-09-14 13:10:30 -04:00
kennethreitz 99b6715e37 test 2025-09-14 12:59:11 -04:00
kennethreitz a59b5eee0b test 2025-09-13 06:40:07 -04:00
kennethreitz b9fe81b260 test 2025-09-13 06:29:55 -04:00
kennethreitz 9483fd01d9 test 2025-09-07 07:12:54 -04:00
kennethreitz 84d894026a test 2025-09-07 07:05:40 -04:00