Don't locate css file on server

This commit is contained in:
2025-12-04 19:49:19 +00:00
parent e9e3cb30a4
commit fbec869257

View File

@@ -48,16 +48,6 @@ def fromnow(ts):
build_folder = './build' build_folder = './build'
css_file = None
try:
css_dir = os.path.join(build_folder, 'static', 'css')
for f in os.listdir(css_dir):
if f.endswith('.css'):
css_file = f
break
except FileNotFoundError:
logging.warning('CSS file not found. Run webclient build.')
flask_app = Flask(__name__, template_folder=build_folder, static_folder=build_folder, static_url_path='') flask_app = Flask(__name__, template_folder=build_folder, static_folder=build_folder, static_url_path='')
flask_app.jinja_env.filters['fromnow'] = fromnow flask_app.jinja_env.filters['fromnow'] = fromnow
cors = CORS(flask_app) cors = CORS(flask_app)
@@ -186,7 +176,6 @@ def index():
url='news.t0.vc', url='news.t0.vc',
description='Hacker News, Reddit, Lobsters, and Tildes articles rendered in reader mode', description='Hacker News, Reddit, Lobsters, and Tildes articles rendered in reader mode',
robots='index', robots='index',
css_file=css_file,
stories=stories, stories=stories,
) )
@@ -219,7 +208,6 @@ def static_story(sid):
robots='noindex', robots='noindex',
story=story, story=story,
show_comments=request.path.endswith('/c'), show_comments=request.path.endswith('/c'),
css_file=css_file,
) )
http_server = WSGIServer(('', 33842), flask_app) http_server = WSGIServer(('', 33842), flask_app)