johannschopplich/kirby-helpers 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

johannschopplich/kirby-helpers

最新稳定版本:6.5.0

Composer 安装命令:

composer require johannschopplich/kirby-helpers

包简介

Environment, SEO, and build utilities for Kirby CMS

README 文档

README

A comprehensive toolkit that extends Kirby CMS with essential development utilities. This plugin consolidates commonly needed functionality into a single, well-integrated package, eliminating the need for multiple separate plugins.

Why Kirby Helpers?

Building modern Kirby websites often requires the same set of tools: environment variable management, SEO meta tags, XML sitemaps, URL redirects, and modern build tool integration. Instead of installing and configuring multiple plugins, Kirby Helpers provides these essential features in one cohesive package, designed to work seamlessly together.

Features

⚡️ Environment Variables

Load .env files automatically and access variables through a global env() helper function. Perfect for managing API keys, database credentials, and environment-specific settings securely.

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

Read more →

🗂 SEO Meta Tags

Generate comprehensive meta tags for search engines and social media automatically. Supports OpenGraph, Twitter Cards, JSON-LD structured data, and canonical URLs with smart defaults and easy customization.

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

Read more →

🧭 XML Sitemaps

Auto-generate XML sitemaps with full multilingual support. Automatically excludes unwanted pages and templates while providing fine-grained control over what gets included.

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

Read more →

🔀 Smart Redirects

Create flexible redirect rules that only activate when no existing page matches the URL. Supports pattern matching, placeholders, and custom logic through callbacks.

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

Read more →

⚡️ Vite Integration

Seamless Vite integration for modern frontend tooling. Automatically switches between development server and production assets, with support for Hot Module Replacement during development.

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

Read more →

Requirements

  • Kirby 4+
  • PHP 8.1+

Installation

Composer (Recommended)

composer require johannschopplich/kirby-helpers

Manual Installation

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

Quick Start

  1. Environment Variables: Create a .env file in your project root and start using env('VARIABLE_NAME')

  2. Meta Tags: Add <?= $page->meta()->social() ?> to your header snippet

  3. Sitemap: Enable in your config with 'johannschopplich.helpers.sitemap.enabled' => true

  4. Redirects: Define redirect rules in your config under 'johannschopplich.helpers.redirects'

  5. Vite: Configure your Vite setup and use vite()->js() and vite()->css() helpers

Documentation

Detailed documentation for each feature is available in the docs directory:

License

MIT License © 2020-PRESENT Johann Schopplich

MIT License © 2020-2022 Bastian Allgeier

MIT License © 2020-2022 Nico Hoffmann

统计信息

  • 总下载量: 7.05k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 28
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 28
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-20