-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow plugins to add metadata to AMP Stories #2968
Comments
Please share the URL of the story. |
Here is a link to an experimental story that was published... thanks! Link to the archive page: https://cathibosco.com/stories/ |
The Schema.org metadata is: {
"@context": "http://schema.org",
"@type": "BlogPosting",
"author": {
"@type": "Person",
"name": "Cathi Bosco"
},
"dateModified": "2019-08-06T17:16:35+00:00",
"datePublished": "2019-06-24T13:40:57+00:00",
"headline": "Nikk\u014d T\u014dsh\u014d-g\u016b, Japan",
"image": {
"@type": "ImageObject",
"height": 1600,
"url": "https://cathibosco.com/wp-content/uploads/2019/06/Nikko-FI-cathi-bosco-1.png",
"width": 1200
},
"mainEntityOfPage": "https://cathibosco.com/stories/nikko/",
"publisher": {
"@type": "Organization",
"logo": {
"@type": "ImageObject",
"height": 1,
"url": "https://cathibosco.com/wp-content/uploads/2019/01/cathibosco-design-logo-ux-design-leader.svg",
"width": 1
},
"name": "Design + Business + Technology = UX Awesome!"
}
} For Google Search, I can see there is an error with the publisher logo image: the SVG format is not allowed. Now, Slack and other social providers are a different… story. It appears Slack only supports Twitter and Facebook meta: https://api.slack.com/docs/message-link-unfurling#classic_unfurling These would normally be added by Jetpack or Yoast, but in the AMP Story template ( One option would be to manually create the Twitter and Facebook meta ourselves, but this would reinvent the wheel. We should rather rely on Jetpack or Yoast to do this. Probably what we should do here is introduce a new While doing this, we can remove hard-coded amp-wp/includes/templates/single-amp_story.php Lines 15 to 24 in d2971f2
And we can instead hook into this Aside: The |
Sounds good to me! |
Once this is closed, PRs should be opened to Jetpack and Yoast. For example: diff --git a/class.jetpack.php b/class.jetpack.php
index 346b85c6e..d85a99a77 100644
--- a/class.jetpack.php
+++ b/class.jetpack.php
@@ -657,6 +657,7 @@ class Jetpack {
* They check for external files or plugins, so they need to run as late as possible.
*/
add_action( 'wp_head', array( $this, 'check_open_graph' ), 1 );
+ add_action( 'amp_story_head', array( $this, 'check_open_graph' ),1 );
add_action( 'plugins_loaded', array( $this, 'check_twitter_tags' ), 999 );
add_action( 'plugins_loaded', array( $this, 'check_rest_api_compat' ), 1000 );
diff --git a/functions.opengraph.php b/functions.opengraph.php
index cc60770f4..75107ee2a 100644
--- a/functions.opengraph.php
+++ b/functions.opengraph.php
@@ -12,6 +12,7 @@
*/
add_action( 'wp_head', 'jetpack_og_tags' );
+add_action( 'amp_story_head', 'jetpack_og_tags' );
/**
* Outputs Open Graph tags generated by Jetpack. |
Opened Jetpack PR to add support for this: Automattic/jetpack#13416 |
And support for Yoast has been drafted via Yoast/wordpress-seo#13446 |
I am optimizing my Story for Search & for Social using the Yoast plugin
When I publish a Story, it IS being crawled and being added to Search results when I optimize with the Yoast plugin. ✅
However, when I add my story to Slack or Social (Social/Share), it is not fetching the image or description. We think this is a bug. 😐
The text was updated successfully, but these errors were encountered: