feat: Auto add https to links

This commit is contained in:
Nathan Woodburn 2024-02-25 12:39:49 +11:00
parent 2b38a128a8
commit 63c8d9923e
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -191,6 +191,14 @@ def site_post():
# Remove empty socials and addresses
socials = [i for i in socials if i['url'] != '']
# Make sure links all start with http or https
for i in socials:
# Set link to lowercase
i['url'] = i['url'].lower()
if not i['url'].startswith('http'):
i['url'] = 'https://' + i['url']
data['socials'] = socials
address = [i for i in address if i['address'] != '']
data['address'] = address