diff --git a/docs/simplesamlphp-advancedfeatures.md b/docs/simplesamlphp-advancedfeatures.md
index 69ddf67c4c87e581eab6935cf4c81609727e674c..d411fcedc464b7e843666a822dd1a5313bca06b4 100644
--- a/docs/simplesamlphp-advancedfeatures.md
+++ b/docs/simplesamlphp-advancedfeatures.md
@@ -1,15 +1,7 @@
 SimpleSAMLphp Advanced Features
 ===============================
 
-<!-- 
-	This file is written in Markdown syntax. 
-	For more information about how to use the Markdown syntax, read here:
-	http://daringfireball.net/projects/markdown/syntax
--->
-
-
-
-<!-- {{TOC}} -->
+[TOC]
 
 SimpleSAMLphp documentation
 ---------------------------
@@ -60,7 +52,7 @@ Automatic update of SAML 2.0 Metadata XML from HTTPS
 ----------------------------------------------------
 
 The `metarefresh` module is the preferred method for doing this.
-Please see the [metarefresh documentation](https://github.com/simplesamlphp/simplesamlphp-module-metarefresh/blob/master/docs/simplesamlphp-automated_metadata.md).
+Please see the [metarefresh documentation](/docs/contrib_modules/metarefresh/simplesamlphp-automated_metadata).
 
 
 
diff --git a/docs/simplesamlphp-googleapps.md b/docs/simplesamlphp-googleapps.md
index a72d20292c02341dfeb828c55947713117082913..281396a05cb31cdb79bc5bcaf5374b26f0559c25 100644
--- a/docs/simplesamlphp-googleapps.md
+++ b/docs/simplesamlphp-googleapps.md
@@ -1,15 +1,7 @@
 Setting up a SimpleSAMLphp SAML 2.0 IdP to use with Google Workspace (G Suite / Google Apps) for Education
 ============================================
 
-<!-- 
-	This file is written in Markdown syntax. 
-	For more information about how to use the Markdown syntax, read here:
-	http://daringfireball.net/projects/markdown/syntax
--->
-
-
-
-<!-- {{TOC}} -->
+[TOC]
 
 SimpleSAMLphp news and documentation
 ------------------------------------
@@ -76,7 +68,7 @@ The next step is to configure the way users authenticate on your IdP. Various mo
 `exampleauth:Static`
 : Automatically log in as a user with a set of attributes.
 
-[`ldap:LDAP`](./ldap:ldap)
+[`ldap:LDAP`](/docs/contrib_modules/ldap/ldap.html)
 : Authenticates an user to a LDAP server.
 
 For more authentication modules, see [SimpleSAMLphp Identity Provider QuickStart](simplesamlphp-idp).
diff --git a/docs/simplesamlphp-idp-more.md b/docs/simplesamlphp-idp-more.md
index bb5ead1ac8bde0e79d9bdaa90299862db60d6163..6f3e53973f255ab1e9e72f0de5d865210edb237a 100644
--- a/docs/simplesamlphp-idp-more.md
+++ b/docs/simplesamlphp-idp-more.md
@@ -1,14 +1,7 @@
 SimpleSAMLphp Identity Provider Advanced Topics
 ===============================================
 
-<!-- 
-	This file is written in Markdown syntax. 
-	For more information about how to use the Markdown syntax, read here:
-	http://daringfireball.net/projects/markdown/syntax
--->
-
-
-<!-- {{TOC}} -->
+[TOC]
 
 AJAX iFrame Single Log-Out
 --------------------------
@@ -21,7 +14,7 @@ If you have read about the AJAX iFrame Single Log-Out approach at Andreas' blog
 Attribute Release Consent
 -------------------------
 
-The attribute release consent is documented in a [separate document](./consent:consent).
+The attribute release consent is documented in a [separate document](/docs/contrib_modules/consent/consent.html).
 
 
 Support for bookmarking the login page
diff --git a/docs/simplesamlphp-idp.md b/docs/simplesamlphp-idp.md
index 43f96752a04bc9fd349078370ffd24da8a4f0ea8..79b0f0da86969e3bc89b97d1e0333356e2f90f25 100644
--- a/docs/simplesamlphp-idp.md
+++ b/docs/simplesamlphp-idp.md
@@ -1,14 +1,7 @@
 SimpleSAMLphp Identity Provider QuickStart
 ===========================================
 
-<!-- 
-	This file is written in Markdown syntax. 
-	For more information about how to use the Markdown syntax, read here:
-	http://daringfireball.net/projects/markdown/syntax
--->
-
-
-<!-- {{TOC}} -->
+[TOC]
 
 This guide will describe how to configure SimpleSAMLphp as an identity provider (IdP). You should previously have installed SimpleSAMLphp as described in [the SimpleSAMLphp installation instructions](simplesamlphp-install)
 
@@ -26,13 +19,13 @@ Authentication module
 
 The next step is to configure the way users authenticate on your IdP. Various modules in the `modules/` directory provides methods for authenticating your users. This is an overview of those that are included in the SimpleSAMLphp distribution:
 
-[`authcrypt:Hash`](./authcrypt:authcrypt)
+[`authcrypt:Hash`](/docs/contrib_modules/authcrypt/authcrypt.html)
 : Username & password authentication with hashed passwords.
 
-[`authcrypt:Htpasswd`](./authcrypt:authcrypt)
+[`authcrypt:Htpasswd`](/docs/contrib_modules/authcrypt/authcrypt.html)
 : Username & password authentication against .htpasswd file.
 
-[`authX509:authX509userCert`](./authX509:authX509)
+[`authX509:authX509userCert`](/docs/contrib_modules/authX509/authX509.html)
 : Authenticate against a LDAP database with a SSL client certificate.
 
 `exampleauth:UserPass`
@@ -41,38 +34,29 @@ The next step is to configure the way users authenticate on your IdP. Various mo
 `exampleauth:Static`
 : Automatically log in as a user with a set of attributes.
 
-[`ldap:LDAP`](./ldap:ldap)
+[`ldap:LDAP`](/docs/contrib_modules/ldap/ldap.html)
 : Authenticates an user to a LDAP server.
 
-[`ldap:LDAPMulti`](./ldap:ldap)
+[`ldap:LDAPMulti`](/docs/contrib_modules/ldap/ldap.html)
 : Authenticates an user to one of several LDAP server.
   The user can choose the LDAP server from a dropdown list.
 
-[`sqlauth:SQL`](./sqlauth:sql)
+[`sqlauth:SQL`](/docs/contrib_modules/sqlauth/sql.html)
 : Authenticate an user against a database.
 
-[`radius:Radius`](./radius:radius)
+[`radius:Radius`](/docs/contrib_modules/radius/radius.html)
 : Authenticates an user to a Radius server.
 
-[`InfoCard:ICAuth`](https://github.com/simplesamlphp/simplesamlphp-module-infocard/blob/master/README.md)
-: Authenticate with an InfoCard.
-
 [`multiauth:MultiAuth`](./multiauth:multiauth)
 : Allow the user to select from a list of authentication sources.
 
-`openid:OpenIDConsumer`
-: Authenticate against an OpenID provider.
-
 [`saml:SP`](./saml:sp)
 : Authenticate against a SAML IdP. Can be used for bridging.
 
 `authYubiKey:YubiKey`
-: Authenticate with [an YubiKey](http://www.yubico.com/products/yubikey/).
-
-[`authfacebook:Facebook`](./authfacebook:authfacebook)
-: Authenticate with a Facebook ID.
+: Authenticate with [a YubiKey](https://www.yubico.com/products/yubikey/).
 
-[`authtwitter:Twitter`](./authtwitter:oauthtwitter)
+[`authtwitter:Twitter`](/docs/contrib_modules/authtwitter/oauthtwitter.html)
 : Authenticate with your Twitter account using the Twitter OAuth API.
 
 [`papi:PAPI`](https://github.com/rediris-es/simplesamlphp-module-papi/blob/master/README.md)
diff --git a/docs/simplesamlphp-install.md b/docs/simplesamlphp-install.md
index c4265deeb40ec1e25c19b50e00f5f752caaff9d8..5dbe7e885082c0caad38c6cced8744cc14aff460 100644
--- a/docs/simplesamlphp-install.md
+++ b/docs/simplesamlphp-install.md
@@ -1,16 +1,7 @@
 SimpleSAMLphp Installation and Configuration
 ============================================
 
-<!-- 
-This file is written in Markdown syntax. 
-For more information about how to use the Markdown syntax, read here:
-http://daringfireball.net/projects/markdown/syntax
--->
-
-
-
-<!-- {{TOC}} -->
-
+[TOC]
 
 This document is part of the SimpleSAMLphp documentation suite.
 
@@ -394,7 +385,7 @@ in a separate document.
    + [Remote SP reference](simplesamlphp-reference-sp-remote)
    + [Setting up an IdP for Google Workspace (G Suite / Google Apps)](simplesamlphp-googleapps)
    + [Advanced Topics](simplesamlphp-idp-more)
- - [Automated Metadata Management](https://github.com/simplesamlphp/simplesamlphp-module-metarefresh/blob/master/docs/simplesamlphp-automated_metadata.md)
+ - [Automated Metadata Management](/docs/contrib_modules/metarefresh/simplesamlphp-automated_metadata)
  - [Maintenance and configuration](simplesamlphp-maintenance)
 
 
diff --git a/docs/simplesamlphp-sp.md b/docs/simplesamlphp-sp.md
index c144ce20f8b8235007937be9eb82155bdb940197..138fa272b90a6d90beda79b98bdac3e77a760b33 100644
--- a/docs/simplesamlphp-sp.md
+++ b/docs/simplesamlphp-sp.md
@@ -1,14 +1,7 @@
 SimpleSAMLphp Service Provider QuickStart
 =========================================
 
-<!-- 
-	This file is written in Markdown syntax. 
-	For more information about how to use the Markdown syntax, read here:
-	http://daringfireball.net/projects/markdown/syntax
--->
-
-
-<!-- {{TOC}} -->
+[TOC]
 
 This guide will describe how to configure SimpleSAMLphp as a service provider (SP). You should previously have installed SimpleSAMLphp as described in [the SimpleSAMLphp installation instructions](simplesamlphp-install).
 
@@ -121,7 +114,8 @@ directory.
 
 If you intend to add your SP to a federation, the procedure for managing trust in federations will differ, but the common part is that you would need to provide the *SAML 2.0 metadata of your SP*, and register that with the federation administration.
 You will probably be required too to consume the federation metadata periodically. Read more about
-[automated metadata management](https://github.com/simplesamlphp/simplesamlphp-module-metarefresh/blob/master/docs/simplesamlphp-automated_metadata.md) to learn more about that. 
+[automated metadata management](/docs/contrib_modules/metarefresh/simplesamlphp-automated_metadata)
+to learn more about that.
 
 
 Test the SP