Real-World Duct UI: A Multi-Language Personal Website
See how Duct UI powers a production bilingual website with advanced pagination, custom markdown processing, and elegant navigation patterns. A comprehensive example showcasing real-world implementation.
π Live Example: navilan.in π
Website: https://navilan.in/ Source Code: https://github.com/navilan/navilan.in
This personal website demonstrates Duct UIβs capabilities in production, featuring bilingual content (English/Tamil), a comprehensive blog with dozens of posts across multiple pages, and sophisticated content management.
β¨ Key Features Demonstrated π
1. Bilingual Content Management π
The website seamlessly handles content in both English and Tamil with intelligent language switching.
Implementation Highlights:
- Language-aware routing (
/en/writingsand/ta/writings) - Automatic language detection from file paths
- Localized navigation and site metadata
- Language toggle in the UI
See it live: Toggle between English and Tamil versions
Source code reference: The language configuration in duct.config.js handles localization seamlessly, detecting language from file paths and providing localized metadata.
2. Advanced Pagination System π
The blog features a robust pagination system handling dozens of posts across multiple pages.
Features:
- Multiple posts per page with clean pagination
- Previous/Next navigation
- Direct page number links
- Clean URL structure (
/en/writings/page/2) - Maintains language context in pagination
See it in action:
The pagination system dynamically generates routes based on the actual content volume, ensuring optimal page distribution.
3. Enhanced Markdown Processing π
The site uses a sophisticated markdown parser with multiple plugins for rich content.
Markdown Features:
- Syntax highlighting with Prism.js for multiple languages
- Task lists with interactive checkboxes
- Footnotes for academic-style references
- Custom containers for special content blocks
- Auto-linking headers with anchor generation
- External link handling with security attributes
Source code: markdown-parser.js
The markdown parser is configured with these plugins:
markdown-it-prismfor syntax highlightingmarkdown-it-attrsfor attribute supportmarkdown-it-anchorfor header permalinksmarkdown-it-containerfor custom containersmarkdown-it-footnotefor footnotesmarkdown-it-task-listsfor interactive checklists
4. Custom Nunjucks Filters π
The template system includes custom filters for enhanced content processing.
Available Filters:
- Date formatting with locale support
- Language URL generation
- Path manipulation (relative to absolute)
- Language detection from paths
- Math operations (min function)
Check the actual implementation in duct.config.js to see how these filters enhance template processing.
5. Clean Navigation Structure π
Simple yet effective navigation that adapts to language context.
Navigation Features:
- Language toggle (English β· Tamil)
- Contextual navigation based on current language
- Social media links integration
- Responsive mobile-friendly design
See the navigation: Visit the homepage and explore the language switching
π Project Structure π
navilan.in/
βββ content/ # Markdown content with images
β βββ en/ # English content
β βββ ta/ # Tamil content
βββ public/ # Shared static assets
βββ src/
β βββ layouts/ # Nunjucks templates
β βββ pages/ # Route components
β βββ styles/ # CSS files
β βββ markdown-parser.js
βββ duct.config.js # Main configuration
βββ vite.config.ts # Build configuration
βββ tailwind.config.js # Styling configuration
Asset Management:
- Post images are stored alongside content files for easy management
- Duct automatically copies them to the distribution directory during build
- The
public/directory is reserved for shared common assets
π― Content Organization π
The site manages dozens of blog posts with:
- Chronological ordering
- Thumbnail images for each post
- Clean URLs with slugs
- Bilingual post support
- Publication dates
Content and associated images are co-located for maintainability, with Duct handling the build-time asset pipeline automatically.
π οΈ Technical Stack π
- Framework: Duct UI with SSG
- Build Tool: Vite
- Styling: Tailwind CSS
- Templates: Nunjucks
- Markdown: markdown-it with plugins
- Languages: TypeScript, JavaScript
- Package Manager: pnpm
π Running Locally π
To explore this example locally:
# Clone the repository
git clone https://github.com/navilan/navilan.in.git
cd navilan.in
# Install dependencies
pnpm install
# Start development server
pnpm dev
# Build for production
pnpm build
π‘ Key Takeaways π
This real-world example demonstrates:
- Multi-language Support: Full bilingual implementation with clean URL structure
- Scalable Pagination: Elegantly handles multiple pages of content
- Rich Content Processing: Advanced markdown with multiple plugins
- Custom Filters: Extending Nunjucks for specific needs
- Smart Asset Management: Co-located content and images with automatic build processing
- Production Ready: Clean, maintainable code running in production
π Code Examples to Study π
Dynamic Language Routing π
Check how the site handles language-specific routes in duct.config.js - look for the actual implementation of language detection and URL generation.
Markdown Enhancement π
See the complete markdown parser setup in markdown-parser.js with all plugin configurations.
Template Filters π
Explore the actual custom Nunjucks filters in the config file - each filter is implemented to solve specific template processing needs.
Content Structure π
Browse the content/ directory to see how bilingual content is organized with co-located images.
π A Living Example π
This website proves that Duct UI can power real-world, content-rich websites with advanced features. The combination of static site generation, dynamic routing, and thoughtful content organization creates a fast, maintainable, and user-friendly experience.
Visit navilan.in to experience these features firsthand, and explore the source code to learn from the implementation patterns.
π€ Share Your Duct UI Project! π
Have you built something with Duct UI? Weβd love to see it!
Join the conversation: Share your projects, ask questions, and connect with the Duct UI community in our GitHub Discussions.
Your examples inspire others and help grow the ecosystem. Whether itβs a personal blog, business website, or innovative application, your contribution matters to the community.
Start a discussion about your Duct UI project at github.com/navilan/duct-ui/discussions
