From 9bc90cd9329be056b5e9bcd0e5f1bb4a0574a752 Mon Sep 17 00:00:00 2001 From: Vanessa Yuen <6842965+vanessayuenn@users.noreply.github.com> Date: Mon, 25 Jan 2021 17:57:32 +0100 Subject: [PATCH] Learning Track navigation banner (#17440) * add middleware to handle `learn` query param * add exception to query-less cache key * add querystring to learning track guides --- data/ui.yml | 3 ++ includes/article.html | 5 ++- includes/learning-track-nav.html | 18 +++++++++ layouts/product-sublanding.html | 10 ++--- lib/get-link-data.js | 45 +++++++++++++++------- lib/page.js | 1 + middleware/index.js | 1 + middleware/learning-track.js | 40 +++++++++++++++++++ middleware/render-page.js | 12 +++++- tests/rendering/learning-tracks.js | 62 ++++++++++++++++++++++++++++++ 10 files changed, 176 insertions(+), 21 deletions(-) create mode 100644 includes/learning-track-nav.html create mode 100644 middleware/learning-track.js create mode 100644 tests/rendering/learning-tracks.js diff --git a/data/ui.yml b/data/ui.yml index 769025e23f27..2b83989f2feb 100644 --- a/data/ui.yml +++ b/data/ui.yml @@ -160,3 +160,6 @@ product_sublanding: tutorial: Tutorial how_to: How-to guide reference: Reference +learning_track_nav: + prevGuide: Previous Guide + nextGuide: Next Guide diff --git a/includes/article.html b/includes/article.html index 52d1d4104af4..bc884154917e 100644 --- a/includes/article.html +++ b/includes/article.html @@ -65,7 +65,10 @@
{{ track.description }}