Skip to content

Commit 4ace546

Browse files
author
dalj8690
committed
Updated the RSS freeds script, for scaning muliple extensions
1 parent fc17ed6 commit 4ace546

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

generate_rss.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,21 @@ def item_timestamp(item):
8282
print("Failed to parse existing RSS file.")
8383
exit(1)
8484

85-
# Collect .pdf files
86-
pdf_files = [
85+
# Collect files
86+
docu_files = [
8787
os.path.join(root, file)
8888
for root, _, files in os.walk(docs_folder)
89-
for file in files if file.endswith(".pdf")
89+
for file in files if file.endswith((".pdf", ".md"))
9090
]
9191

9292
changes_made = False
9393

94-
for pdf in pdf_files:
95-
relative_path = os.path.relpath(pdf, start=docs_folder)
94+
for docu in docu_files:
95+
relative_path = os.path.relpath(docu, start=docs_folder)
9696
relative_path = relative_path.replace(os.sep, "/")
9797
link = f"https://github.com/damirlj/modern_cpp_tutorials/blob/main/docs/{relative_path}"
98-
title = os.path.splitext(os.path.basename(pdf))[0].replace("_", " ")
99-
mod_time = get_effective_mod_time(pdf)
98+
title = os.path.splitext(os.path.basename(docu))[0].replace("_", " ")
99+
mod_time = get_effective_mod_time(docu)
100100
pub_date = format_rss_date(mod_time)
101101

102102
if link in existing_items:

0 commit comments

Comments
 (0)