docs/data/product-examples
Grace Park 8ba413cabc
React Cleanup: Documentation (#20517)
* initial documentation changes

* editing layouts terminology

* update to match other files

* move javascripts to components/lib

* fix: dockerfile

* update based on Mikes updates to the javascripts directory

* update components/README.md

Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com>
2021-07-27 09:07:18 -07:00
..
actions Add Code security landing and guides pages (#19650) 2021-06-10 20:14:56 +00:00
code-security ran script/content-migrations/use-short-versions.js 2021-06-24 10:21:07 -04:00
codespaces Add Code security landing and guides pages (#19650) 2021-06-10 20:14:56 +00:00
discussions Add Code security landing and guides pages (#19650) 2021-06-10 20:14:56 +00:00
sponsors Add Code security landing and guides pages (#19650) 2021-06-10 20:14:56 +00:00
README.md React Cleanup: Documentation (#20517) 2021-07-27 09:07:18 -07:00

README.md

Product landing examples

Pages that use the product-landing layout may optionally include an Examples section. Currently, we support three types of examples:

  1. Code examples See https://docs.github.com/en/actions#code-examples.

  2. Community examples See https://docs.github.com/en/discussions#community-examples.

  3. User examples See https://docs.github.com/en/sponsors#community-examples.

How it works

Example data for each product is defined in data/product-landing-examples, in a subdirectory named for the product and a YML file named for the example type (e.g., data/product-examples/sponsors/user-examples.yml or data/product-examples/actions/code-examples.yml). We currently only support one type of example per product.

Versioning

At the moment, versioning is only supported in code examples. If an example block should be available in all versions, you don't need to do anything special. But if an example block should only be available in some versions, you can add a versions prop like this:

- title: Dependabot version update PR
  description: Example pull request generated by the Dependabot version updates configuration in the Super linter repository.
  href: /github/super-linter/pull/1398
  languages:
  tags:
    - Dependabot
    - Version updates
    - Pull requests
  versions:
    fpt: '*'

where the syntax for versions is the same as the frontmatter versions property and can support semver notation.

Rendering

The product example data is added to the context object in middleware/contextualizers/product-examples.js.

The data is then rendered by components/landing.

Schema enforcement

TODO