util/generate-hugo-content.py: use dspace field name

Now all elements have DSpace field names so we can use that as the
unique identifier for each element.
This commit is contained in:
Alan Orth 2022-01-06 12:09:24 +02:00
parent 7431ebb6c9
commit 75076124a5

View File

@ -58,10 +58,14 @@ def parseSchema(schema_df):
# use the custom fsc layout instead of the default home layout.
layout = "fsc"
if row["dspace field name"] is not None and row["dspace field name"] != "":
dspace_field_name = row["dspace field name"]
else:
dspace_field_name = False
# Generate a "safe" version of the element name for use in URLs and
# files by combining the cluster and the element name. This could
# change in the future.
element_name_safe = cluster.replace(" ", "-").lower() + "-" + element_name
# files by using the DSpace field name with dots replaced by dashes.
element_name_safe = dspace_field_name.replace(".", "-").lower()
print(f"element name: {element_name_safe}")
@ -109,11 +113,6 @@ def parseSchema(schema_df):
else:
required = False
if row["dspace field name"] is not None and row["dspace field name"] != "":
dspace_field_name = row["dspace field name"]
else:
dspace_field_name = False
# Combine element type and options into a "policy" of sorts and convert
# them to sentence case because they are ALL CAPS in the Excel. We don't
# need to do any checks because these fields should always exist.