johannschopplich/kirby-helpers

Environment, SEO, and build utilities for Kirby CMS

Maintainers

Package info

github.com/johannschopplich/kirby-helpers

Homepage

Type:kirby-plugin

pkg:composer/johannschopplich/kirby-helpers

Statistics

Installs: 7 833

Dependents: 0

Suggesters: 0

Stars: 28

Open Issues: 1


README

Kirby Helpers logo

Kirby Helpers

Environment variables, SEO meta, XML sitemaps, URL redirects, and Vite integration for Kirby – the utilities most projects re-implement, in one plugin.

EnvironmentSEO MetaSitemapsRedirectsVite

When to Use

I want to… Use
Read typed values from a .env file env('KEY', $fallback)
Emit meta description, OpenGraph, Twitter, and JSON-LD $page->meta()->social()
Auto-generate an XML sitemap with hreflang sitemap.enabled option
Redirect dead URLs without touching existing content redirects option
Serve Vite dev or built assets automatically vite()->js() / vite()->css()

Features

🔑 Environment Variables

Load .env files and read variables through a global env() helper, with type coercion and fallbacks.

// .env file support with fallbacks
$apiKey = env('STRIPE_SECRET_KEY', 'fallback-key');

Read more →

🏷️ SEO Meta Tags

Generate meta description, OpenGraph, Twitter Card, JSON-LD, and canonical tags from page fields, page models, and global defaults.

// Complete meta tag generation
<?= $page->meta()->social() ?>
<?= $page->meta()->robots() ?>

Read more →

🧭 XML Sitemaps

Auto-generate XML sitemaps with multilingual hreflang, template and page exclusion, and per-page control via blueprints.

// Automatically available at /sitemap.xml
// Supports hreflang for multilingual sites

Read more →

🔀 Smart Redirects

Pattern-based redirect rules that only fire when no existing page or route matches the URL, with placeholders and callback targets.

// Pattern-based redirects with placeholders
'old/blog/(:any)' => 'news/$1'

Read more →

⚡️ Vite Integration

Switch between the Vite dev server (with HMR) and built manifest.json assets automatically, including Panel asset integration.

// Load Vite assets with automatic dev/production switching
<?= vite()->js('src/main.js') ?>
<?= vite()->css('src/main.js') ?>

Read more →

Requirements

  • Kirby 5
  • PHP 8.3+

Installation

Composer (Recommended)

composer require johannschopplich/kirby-helpers

Manual Installation

Download and copy this repository to /site/plugins/kirby-helpers.

License

MIT License © 2020-PRESENT Johann Schopplich

MIT License © 2020-2022 Bastian Allgeier

MIT License © 2020-2022 Nico Hoffmann