ikuzo/kirbypluginseo

Kirby 3 SEO 插件

安装: 180

依赖: 0

建议者: 0

安全性: 0

星标: 2

关注者: 4

分支: 0

类型:kirby-plugin

1.0.8 2019-11-15 11:48 UTC

This package is auto-updated.

Last update: 2024-09-15 23:04:32 UTC


README

Kirby CMS 插件,用于在面板上编辑 SEO 数据,并在 head 标签中显示。

编辑元标题和描述,社交网络 og 元数据,noindex 和规范 URL。

蓝图

要在面板中显示 SEO 编辑标签,请将 tabs/seo 添加到您的蓝图

带有页面预设的示例

title: Simple Page

tabs:

  # content tab
  content:
    label: Content
    icon: text
    preset: page
    fields:
      text:
        label: Text
        type: textarea
        size: huge

  # seo tab
  seo: tabs/seo

代码片段

要在您的网站 head 标签中显示 SEO 元数据,请包含代码片段 seo-head

header.php 代码片段中的示例

<!doctype html>
<html lang="en">
<head>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
    
  <?php snippet('seo-head'); ?>

  <?= css(['assets/css/index.css', '@auto']) ?>

</head>
<body>

您还可以向代码片段传递参数,以覆盖页面数据

snippet('seo-head', [
  'title' => 'title',
  'description' => 'description',
  'ogTitle' => 'og title',
  'ogDesc' => 'og description',
  'ogImage' => 'og image',
  'noindex' => true,
  'canonical' => 'canonical-url'
]);

选项

  • ikuzo.seo.meta.title.prefix : 附加到元标题的前缀,默认 ""
  • ikuzo.seo.meta.title.suffix : 添加到元标题的后缀,默认 " | 网站标题"
  • ikuzo.seo.og.title.prefix : 附加到 og 标题的前缀,默认 ""
  • ikuzo.seo.og.title.suffix : 添加到 og 标题的后缀,默认 " | 网站标题"