Thank you for your interest in contributing to Blogr! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- Contributing Areas
- Development Workflow
- Testing
- Code Style
- Submitting Changes
- Theme Development
- Documentation
- Community
This project follows the Rust Code of Conduct. Please be respectful and inclusive in all interactions.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/yourusername/blogr.git cd blogr - Add the upstream remote:
git remote add upstream https://github.com/bahdotsh/blogr.git
- Rust 1.70+ - Install via rustup
- Git - For version control
- GitHub CLI (optional) - For easier PR management
# Clone the repository
git clone https://github.com/bahdotsh/blogr.git
cd blogr
# Build the project
cargo build
# Run tests
cargo test
# Install locally for testing
cargo install --path blogr-cliInstall recommended development tools:
# Code formatting
rustup component add rustfmt
# Linting
rustup component add clippy
# Coverage (optional)
cargo install cargo-tarpaulin
# Dependency optimization
cargo install cargo-chefBlogr is organized as a Rust workspace with two main crates:
blogr/
├── Cargo.toml # Workspace configuration
├── blogr-cli/ # Main CLI application
│ ├── src/
│ │ ├── main.rs # CLI entry point
│ │ ├── commands/ # CLI subcommand implementations
│ │ ├── tui/ # Terminal user interface
│ │ ├── generator/ # Static site generation
│ │ ├── newsletter/ # Email newsletter subsystem
│ │ ├── config.rs # Configuration parsing
│ │ ├── content.rs # Post/content models
│ │ ├── project.rs # Project discovery/validation
│ │ └── utils.rs # Shared utilities
│ └── templates/ # Project initialization templates
├── blogr-themes/ # Themes crate
│ └── src/
│ ├── lib.rs # Theme registry & trait
│ ├── minimal_retro/ # Minimal Retro theme (blog)
│ ├── obsidian/ # Obsidian theme (blog)
│ ├── terminal_candy/ # Terminal Candy theme (blog)
│ ├── brutja/ # Brutja theme (blog)
│ ├── dark_minimal/ # Dark Minimal theme (personal)
│ ├── musashi/ # Musashi theme (personal)
│ ├── slate_portfolio/# Slate Portfolio theme (personal)
│ └── typewriter/ # Typewriter theme (personal)
└── README.md
- CLI Commands (
blogr-cli/src/commands/): Command-line interface implementations - TUI System (
blogr-cli/src/tui/): Terminal user interface components - Site Generator (
blogr-cli/src/generator/): Static site generation logic - Newsletter (
blogr-cli/src/newsletter/): Email newsletter subsystem - Theme System (
blogr-themes/src/): Theme architecture and built-in themes
We especially need help with themes! The current Minimal Retro theme is just the beginning.
Theme Ideas Needed:
- Dark themes
- Academic/research-focused themes
- Photography/portfolio themes
- Minimalist/brutalist themes
- Corporate/professional themes
- Technical documentation themes
- New CLI commands
- TUI improvements
- Generator enhancements
- GitHub integration features
- Configuration options
- Performance optimizations
- Cross-platform compatibility
- Error handling improvements
- Edge case handling
- API documentation
- User guides
- Examples and tutorials
- Code comments
- Unit tests
- Integration tests
- Theme testing
- Cross-platform testing
main- Stable release branchdevelop- Development integration branch- Feature branches:
feature/your-feature-name - Bug fixes:
fix/issue-description - Themes:
theme/theme-name
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following the code style guidelines
-
Test your changes:
cargo test cargo clippy cargo fmt -
Commit your changes:
git add . git commit -m "feat: add your feature description"
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub
We follow conventional commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style changesrefactor:- Code refactoringtest:- Test additions/changestheme:- Theme-related changes
Examples:
feat: add dark theme support
fix: resolve TUI editor cursor positioning
docs: update theme development guide
theme: add academic theme
# Run all tests
cargo test
# Run tests for specific crate
cargo test -p blogr-cli
cargo test -p blogr-themes
# Run tests with coverage
cargo tarpaulin --all-features- All new features must include tests
- Bug fixes should include regression tests
- Themes should include visual/rendering tests
- Maintain or improve test coverage
- Follow Rust API Guidelines
- Use
cargo fmtfor formatting - Address all
cargo clippywarnings - Write clear, self-documenting code
- Add documentation for public APIs
# Format code
cargo fmt
# Check linting
cargo clippy -- -D warnings
# Check for common issues
cargo audit- Document all public functions and structs
- Include examples in documentation
- Update README.md for user-facing changes
- Add inline comments for complex logic
-
Ensure your PR:
- Passes all CI checks
- Includes appropriate tests
- Updates documentation if needed
- Follows code style guidelines
-
PR Description should include:
- Clear description of changes
- Motivation and context
- Screenshots for UI changes
- Breaking changes (if any)
-
Review Process:
- Maintainers will review your PR
- Address feedback promptly
- Be open to suggestions and changes
Our CI pipeline runs:
- Code formatting checks (
cargo fmt) - Linting (
cargo clippy) - Tests on multiple platforms (Ubuntu, macOS, Windows)
- Coverage reporting
- Build verification
All checks must pass before merging.
-
Create theme directory:
blogr-themes/src/your_theme_name/ ├── mod.rs ├── templates/ │ ├── base.html │ ├── index.html │ ├── post.html │ └── ... └── assets/ ├── style.css └── ... -
Implement the Theme trait:
use crate::{Theme, ThemeInfo, ThemeTemplates, SiteType}; pub struct YourTheme; impl Theme for YourTheme { fn info(&self) -> ThemeInfo { /* ... */ } fn templates(&self) -> ThemeTemplates { /* ... */ } fn assets(&self) -> HashMap<String, Vec<u8>> { /* ... */ } fn preview_tui_style(&self) -> ratatui::style::Style { /* ... */ } }
-
Register your theme in
blogr-themes/src/lib.rs -
Test your theme:
blogr theme preview your-theme-name
- Follow responsive design principles
- Ensure good accessibility (contrast, font sizes)
- Test on different screen sizes
- Include comprehensive template coverage
- Provide configuration options
- Document theme-specific features
Themes use Tera templating with these available variables:
site- Site configuration and metadataposts- Collection of blog postspost- Current post (in post templates)page- Current page informationconfig- Theme configuration
# Generate and view documentation
cargo doc --open- Update docstrings for code changes
- Add examples to complex functions
- Keep README.md current
- Update CHANGELOG.md for releases
- GitHub Discussions: For questions and general discussion
- Issues: For bug reports and feature requests
- Discord/Matrix: (links to be added)
When reporting bugs:
- Use a clear, descriptive title
- Provide steps to reproduce
- Include system information (OS, Rust version)
- Add relevant logs or error messages
- Mention expected vs actual behavior
For new features:
- Check existing issues first
- Describe the problem you're solving
- Propose a solution
- Consider implementation complexity
- Be open to alternative approaches
Contributors will be recognized in:
- CHANGELOG.md for releases
- README.md acknowledgments
- GitHub contributors page
- Special mentions for significant contributions
Don't hesitate to ask questions! You can:
- Open a GitHub Discussion
- Comment on relevant issues
- Reach out to maintainers
Thank you for contributing to Blogr! 🎉