From ce1b12520c6061d0a28e1f0552bde11cc69021d6 Mon Sep 17 00:00:00 2001 From: Linda Date: Thu, 20 Jul 2023 16:06:36 +0800 Subject: [PATCH] docs: add release notes to versions --- docs/_static/js/version_table.js | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/docs/_static/js/version_table.js b/docs/_static/js/version_table.js index d4f84ebdb66..49f90bb454b 100644 --- a/docs/_static/js/version_table.js +++ b/docs/_static/js/version_table.js @@ -38,29 +38,44 @@ $(document).ready(function() { return result + "/"; }; + function getReleaseNotesUrl(v){ + if (v.name.indexOf("release") !== 0) { + let releaseNotesUrl = "https://github.com/espressif/esp-idf/releases/tag/" + v.name; + return releaseNotesUrl; + } + } + old_ver_table = ""; old_ver_table_row = "" let row_items = 0; - const ITEMS_PER_ROW = 4; + const ITEMS_PER_ROW = 3; for (let i = 0; i < versions.length; i++) { let v = versions[i]; let url = getVersionUrl(v); + let releaseNotesUrl = getReleaseNotesUrl(v); if (v.old) { - old_ver_table_row += "" + v.name + ""; + if (releaseNotesUrl){ + old_ver_table_row += "" + v.name + " - Release Notes"; + } else { + old_ver_table_row += "" + v.name + ""; + } + row_items++; + if (row_items === ITEMS_PER_ROW) { - old_ver_table_row += "" - old_ver_table += old_ver_table_row + old_ver_table_row += ""; + old_ver_table += old_ver_table_row; /* Prepare a new row */ old_ver_table_row = "" row_items = 0 } } - } + old_ver_table_row += ""; + old_ver_table += old_ver_table_row; $( "#version_table" ).append(old_ver_table); });