[util] Put required hugo version into tool_requirements.py

The version number was inside the `build_docs.py` script before, which
makes it hard to use in other areas, such as the documentation.

Signed-off-by: Philipp Wagner <phw@lowrisc.org>
diff --git a/tool_requirements.py b/tool_requirements.py
index 55fbe96..5d7e49d 100644
--- a/tool_requirements.py
+++ b/tool_requirements.py
@@ -8,4 +8,5 @@
     'verilator': '4.040',
     'edalize': '0.2.0',
     'verible': '0.0-520-g650c6cc',
+    'hugo_extended': '0.71.0',
 }
diff --git a/util/build_docs.py b/util/build_docs.py
index d543fac..f3c0d3a 100755
--- a/util/build_docs.py
+++ b/util/build_docs.py
@@ -22,6 +22,7 @@
 
 import hjson
 
+import check_tool_requirements
 import dashboard.gen_dashboard_entry as gen_dashboard_entry
 import difgen.gen_dif_listing as gen_dif_listing
 import reggen.gen_cfg_html as gen_cfg_html
@@ -36,7 +37,12 @@
 """
 
 # Version of hugo extended to be used to build the docs
-HUGO_EXTENDED_VERSION = "0.71.0"
+try:
+    tool_requirements = check_tool_requirements.read_tool_requirements()
+    HUGO_EXTENDED_VERSION = tool_requirements['hugo_extended']
+except Exception as e:
+    print("Unable to get required hugo version: %s" % str(e), file=sys.stderr)
+    sys.exit(1)
 
 # Configurations
 # TODO: Move to config.yaml