tell me you're a js dev without telling me you're a js dev
Some checks failed
/ deploy (push) Failing after 19s

This commit is contained in:
Minecon724 2024-05-12 18:01:13 +02:00
parent 056e040433
commit b0bd91d089
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8

View file

@ -1,7 +1,7 @@
from ftplib import FTP
import requests
import minify_html
from os import listdir, getenv
from os import listdir, getenv, chdir
from io import BytesIO
# init ftp
@ -10,7 +10,9 @@ print(getenv('FTP_SERVER'))
ftp = FTP(getenv('FTP_SERVER'))
ftp.login(getenv('FTP_USER'), getenv('FTP_PASSWORD'))
for f in [i for i in listdir('html') if i.endswith('.html')]:
chdir('html')
for f in [i for i in listdir() if i.endswith('.html')]:
# 1. Minify the index.html file using minify-html
minified_content = minify_html.minify(open(f, 'r').read(), minify_css=True, minify_css_level_3=True, do_not_minify_doctype=True)