From 7cf8dacec228738b752c2f350eff28d2534daa9b Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Wed, 28 Apr 2021 13:56:03 -0400 Subject: [PATCH] update README with information about versioning featured links --- data/learning-tracks/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data/learning-tracks/README.md b/data/learning-tracks/README.md index 96d491baf6..d8bd99c5fe 100644 --- a/data/learning-tracks/README.md +++ b/data/learning-tracks/README.md @@ -19,9 +19,11 @@ Learning track data for a product is defined in two places: 2. Additional data for each track is defined in a YAML file named for the **product** in the `data` directory. - For example, in `data/learning-tracks/actions.yml`, each of the items from the list in #1 is represented with additional data such as `title`, `description`, and a list of `guides` links. + For example, in `data/learning-tracks/actions.yml`, each of the items from the content file's `learningTracks` array is represented with additional data such as `title`, `description`, and an array of `guides` links. - One, and only one, learning track in this YAML must be designated as a "featured" learning track via `featured_track: true`, which will set it to appear at the top of the product sublanding page. A test will fail if this property is missing. + One learning track in this YAML **per version** must be designated as a "featured" learning track via `featured_track: true`, which will set it to appear at the top of the product sublanding page. A test will fail if this property is missing. + + The `featured_track` property can be a simple boolean (i.e., `featured_track: true`) or it can be a string that includes versioning statements (e.g., `featured_track: '{% if currentVersion == "free-pro-team@latest" %}true{% else %}false{% endif %}'`). If you use versioning, you'll have multiple `featured_track`s per YML file, but make sure that only one will render in each currently supported version. A test will fail if there are more or less than one featured link for each version. Versioning for learning tracks is processed at page render time. The code lives in [`lib/learning-tracks.js`](lib/learning-tracks.js), which is called by `page.render()`. The processed learning tracks are then rendered by `layouts/product-sublanding.html`.