Skip to content

Commit

Permalink
Merge branch 'docs/add_release_notes_for_versions' into 'master'
Browse files Browse the repository at this point in the history
docs: add release notes to versions

See merge request espressif/esp-idf!24944
  • Loading branch information
Lindazhxy committed Aug 8, 2023
2 parents 31d87a0 + ce1b125 commit b59c1e2
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions docs/_static/js/version_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

0 comments on commit b59c1e2

Please sign in to comment.