diff --git a/docs/index.html.in b/docs/index.html.in
index 19f3dc6ce393b10c517a5a1c3ca0585764cc5fa0..381071998429b09848e5dc7751db67dc14383c7a 100644
--- a/docs/index.html.in
+++ b/docs/index.html.in
@@ -39,7 +39,7 @@
 
       <LI>
         <P>
-          <B><A HREF="libraries/ghc-@LIBRARY_ghc_VERSION@/index.html">GHC API</A></B>
+          <B><A HREF="libraries/@LIBRARY_ghc_UNIT_ID@/index.html">GHC API</A></B>
         </P>
         <P>
           Documentation for the GHC API.
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs
index d9f85b5efb5e047d4325566ad279c408350b266d..6cd663b91be6fb18344e6a213a20833e9cd14cd8 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -360,7 +360,7 @@ templateRules = do
     , interpolateSetting "ProjectPatchLevel1" ProjectPatchLevel1
     , interpolateSetting "ProjectPatchLevel2" ProjectPatchLevel2
     ]
-  templateRule "docs/index.html" $ packageVersions
+  templateRule "docs/index.html" $ packageUnitIds Stage1
   templateRule "docs/users_guide/ghc_config.py" $ mconcat
     [ projectVersion
     , packageUnitIds Stage1