Skip to content

Getting Started with HydePHP: A Modern Static Site Generator

Posted by author in the category "Tutorial"

After exploring various static site generators, I decided to build this blog with HydePHP, and I'm impressed with what it offers. If you're looking for a static site generator that combines the elegance of Laravel with the simplicity of Markdown, HydePHP might be exactly what you need.

What is HydePHP?

HydePHP is a static site generator built on top of Laravel Zero. It's designed to make creating blogs, documentation sites, and other static websites as simple as possible while providing the power and flexibility that Laravel developers love.

Key Features

  • Laravel-based: Built on Laravel Zero, so you get all the Laravel conventions you know and love
  • Multiple content types: Support for Markdown posts, Blade pages, and documentation
  • Built-in theming: Beautiful, responsive themes out of the box with dark mode support
  • RSS & Sitemap: Automatic generation of RSS feeds and sitemaps
  • Live reload: Development server with automatic rebuilding
  • Torchlight integration: Beautiful syntax highlighting for code blocks

Quick Setup

Getting started with HydePHP is straightforward:

# Install via Composer
composer create-project hyde/hyde my-blog

# Navigate to your project
cd my-blog

# Start the development server
php hyde serve

That's it! You'll have a fully functional blog running at http://localhost:8080.

Project Structure

Here's what you'll find in a fresh HydePHP installation:

├── _docs/          # Documentation pages
├── _media/         # Images and assets  
├── _pages/         # Static pages (Blade/Markdown)
├── _posts/         # Blog posts
├── _site/          # Generated static site
├── config/         # Configuration files
└── resources/      # Source assets

Creating Content

Blog Posts

Create a new blog post:

php hyde make:post "My First Post"

This creates a Markdown file in _posts/ with front matter:

---
title: "My First Post"
description: "Post description"
category: "General"
author: "cameron"
date: "2025-01-18"
---

# My First Post

Your content goes here...

Pages

For static pages like an About page:

php hyde make:page about --type=markdown

Building Your Site

When you're ready to deploy:

php hyde build

This generates your static site in the _site/ directory, ready for deployment to any static hosting provider.

Configuration

The main configuration happens in config/hyde.php:

return [
    'name' => 'Your Site Name',
    'url' => 'https://yoursite.com',
    'features' => [
        Feature::MarkdownPosts,
        Feature::BladePages,
        Feature::Darkmode,
        // ... more features
    ],
    // ... more config
];

Why I Chose HydePHP

  1. Laravel conventions: As a Laravel developer, the familiar structure and conventions made it easy to get started
  2. Flexibility: I can use Blade templates for complex layouts and Markdown for content
  3. Performance: Static sites are fast, and HydePHP generates clean, optimized HTML
  4. Developer experience: Great tooling with live reload and helpful CLI commands
  5. Active development: Regular updates and responsive community

Next Steps

If you're interested in trying HydePHP:

  1. Check out the official documentation
  2. Browse the GitHub repository
  3. Join the community discussions
  4. Start building your own site!

HydePHP strikes a great balance between simplicity and power. Whether you're building a personal blog, documentation site, or marketing pages, it's definitely worth considering for your next static site project.


Have you tried HydePHP or other static site generators? I'd love to hear about your experiences and what tools you prefer for building static sites.

End of article