stuartcusackie / statamic-seo
Statamic 3 的简单 SEO 包。
0.9.1
2024-05-21 11:23 UTC
Requires
- php: ^8.0
- laravel/framework: ^8.0 || ^9.0 || ^10.0 || ^11.0
- statamic/cms: ^3.0|^4.0|^5.0
- dev-main
- 0.9.1
- 0.9
- 0.8.1
- 0.8.0
- 0.7.1
- 0.7.0
- 0.6.3
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.8
- 0.5.7
- 0.5.6
- 0.5.5
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.0
- 0.3.12
- 0.3.11
- 0.3.10
- 0.3.9
- 0.3.8
- 0.3.7
- 0.3.6
- 0.3.5
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.9
- 0.2.8
- 0.2.7
- 0.2.6
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2
- 0.1.12
- 0.1.11
- 0.1.10
- 0.1.9
- 0.1.8
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1
- dev-dev
This package is auto-updated.
Last update: 2024-09-21 12:01:55 UTC
README
Statamic 3 的简单 Blade SEO 包。警告:请谨慎使用。未经充分测试。我使用这个包来处理我自己的一些不寻常的 Statamic 项目。
安装
首先,安装此包。
composer require stuartcusackie/statamic-seo
然后,设置一个名为 'global_seo' 的全局字段集。将 statamic-seo:global_seo 字段集分配给此。
发布
你应该发布视图和字段集。你可能需要为每个字段集中的图像字段配置资产容器,默认为 'assets'。
php please vendor:publish --tag=statamic-seo-views
php please vendor:publish --tag=statamic-seo-fieldsets
用法
只需在模板的头部调用外观即可。
{{ SEO::output() }}
重要:自定义路由
当使用自定义路由时,您需要使用提供的 Facade 手动启动级联。
use stuartcusackie\StatamicSEO\Facades\SEO;
public function customRoute(Request $request, $entry) {
$view = (new \Statamic\View\View)
->template($entry->template)
->layout('layouts/custom')
->with(['page' => $entry]);
SEO::initCascadeArray($view->gatherData());
return $view;
}
待办事项
- 尝试将全局 'collection' 返回值转换为全局 'blueprint' 返回值。
- 集合可能不总是包含返回字段。
- 这应该对术语也适用。
- 为 og 图像设置基于蓝图/集合的返回值。
- 添加架构
- 带有切换选项的面包屑
- 每页架构