Don't iterate over articles twice

This commit is contained in:
Tanner Collin 2022-04-22 15:29:38 -06:00
parent 9e84a9ec8b
commit d3735aa826

View File

@ -98,7 +98,7 @@ def populate_files_and_articles(article_generator):
base_path = Path(article_generator.path) base_path = Path(article_generator.path)
if not ARTICLES: if not ARTICLES:
articles = chain(base_path.glob('**/*.md'), base_path.glob('**/*.md')) articles = base_path.glob('**/*.md')
for article in articles: for article in articles:
full_path, filename_w_ext = os.path.split(article) full_path, filename_w_ext = os.path.split(article)
filename, ext = os.path.splitext(filename_w_ext) filename, ext = os.path.splitext(filename_w_ext)