feat: Auto add https to links
This commit is contained in:
parent
2b38a128a8
commit
63c8d9923e
8
main.py
8
main.py
@ -191,6 +191,14 @@ def site_post():
|
|||||||
|
|
||||||
# Remove empty socials and addresses
|
# Remove empty socials and addresses
|
||||||
socials = [i for i in socials if i['url'] != '']
|
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
|
data['socials'] = socials
|
||||||
address = [i for i in address if i['address'] != '']
|
address = [i for i in address if i['address'] != '']
|
||||||
data['address'] = address
|
data['address'] = address
|
||||||
|
Loading…
Reference in New Issue
Block a user