diff --git a/docs/_static/js/version_table.js b/docs/_static/js/version_table.js index d4f84ebdb664..49f90bb454b6 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); });