hashandsalt/kirby4-seo
Composer 安装命令:
composer require hashandsalt/kirby4-seo
包简介
Kirby 4 - SEO tools
README 文档
README
A small plugin for generating metadata using shared controllers and field data. Also creates Facebook Opengraph and Twitter social sharing information.
Installation
Manual
To use this plugin, place all the files in site/plugins/kirby3-seo.
Composer
composer require hashandsalt/kirby4-seo
Commerical Usage
This plugin is free but if you use it in a commercial project please consider to
Usage
After installing the plugin, set up the controllers to bring the shared SEO controller into each of your template controllers.
The bare minimum controller looks like this:
<?php
return function ($page, $kirby, $site) {
// SEO
$seo = $kirby->controller('seo' , compact('page', 'site', 'kirby'));
return $seo;
};
To override any of the values, you can do this inside your controller. For example, to change the format of the meta title, you could do this:
<?php
return function ($page, $kirby, $site) {
// Meta
$seo = $kirby->controller('seo' , compact('page', 'site', 'kirby'));
// Override Meta Title
$metatitle = $page->seotitle().' | '.$site->title();
$data = compact('metatitle');
return a::merge($seo, $data);
};
Additionally, you need to populate the pages with information that is needed for the meta tags to be filled out correctly. The plugin contains blueprints for this and is meant to be used as tabs on your pages:
title: Default
tabs:
# SEO META
meta: tabs/seo/meta
In the site.yml also set up the contact tab which will capture social media account information.
title: Site
tabs:
# Contact
contact: tabs/seo/contact
Finally, output the meta tags in your templates with the following snippet.
<?= snippet('seo/meta') ?>
For convenience the plugin also contains a favicon snippet:
<?= snippet('seo/favicon') ?>
You can generate the favicons at this website link
Generating JSON Schema data
To generate any kind of schema data, you can use our Schema plugin in tandem with this plugin.
hashandsalt/kirby4-seo 适用场景与选型建议
hashandsalt/kirby4-seo 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 195 次下载、GitHub Stars 达 6, 最近一次更新时间为 2023 年 12 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「kirby4」 「kirby4-cms」 「kirby4-plugin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 hashandsalt/kirby4-seo 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hashandsalt/kirby4-seo 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hashandsalt/kirby4-seo 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Kirby plugin to schedule the automatic publishing of pages on a certain date+time. It is built to work with enabled cache.
Courier offers a convenient and painless solution for creating emails tailored for your Kirby website.
A search plugin for Kirby (v3+ that searches for full word combinations rather than just individual words.
The standalone version of Laravel's Blade templating engine for use outside of Laravel.
Helper tool that enables ray on all the extendable methods.
Kirby Admin Bar
统计信息
- 总下载量: 195
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-21