Kirby is a file-based CMS that gives developers complete freedom with its flexible architecture and clean PHP API. No database, no bloat – just content stored in text files.

With enhancely, your Kirby site becomes instantly readable for AI systems like ChatGPT, Perplexity, and Google AI Overviews. The plugin generates rich JSON-LD structured data automatically, without touching your existing content.

Get Started

  1. Create your enhancely account and get your API key
  2. Install the plugin via Composer
  3. Add your API key to the config
  4. Add <?= enhancely() ?> to your templates
  5. Done – your Kirby site is now AI-ready

How It Works

  • enhancely analyzes your page content via API when a visitor requests a page
  • JSON-LD is generated based on your actual content – no hallucinations, no made-up data
  • Kirby's built-in cache stores the response, so subsequent requests are instant
  • Cache invalidates automatically when you update content in the Panel
    ┌─────────────┐      ┌─────────────┐      ┌─────────────┐
│   Browser   │ ──▶  │    Kirby    │ ──▶  │ enhancely   │
│   Request   │      │   Template  │      │    API      │
└─────────────┘      └─────────────┘      └─────────────┘
                            │                    │
                            │◀───── JSON-LD ─────┘
                            ▼
                     ┌─────────────┐
                     │   Cached    │
                     │  Response   │
                     └─────────────┘
  

Installation

Via Composer (recommended)

    composer require enhancely/kirby-enhancely
  

Via Git Submodule

    git submodule add https://github.com/enhancely/kirby-enhancely.git site/plugins/kirby-enhancely
  

Manual Installation

Download and unzip into site/plugins/kirby-enhancely

Configuration

Add your API key in site/config/config.php:

    return [
    'enhancely.apiKey' => 'your-api-key-for-example-com'
];
  

Or use environment variables (recommended for production):

Create a .env file in your Kirby root:

    ENHANCELY_API_KEY=your-api-key-for-example-com
  

The plugin auto-loads from .env – no additional config needed.

Security Tip: Add .env to your .gitignore and never commit API keys to version control.

Usage

Add one line to your template's <head> section:

    <?= enhancely() ?>
  

That's it. Seriously.

The function outputs a complete <script type="application/ld+json"> block with your page's structured data.

Example: snippets/header.php

    <!DOCTYPE html>
<html lang="<?= $kirby->language() ?? 'en' ?>">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= $page->title() ?></title>

    <?= enhancely() ?>

    <?= css('assets/css/main.css') ?>
</head>
  

Caching Included

The plugin handles caching automatically:

  • ETag-aware: Only fetches new data when content actually changed
  • Uses Kirby's native cache: No additional cache layer needed
  • Auto-invalidation: Cache clears when pages are updated in the Panel

Cache Configuration

    return [
    'enhancely.apiKey' => 'your-api-key',
    'enhancely.expire' => 60  // Cache duration in minutes (0 = infinite)
];
  

Works With Existing Markup

Already have JSON-LD on your site? No problem.

Search engines automatically merge multiple JSON-LD blocks. enhancely adds additional structured data without conflicting with your existing schema markup.

Compatibility & Requirements

  • PHP 8.2 or higher
  • Kirby 4.x or 5.x
  • enhancely account with API key for your domain

Learn More