mirror of
https://github.com/TrentSPalmer/hugo_themes_report.git
synced 2025-04-10 08:32:47 -07:00
handle Blackstareye/stargazer-layout has invalid empty value for hugoVersion in theme.toml
This commit is contained in:
parent
a43039a9da
commit
1aabfdbcce
@ -539,6 +539,12 @@ def parse_themes_toml_for_each_hugo_themes():
|
|||||||
theme = session.query(Hugothemes).filter_by(name=hugo_theme).one()
|
theme = session.query(Hugothemes).filter_by(name=hugo_theme).one()
|
||||||
if theme.themes_toml_content is not None:
|
if theme.themes_toml_content is not None:
|
||||||
content = b64decode(theme.themes_toml_content).decode("utf-8")
|
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
|
# put quotes around any unquoted double-dotted version numbers
|
||||||
# (and add a newline afterwards)
|
# (and add a newline afterwards)
|
||||||
# because python toml libraries will error out on those
|
# because python toml libraries will error out on those
|
||||||
|
Loading…
x
Reference in New Issue
Block a user