import datetime import common def html(entries): featured_entries = ["grey"] min_recent_entries = 3 max_recent_entries = 20 max_age_days = 1461 earliest_recent_entries = datetime.datetime.now( datetime.timezone.utc ) - datetime.timedelta(days=max_age_days) displayed_entries = [ entry for entry in list(reversed(entries)) if entry in featured_entries or list(reversed(entries)).index(entry) < min_recent_entries or ( list(reversed(entries)).index(entry) < max_recent_entries and ( common.entries[entry]["date"] >= earliest_recent_entries or ( "modified" in common.entries[entry] and common.entries[entry]["modified"] >= earliest_recent_entries ) ) ) ] list_of_entries = ( "
    " + "".join( ("
  1. " + common.link_to_entry(entry) + "
  2. ") for entry in displayed_entries ) + "
" ) return common.print_html( f""" {common.head} {common.title('')}

{common.title('')}


Hi! I'm Grey. This is a collection of stuff I've written over the years.


""" )