Skip to content

Commit

Permalink
texting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
holysoles committed Apr 28, 2024
1 parent 34e7cba commit 0292e70
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ def get_posts():
yaml_files.sort(reverse=True)
timeline = {}
for yaml_file in yaml_files:
link_to_post = "/post?date" + yaml_file
link_to_post = "/post?date=" + yaml_file
# collect datetime info
datetime_list = re.split('_|\.', yaml_file)
file_year = datetime_list[0]
file_month = datetime_list[1]
file_day = datetime_list[2]
if file_year in timeline:
if file_month in timeline[file_year]:
timeline[file_year][file_month][file_day] = yaml_file
timeline[file_year][file_month][file_day] = link_to_post
else:
timeline[file_year][file_month] = {file_day: yaml_file}
timeline[file_year][file_month] = {file_day: link_to_post}
else:
timeline[file_year] = {file_month: {file_day: yaml_file}}
timeline[file_year] = {file_month: {file_day: link_to_post}}
return yaml_files, timeline

def load_post_data(yaml_files):
Expand All @@ -53,8 +53,7 @@ def load_post_data(yaml_files):
with open(join(code_snippet_path, body['code']), 'r') as file:
code_snippet = file.read()
body['code'] = code_snippet

post_array.append(post_data)
post_array.append(post_data)
return post_array

@app.route("/", methods=['GET'])
Expand Down

0 comments on commit 0292e70

Please sign in to comment.