AVIF
This commit is contained in:
@@ -16,9 +16,12 @@
|
||||
<body>
|
||||
<header>
|
||||
<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"
|
||||
srcset="img/aaron.jpg, img/aaron@2x.jpg 2x,img/aaron@3x.jpg 3x">
|
||||
</picture>
|
||||
<p>
|
||||
Engineering Manager @ <a href="https://asana.com">Asana</a><br>
|
||||
Carnegie Mellon University, SCS 2017
|
||||
|
||||
7
pub.py
7
pub.py
@@ -21,6 +21,7 @@ bench_view_ftm = """<a href="/img/bench/{0:03d}.1560.jpg"><picture><source type=
|
||||
|
||||
TYPE_MAP = {
|
||||
'asc': 'text/plain',
|
||||
'avif': 'image/avif',
|
||||
'css': 'text/css',
|
||||
'gif': 'image/gif',
|
||||
'html': 'text/html; charset=utf8',
|
||||
@@ -52,7 +53,7 @@ def upload_file(filename, overwrite=True):
|
||||
s3.upload_file(filename, BUCKET, filename, ExtraArgs={
|
||||
'ACL': 'public-read',
|
||||
'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'):
|
||||
@@ -60,7 +61,7 @@ def upload_file(filename, overwrite=True):
|
||||
s3.upload_file(filename, BUCKET, filename[:-5], ExtraArgs={
|
||||
'ACL': 'public-read',
|
||||
'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.')
|
||||
@@ -162,7 +163,7 @@ def upload_bench():
|
||||
upload_file(key, overwrite=False)
|
||||
|
||||
def upload_img():
|
||||
files = filter_filenames(os.listdir('img'), ['jpg', 'webp'])
|
||||
files = filter_filenames(os.listdir('img'), ['avif', 'jpg', 'webp'])
|
||||
for f in files:
|
||||
upload_file('img/{}'.format(f))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user