@@ -219,6 +219,39 @@ def generate_static_pages():
219219
220220 if not [key["module_name"] for key in modules.run_ptr if key["module_name"] == "versions"]:
221221 util.buildhelpers.remove_element_from_sub_menu(resources_config.module_name, "Version History")
222+
223+ # Below code used to get a list of all updates children
224+ updates_dict_list = {}
225+ updates_name = []
226+ updates_path = []
227+ for static_page in os.listdir(static_pages_dir):
228+ with open(os.path.join(static_pages_dir, static_page), "r", encoding="utf8") as md:
229+ content = md.read()
230+ if static_page.startswith("updates-"):
231+ temp_string = static_page.replace(".md", "")
232+ temp_string = temp_string.split("-")
233+ temp_string = temp_string[1].capitalize() + " " + temp_string[2]
234+ updates_name.append(temp_string)
235+ temp_string = static_page.replace(".md", "")
236+ updates_path.append("/resources/updates/" + temp_string + "/")
237+ updates_name.sort(key=lambda date: datetime.strptime(date, "%B %Y"), reverse=True)
238+ updates_path.sort(key=lambda date: datetime.strptime(date, "/resources/updates/updates-%B-%Y/"), reverse=True)
239+ updates_dict_list["updates_name"] = updates_name
240+ updates_dict_list["updates_path"] = updates_path
241+
242+ # Below code used to add the updates children to the resources sidebar
243+ updates_index = 0
244+ temp_dict = {}
245+ for i in range(len(site_config.resource_nav["children"])):
246+ if site_config.resource_nav["children"][i]["name"] == "Updates":
247+ updates_index = i
248+
249+ for i in range(len(updates_dict_list["updates_name"])):
250+ temp_dict["name"] = updates_dict_list["updates_name"][i]
251+ temp_dict["path"] = updates_dict_list["updates_path"][i]
252+ temp_dict["children"] = []
253+ site_config.resource_nav["children"][updates_index]["children"].append(temp_dict.copy())
254+ temp_dict = {}
222255
223256 for static_page in os.listdir(static_pages_dir):
224257 with open(os.path.join(static_pages_dir, static_page), "r", encoding="utf8") as md:
0 commit comments