Skip to content
/ QiBlog Public

A simple, secure flat-file CMS built with PHP for blogging with WYSIWYG editor and SEO features.

Notifications You must be signed in to change notification settings

renggap/QiBlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

QiBlog: Modern Flat-File CMS with Enhanced UI/UX

A beautiful, secure, and modern flat-file CMS built with PHP featuring a comprehensive design system, dark mode support, and exceptional user experience.

QiBlog Screenshot

✨ Features

🎨 Modern UI/UX Design

  • Comprehensive Design System: Cohesive warm brown/cream color palette with modern typography
  • Dark Mode Support: Automatic system preference detection with manual toggle
  • Responsive Design: Mobile-first approach with fluid layouts
  • Smooth Animations: Subtle fade-in effects and hover interactions
  • Component-Based Architecture: Reusable UI components for consistency

πŸ”§ Core Functionality

  • Flat-File Storage: Posts stored as HTML files with YAML frontmatter
  • WYSIWYG Editor: CKEditor 5 for rich content creation
  • Session-Based Authentication: Secure admin login system
  • SEO Optimized: Meta tags, structured data, XML sitemap, friendly URLs
  • Categories & Tags: Organize content with flexible taxonomy

πŸš€ Enhanced User Experience

  • Reading Progress Indicator: Visual progress bar for long posts
  • Social Sharing: Built-in Twitter, Facebook, and copy-link sharing
  • Breadcrumb Navigation: Easy site navigation
  • Statistics Dashboard: Overview cards in admin panel
  • Quick Actions: Streamlined workflow for content management

πŸ”’ Security & Performance

  • CSRF Protection: Comprehensive cross-site request forgery prevention
  • XSS Prevention: Input sanitization and output escaping
  • Directory Traversal Protection: Secure slug sanitization
  • HTTPS Enforcement: Automatic secure connection redirect
  • Performance Optimized: Efficient CSS architecture and minimal dependencies

β™Ώ Accessibility

  • WCAG 2.1 AA Compliant: Screen reader support and keyboard navigation
  • Skip Links: Quick navigation for assistive technologies
  • High Contrast Support: Enhanced visibility options
  • Focus Management: Proper focus indicators and tab order
  • ARIA Labels: Comprehensive accessibility markup

🎯 Quick Start

Installation

  1. Prerequisites

    PHP 7.4+ with file system permissions
    Web server (Apache/Nginx) with URL rewriting
  2. Setup

    # Clone or download the project
    git clone https://github.com/renggap/QiBlog.git
    cd QiBlog
    
    # Set permissions
    chmod 755 posts/
    chmod 644 assets/css/*.css
  3. Configuration

    # Set admin password (recommended)
    export ADMIN_PASSWORD="your-secure-password"
    
    # Or for Apache, add to .htaccess:
    SetEnv ADMIN_PASSWORD "your-secure-password"
  4. Launch

    # Access your blog
    http://yourdomain.com/index.php
    
    # Admin panel
    http://yourdomain.com/admin/

πŸ“– Usage Guide

Admin Access

  • Navigate to /admin/ or /admin/login.php
  • Login with your configured password
  • Default development password: admin123 (⚠️ Change for production!)

Content Creation

  1. Create Posts: Use the "Create New Post" button in the admin dashboard
  2. Rich Editor: CKEditor 5 with full formatting capabilities
  3. Metadata: Add categories, tags, and custom excerpts
  4. Preview: Live preview functionality before publishing

Content Management

  • Dashboard Overview: Statistics cards showing post counts and recent activity
  • Post Management: Card-based interface replacing traditional tables
  • Quick Actions: Edit, view, and delete posts with intuitive controls
  • Search & Filter: Advanced content organization tools

Frontend Experience

  • Homepage: Modern card-based layout with hover effects
  • Post View: Enhanced reading experience with progress indicator
  • Navigation: Breadcrumb navigation and smooth scrolling
  • Social Features: Built-in sharing and engagement tools

πŸ“ Project Structure

QiBlog/
β”œβ”€β”€ index.php                    # Enhanced homepage with modern design
β”œβ”€β”€ post.php                     # Redesigned post view with reading features
β”œβ”€β”€ sitemap.php                  # XML sitemap generator
β”œβ”€β”€ .htaccess                    # URL rewriting and security headers
β”‚
β”œβ”€β”€ admin/                       # Modernized admin panel
β”‚   β”œβ”€β”€ dashboard.php           # Statistics dashboard with card layout
β”‚   β”œβ”€β”€ create.php              # Enhanced post creation interface
β”‚   β”œβ”€β”€ edit.php                # Improved post editing experience
β”‚   β”œβ”€β”€ login.php               # Secure admin authentication
β”‚   └── logout.php              # Session management
β”‚
β”œβ”€β”€ includes/                   # Core PHP functionality
β”‚   β”œβ”€β”€ config.php              # Site configuration and settings
β”‚   β”œβ”€β”€ functions.php           # Core functions and utilities
β”‚   β”œβ”€β”€ auth.php                # Authentication system
β”‚   └── Parsedown.php           # Markdown parsing (if needed)
β”‚
β”œβ”€β”€ posts/                      # Content storage
β”‚   └── *.html                  # Post files with YAML frontmatter
β”‚
└── assets/                     # Enhanced design system
    β”œβ”€β”€ css/
    β”‚   β”œβ”€β”€ style.css           # Main stylesheet with legacy support
    β”‚   β”‚
    β”‚   β”œβ”€β”€ core/               # Foundation files
    β”‚   β”‚   β”œβ”€β”€ variables.css   # Design tokens and CSS custom properties
    β”‚   β”‚   β”œβ”€β”€ reset.css       # Modern CSS reset
    β”‚   β”‚   └── typography.css  # Typography system
    β”‚   β”‚
    β”‚   β”œβ”€β”€ components/         # Reusable UI components
    β”‚   β”‚   β”œβ”€β”€ buttons.css     # Button variants and states
    β”‚   β”‚   β”œβ”€β”€ cards.css       # Card components and layouts
    β”‚   β”‚   β”œβ”€β”€ navigation.css  # Navigation and breadcrumbs
    β”‚   β”‚   └── forms.css       # Form elements and inputs
    β”‚   β”‚
    β”‚   β”œβ”€β”€ utilities/          # Utility classes
    β”‚   β”‚   β”œβ”€β”€ animations.css  # Animation and transition utilities
    β”‚   β”‚   β”œβ”€β”€ responsive.css  # Responsive design helpers
    β”‚   β”‚   └── accessibility.css # A11y enhancement utilities
    β”‚   β”‚
    β”‚   └── themes/             # Theme system
    β”‚       β”œβ”€β”€ light.css       # Light theme styles
    β”‚       └── dark.css        # Dark theme styles
    β”‚
    β”œβ”€β”€ js/                     # JavaScript files
    β”‚   β”œβ”€β”€ *.min.js            # Minified JavaScript assets
    β”‚   └── *.js                # Development scripts
    β”‚
    β”œβ”€β”€ fonts/                  # Web fonts
    β”‚   └── *.woff2             # Optimized font files
    β”‚
    └── images/                # Image assets
        └── *.jpg, *.png, *.svg # Optimized images

🎨 Design System

Color Palette

  • Primary: #8B6914 (Warm golden brown)
  • Accent: #D4AF37 (Gold accent)
  • Background: #F8F4E1 (Warm cream)
  • Text: #543310 (Deep brown)

Typography

  • Primary Font: Manrope (Google Fonts)
  • Heading Font: Manrope with serif fallback
  • Monospace: Fira Code for code blocks

Components

  • Buttons: Multiple variants (primary, secondary, accent, ghost)
  • Cards: Post cards, admin cards, statistics cards
  • Navigation: Responsive navigation with breadcrumbs
  • Forms: Enhanced form elements with validation states

πŸ”§ Configuration

Environment Variables

# Admin password (required for production)
ADMIN_PASSWORD="your-secure-password"

# Site configuration
SITE_TITLE="Your Blog Name"
SITE_URL="https://yourdomain.com"
TIMEZONE="Asia/Jakarta"

File Permissions

# Posts directory must be writable
chmod 755 posts/

# Assets should be readable
chmod 644 assets/css/*.css
chmod 644 assets/js/*.js

πŸš€ Advanced Features

Theme System

  • Automatic Detection: Respects user's system preference
  • Manual Toggle: Theme switcher in navigation
  • Persistent Choice: Remembers user preference
  • Smooth Transitions: Seamless theme switching

Performance Optimizations

  • CSS Architecture: Modular CSS with efficient selectors
  • Font Loading: Optimized web font loading
  • Image Optimization: Responsive images with proper sizing
  • Animation Performance: GPU-accelerated animations

Security Enhancements

  • Content Security Policy: Comprehensive CSP headers
  • HTTPS Enforcement: Automatic secure redirects
  • Input Validation: Strict sanitization of all inputs
  • Session Security: Secure session management

πŸ” SEO & Social

Meta Tags

  • Dynamic title and description generation
  • Open Graph tags for social sharing
  • Twitter Card support
  • Canonical URLs

Structured Data

  • JSON-LD Article schema
  • Breadcrumb navigation markup
  • Search engine optimization

Social Integration

  • Twitter sharing with custom text
  • Facebook sharing with previews
  • Copy-to-clipboard functionality
  • Social media meta tags

πŸ“± Responsive Design

Breakpoints

  • Mobile: < 640px
  • Tablet: 640px - 1024px
  • Desktop: > 1024px

Mobile Features

  • Touch-friendly interactions
  • Optimized navigation
  • Readable typography
  • Efficient layouts

β™Ώ Accessibility Features

WCAG 2.1 AA Compliance

  • Proper heading hierarchy
  • Alt text for images
  • Keyboard navigation
  • Focus management

Assistive Technology Support

  • Screen reader compatibility
  • High contrast mode
  • Reduced motion support
  • Skip navigation links

πŸ”§ Development

CSS Architecture

The project uses a modern CSS architecture with:

  • CSS Custom Properties for theming
  • Component-based organization
  • Utility-first approach for rapid development
  • BEM-inspired naming for clarity

Customization

/* Override design tokens in your custom CSS */
:root {
  --color-primary: #your-color;
  --font-family-primary: 'Your Font', sans-serif;
  --space-md: 1.5rem;
}

πŸ“ˆ Performance

Optimization Features

  • Minimal Dependencies: Only essential external resources
  • Efficient CSS: Optimized selectors and minimal redundancy
  • Font Display: Swap for faster text rendering
  • Image Optimization: Proper sizing and modern formats

Best Practices

  • Semantic HTML structure
  • Progressive enhancement
  • Mobile-first CSS
  • Accessible by default

🀝 Contributing

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

Code Style

  • Use consistent indentation (2 spaces)
  • Follow BEM naming conventions
  • Write semantic HTML
  • Maintain accessibility standards

πŸ“„ License

This project is open source and available under the MIT License.

πŸ†˜ Support

Getting Help

  • Documentation: Comprehensive README and inline comments
  • Issues: GitHub issue tracker for bug reports
  • Discussions: GitHub discussions for questions and ideas

Troubleshooting

  • Check PHP error logs
  • Verify file permissions
  • Ensure HTTPS is configured
  • Test with different browsers

QiBlog - A modern, beautiful, and secure flat-file CMS that prioritizes user experience and developer happiness. Built with ❀️ and attention to detail.

About

A simple, secure flat-file CMS built with PHP for blogging with WYSIWYG editor and SEO features.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published