Yoast / yoast-components

Accessible React components by Yoast
GNU General Public License v3.0
21 stars 6 forks source link

Fix snippet preview slug #753

Closed jcomack closed 5 years ago

jcomack commented 5 years ago

Summary

This PR can be summarized in the following changelog entry:

Relevant technical choices:

*

Test instructions

This PR can be tested by following these steps:

atimmer commented 5 years ago

Talked to @jcomack about this. I think yoast-components should have some logic for URLs. But only the CMS-agnostic parts. So I propose passing the following to yoast-components from the plugin:

{
  structure: "siteurl.nl/[category]/[postname]",
  data: {
    category: "my-primary-category",
    postname: "my-postname",
  }
}

Then if category or postname change, the new data can be passed. This will also work for other CMSs.

PS. In my example I write [] around placeholder, for ease of implementation this can also be %%. This doesn't really change the API that much. [] is just clearer as an CMS-agnostic example.

abotteram commented 5 years ago

Closing this because we are taking a different approach. See https://github.com/Yoast/wordpress-seo/issues/3514#issuecomment-455998249.