From 1aabfdbccecbad4e962b5ff2e3052470e4a411a7 Mon Sep 17 00:00:00 2001 From: Trent Palmer Date: Mon, 3 Mar 2025 01:42:35 -0800 Subject: [PATCH] handle Blackstareye/stargazer-layout has invalid empty value for hugoVersion in theme.toml --- rank_hugo_themes.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rank_hugo_themes.py b/rank_hugo_themes.py index 6cd20fa..931d29e 100755 --- a/rank_hugo_themes.py +++ b/rank_hugo_themes.py @@ -539,6 +539,12 @@ def parse_themes_toml_for_each_hugo_themes(): theme = session.query(Hugothemes).filter_by(name=hugo_theme).one() if theme.themes_toml_content is not None: content = b64decode(theme.themes_toml_content).decode("utf-8") + if theme.name == "Blackstareye/stargazer-layout": + my_content = "" + for line in content.splitlines(): + if "hugoVersion" not in line: + my_content += line + "\n" + content = my_content # put quotes around any unquoted double-dotted version numbers # (and add a newline afterwards) # because python toml libraries will error out on those