This commit is contained in:
2023-01-22 10:42:55 -08:00
parent 4455e820a7
commit e3c5b95577
2 changed files with 8 additions and 4 deletions

View File

@@ -16,9 +16,12 @@
<body> <body>
<header> <header>
<h1>Aaron Gutierrez</h1> <h1>Aaron Gutierrez</h1>
<img id="aaron" alt="Aaron Gutierrez" src="img/aaron.jpg" <picture>
<source type="image/avif" srcset="img/aaron.avif, img/aaron@2x.avif 2x,img/aaron@3x.avif 3x">
<img id="aaron" alt="Aaron Gutierrez" src="img/aaron.jpg"
width="128px" height="128px" width="128px" height="128px"
srcset="img/aaron.jpg, img/aaron@2x.jpg 2x,img/aaron@3x.jpg 3x"> srcset="img/aaron.jpg, img/aaron@2x.jpg 2x,img/aaron@3x.jpg 3x">
</picture>
<p> <p>
Engineering Manager @ <a href="https://asana.com">Asana</a><br> Engineering Manager @ <a href="https://asana.com">Asana</a><br>
Carnegie Mellon University, SCS 2017 Carnegie Mellon University, SCS 2017

7
pub.py
View File

@@ -21,6 +21,7 @@ bench_view_ftm = """<a href="/img/bench/{0:03d}.1560.jpg"><picture><source type=
TYPE_MAP = { TYPE_MAP = {
'asc': 'text/plain', 'asc': 'text/plain',
'avif': 'image/avif',
'css': 'text/css', 'css': 'text/css',
'gif': 'image/gif', 'gif': 'image/gif',
'html': 'text/html; charset=utf8', 'html': 'text/html; charset=utf8',
@@ -52,7 +53,7 @@ def upload_file(filename, overwrite=True):
s3.upload_file(filename, BUCKET, filename, ExtraArgs={ s3.upload_file(filename, BUCKET, filename, ExtraArgs={
'ACL': 'public-read', 'ACL': 'public-read',
'ContentType': TYPE_MAP[ext], 'ContentType': TYPE_MAP[ext],
'CacheControl': 'public, max-age={}'.format(31536000 if ext in ['gif', 'jpg', 'png', 'webp'] else 86400) 'CacheControl': 'public, max-age={}'.format(31536000 if ext in ['avif', 'gif', 'jpg', 'png', 'webp'] else 86400)
}) })
if (ext == 'html'): if (ext == 'html'):
@@ -60,7 +61,7 @@ def upload_file(filename, overwrite=True):
s3.upload_file(filename, BUCKET, filename[:-5], ExtraArgs={ s3.upload_file(filename, BUCKET, filename[:-5], ExtraArgs={
'ACL': 'public-read', 'ACL': 'public-read',
'ContentType': TYPE_MAP[ext], 'ContentType': TYPE_MAP[ext],
'CacheControl': 'public, max-age={}'.format(31536000 if ext in ['gif', 'jpg', 'png', 'webp'] else 86400) 'CacheControl': 'public, max-age={}'.format(31536000 if ext in ['avif', 'gif', 'jpg', 'png', 'webp'] else 86400)
}) })
print('\tDone.') print('\tDone.')
@@ -162,7 +163,7 @@ def upload_bench():
upload_file(key, overwrite=False) upload_file(key, overwrite=False)
def upload_img(): def upload_img():
files = filter_filenames(os.listdir('img'), ['jpg', 'webp']) files = filter_filenames(os.listdir('img'), ['avif', 'jpg', 'webp'])
for f in files: for f in files:
upload_file('img/{}'.format(f)) upload_file('img/{}'.format(f))