feat(srcset): Add env for srcset

This commit is contained in:
Timothy Stewart 2021-08-14 16:47:16 -05:00
parent 1888386c6c
commit b06bb9443f
3 changed files with 11 additions and 6 deletions

View File

@ -19,8 +19,9 @@ services:
- META_DESCRIPTION=Techno Tim Link page
- META_AUTHOR=Techno Tim
- THEME=Dark
- FAVICON_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_400x400.jpg
- AVATAR_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_400x400.jpg
- FAVICON_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_200x200.jpg
- AVATAR_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_200x200.jpg
- AVATAR_2X_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_400x400.jpg
- AVATAR_ALT=Techno Tim Profile Pic
- NAME=TechnoTim
- BIO=Hey! Just a place where you can connect with me!
@ -70,8 +71,9 @@ docker run -d \
-e META_DESCRIPTION='Techno Tim Link page' \
-e META_AUTHOR='Techno Tim' \
-e THEME='Dark' \
-e FAVICON_URL='https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_400x400.jpg' \
-e AVATAR_URL='https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_400x400.jpg' \
-e FAVICON_URL='https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_200x200.jpg' \
-e AVATAR_URL='https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_200x200.jpg' \
-e AVATAR_2X_URL='https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_400x400.jpg' \
-e AVATAR_ALT='Techno Tim Profile Pic' \
-e NAME='TechnoTim' \
-e BIO='Hey! Just a place where you can connect with me!' \

View File

@ -11,8 +11,9 @@ services:
- META_DESCRIPTION=Techno Tim Link page
- META_AUTHOR=Techno Tim
- THEME=Dark
- FAVICON_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_400x400.jpg
- AVATAR_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_400x400.jpg
- FAVICON_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_200x200.jpg
- AVATAR_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_200x200.jpg
- AVATAR_2X_URL=https://pbs.twimg.com/profile_images/1286144221217316864/qIAsKOpB_400x400.jpg
- AVATAR_ALT=Techno Tim Profile Pic
- NAME=TechnoTim
- BIO=Hey! Just a place where you can connect with me!

View File

@ -6,6 +6,7 @@ var env = {
FAVICON_URL: '$FAVICON_URL',
AVATAR_URL: '$AVATAR_URL',
AVATAR_ALT: '$AVATAR_ALT',
AVATAR_2X_URL : '$AVATAR_2X_URL',
NAME:'$NAME',
BIO: '$BIO',
GITHUB: '$GITHUB',
@ -77,6 +78,7 @@ var avatarEl = document.getElementById('avatar');
if (env.AVATAR_URL) {
avatarEl.src = env.AVATAR_URL;
avatarEl.alt = env.AVATAR_ALT;
avatarEl.srcset = env.AVATAR_2X_URL;
} else {
avatarEl.remove()
}