Merge branch 'docs/add_release_notes_for_versions' into 'master'

docs: add release notes to versions

See merge request espressif/esp-idf!24944
This commit is contained in:
Zhang Xiao Yan 2023-08-08 14:49:01 +08:00
commit b59c1e2e9d

View File

@ -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 = "<tr>"
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 += "<td><a href=\"" + url + "\">" + v.name + "</td>";
if (releaseNotesUrl){
old_ver_table_row += "<td><a href=\"" + url + "\">" + v.name + "&nbsp;-&nbsp;<a href=\"" + releaseNotesUrl + "\">Release Notes</a></td>";
} else {
old_ver_table_row += "<td><a href=\"" + url + "\">" + v.name + "</td>";
}
row_items++;
if (row_items === ITEMS_PER_ROW) {
old_ver_table_row += "</tr>"
old_ver_table += old_ver_table_row
old_ver_table_row += "</tr>";
old_ver_table += old_ver_table_row;
/* Prepare a new row */
old_ver_table_row = "<tr>"
row_items = 0
}
}
}
old_ver_table_row += "</tr>";
old_ver_table += old_ver_table_row;
$( "#version_table" ).append(old_ver_table);
});