A parody of the Christian Bible, written for Rustaceans. Built with Next.js and deployed to GitHub Pages.
The Rust Bible is a static site that presents Rust concepts and wisdom in the format of a biblical text. The project features:
- Old Testament & New Testament: Organized chapters containing Rust teachings and parables
- Sunday School Lessons: Guided lessons organized by topic with multiple sections
- Full-Text Search: Searchable index of all books, chapters, and lessons
- Verse of the Day: Random featured verse displayed on the homepage
- Responsive Design: Mobile-friendly interface with Tailwind CSS
- Performance: Fully static site generation optimized for fast loading
the-rust-bible.github.io/
├── app/ # Next.js app directory
│ ├── book/[...slug]/ # Dynamic book and chapter pages
│ ├── sunday-school/ # Sunday School section
│ │ ├── page.tsx # Lessons index
│ │ └── [...slug]/ # Dynamic lesson and section pages
│ ├── components/ # React components
│ │ ├── Header.tsx # Navigation header
│ │ ├── Search.tsx # Full-text search UI
│ │ ├── VerseOfTheDay.tsx # Daily verse display
│ │ ├── ChapterNavigation.tsx # Navigation between chapters
│ │ ├── ReadingProgress.tsx # Progress bar for reading
│ │ ├── DarkModeToggle.tsx # Theme switcher
│ │ └── [other components]
│ ├── lib/ # Utility functions
│ │ ├── search.ts # Search indexing and filtering
│ │ ├── verses.ts # Verse utilities
│ │ └── navigation.ts # Navigation helpers
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Homepage
│ └── globals.css # Global styles
├── public/
│ ├── Books/
│ │ ├── Old Testament/ # Old Testament markdown files
│ │ └── New Testament/ # New Testament markdown files
│ ├── Lessons/
│ │ └── [lesson-name]/ # Sunday School lessons with sections
│ ├── search-index.json # Generated search index
│ ├── sitemap.xml # Generated sitemap
│ ├── robots.txt # SEO robots file
│ └── openingVerse.json # Verse of the Day data
├── scripts/
│ ├── generate-search-index.js # Builds searchable index
│ └── generate-sitemap.js # Generates XML sitemap
├── next.config.ts # Next.js configuration for static export
├── tailwind.config.ts # Tailwind CSS configuration
├── tsconfig.json # TypeScript configuration
└── package.json # Dependencies and scripts
Create a markdown file in the appropriate testament folder:
Format: <number> <book name>.md
Location:
- Old Testament:
public/Books/Old Testament/ - New Testament:
public/Books/New Testament/
Example: public/Books/Old Testament/2 Exodus.md
The number at the beginning is used for ordering the books in the list.
Markdown Structure:
# 1 Genesis
Content about the book...
## Chapter 1: The Creation
Chapter content...
## Chapter 2: Adam and Eve
More chapter content...Create a folder for the lesson, then add markdown sections inside:
Structure:
public/Lessons/Lesson Name/
├── 1 Introduction.md
├── 2 Main Content.md
└── 3 Conclusion.md
The number prefix determines the section order.
- Node.js 18+ and npm
npm installThe dev server builds the site and serves static files:
npm run devThe site will be available at http://localhost:3000
npm run buildThis runs the prebuild scripts to generate search index and sitemap, then builds the static export. Output is in the out/ directory.
npm run dev # Start dev server with static generation
npm run build # Build for production
npm run build:analyze # Build with bundle size analysis
npm run start # Serve the static build locally
npm run lint # Run ESLint
npm run lint:fix # Fix linting issues
npm run format # Format code with Prettier
npm run format:check # Check code formatting
npm run clean # Remove generated files and cache
npm run bundle-size # Analyze bundle sizeThe site automatically deploys to GitHub Pages when you push to the main branch.
- Go to your repository settings
- Navigate to Pages
- Set Source to GitHub Actions
The .github/workflows/deploy.yml workflow automatically builds and deploys your site on push.
To test the static build locally before pushing:
npm run build
npm run start- Built with Next.js using static export (
output: "export") - Zero JavaScript overhead where possible
- Fully compatible with GitHub Pages
- Full-text search across all books, chapters, and lessons
- Dynamically generated search index (
public/search-index.json) - Powered by client-side filtering
- Mobile-first approach
- Tailwind CSS with amber/brown biblical theme
- Accessible component structure
- Bundle size optimization with webpack config
- Tree-shaking and minification enabled
- Optimized Lucide React icon imports
- Trailing slashes for consistent URLs
- Markdown-based content (easy to edit and version control)
- Gray-matter for frontmatter support
- Automatic file discovery and ordering by prefix numbers
- React-markdown for rendering
- Next.js 15.1: React framework for static generation
- React 19: UI library
- TypeScript: Type-safe development
- Tailwind CSS 3.4: Utility-first CSS framework
- Lucide React 0.559: Icon library
- PostCSS & Autoprefixer: CSS processing
- React-markdown 9.0: Markdown rendering
- Gray-matter 4.0: YAML frontmatter parsing
- ESLint 9.0: Code linting
- Prettier 3.4: Code formatting
- TypeScript 5.6: Type checking
The site uses a biblical theme with:
- Colors: Amber and brown tones (
amber-*Tailwind classes) - Typography: Bold, readable fonts
- Icons: Lucide React icons for visual interest
- Animations: Subtle hover effects and transitions
- Responsive: Adapts gracefully from mobile to desktop
Content contributions are welcome. Follow the structure above to add books or lessons, then create a pull request.
MIT License - See LICENSE file for details
- Repository: The Rust Bible on GitHub
- Website: the-rust-bible.github.io