Skip to content

Commit

Permalink
fix: repeat item
Browse files Browse the repository at this point in the history
  • Loading branch information
beiyuouo authored Oct 12, 2024
1 parent b13a083 commit e7c89fc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,15 @@ def generate_readme(data):
with open(readme_path, "r", encoding="utf-8") as f:
readme_content = f.read()
new_content = ""
last_item = ""
for item in total_item:
new_content += (
f'- {get_markdown_url(item["title"], item["url"], date=item["date"], tag=item["tag"], space=True)}\n'
)
new_item = f'- {get_markdown_url(item["title"], item["url"], date=item["date"], tag=item["tag"], space=True)}\n'

if last_item == new_item:
continue

new_content += new_item
last_item = new_item
_count += 1
if _count >= max_item_count:
break
Expand Down

0 comments on commit e7c89fc

Please sign in to comment.