1
0
mirror of synced 2026-01-05 12:07:35 -05:00
Files
docs/data/product-examples/README.md
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

46 lines
1.7 KiB
Markdown

# 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](content/README.md) 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