graphiques-digitale / silverstripe-seo-open-graph
为页面添加 Open Graph 元数据
v1.0.0
2016-07-05 04:24 UTC
Requires
This package is not auto-updated.
Last update: 2024-09-14 19:20:07 UTC
README
概述
启用页面上的 Open Graph 元数据。
它是 graphiques-digitale/silverstripe-seo-metadata 的模块扩展 graphiques-digitale/silverstripe-seo-metadata
灵感来源于: http://ogp.me
它打算与它的兄弟组件一起使用
Graphiques-Digitale/silverstripe-seo-icons
Graphiques-Digitale/silverstripe-seo-facebook-domain-insights
这些都是可选的,并从 alpha 版本的 SSSEO
中拆分出来,现在已不再需要。
整个模块集合主要基于 2013 年每个网页都应该有的 18 个元标签。
另外,一个好的概述: 使用 Silverstripe 3 的 SEO 的 5 个技巧。
安装
Composer
composer require graphiques-digitale/silverstripe-seo-open-graph
- 使用
/dev/build/?flush
重建
从 ZIP 文件
- 将解压缩的文件夹
silverstripe-seo-open-graph-{version}
放入 SilverStripe webroot 的silverstripe-seo-open-graph
中 - 使用
/dev/build/?flush
重建
CMS 使用
@todo 解释使用方法
模板使用
根据您的配置,一般思路是将所有与元数据相关的头部内容替换为 $Metadata()
,位于 <head>
标签和 <% base_tag %>
包含下面,例如:
<head> <% base_tag %> $Metadata() <!-- further includes ~ viewport, etc. --> </head>
这将输出类似的内容
<head> <base href="http://dev.seo.silverstripe.org/"><!--[if lte IE 6]></base><![endif]--> <!-- SEO --> <!-- Metadata --> <meta charset="UTF-8" /> <link rel="canonical" href="http://dev.seo.silverstripe.org/" /> <title>Your Site Name | Home - your tagline here</title> <meta name="description" content="Welcome to SilverStripe! This is the default home page. You can edit this page by opening the CMS. You can now access the developer documentation, or begin the tutorials." /> <!-- Open Graph --> <meta property="og:type" content="website" /> <meta property="og:url" content="http://dev.seo.silverstripe.org/" /> <meta property="og:site_name" content="Your Site Name" /> <meta property="og:title" content="Home" /> <meta property="og:description" content="Welcome to SilverStripe! This is the default home page. You can edit this page by opening the CMS. You can now access the developer documentation, or begin the tutorials." /> <!-- END SEO --> <!-- further includes ~ viewport, etc. --> </head>
问题跟踪器
问题在 GitHub 上跟踪 @ 问题跟踪器
开发和贡献
如果您在这些 SEO 模块领域有专业知识,并希望帮助,请联系 @ hello@graphiquesdigitale.net
~ 它们需要维护,随着 HTML 的发展,它们应该持续改进,我相信它们可以通过领域专家一般得到改进。
许可证
BSD-3-Clause 许可证
见 @ 为什么是 BSD?