diff --git a/docs/guides/assembly.xml b/docs/guides/assembly.xml new file mode 100644 index 0000000000..c9792d64b1 --- /dev/null +++ b/docs/guides/assembly.xml @@ -0,0 +1,16 @@ + + asciidoc + + zip + + + + ${project.build.directory} + / + + generated-guides/** + + + + diff --git a/docs/guides/pom.xml b/docs/guides/pom.xml index 21a2ee7c95..3260432174 100644 --- a/docs/guides/pom.xml +++ b/docs/guides/pom.xml @@ -28,12 +28,13 @@ Keycloak Guides keycloak-guides Keycloak Guides + pom org.keycloak keycloak-guides-maven-plugin - 17.0.0-SNAPSHOT + ${project.version} @@ -42,6 +43,7 @@ org.keycloak keycloak-guides-maven-plugin + ${project.version} generate-asciidoc @@ -82,6 +84,23 @@ + + maven-assembly-plugin + + + assembly.xml + + + + + create-archive + package + + single + + + + diff --git a/docs/guides/src/main/server/all-config.adoc b/docs/guides/src/main/server/all-config.adoc index 3420f9fa58..758cf31013 100644 --- a/docs/guides/src/main/server/all-config.adoc +++ b/docs/guides/src/main/server/all-config.adoc @@ -10,6 +10,7 @@ summary="All the configuration you will ever need and want"> == ${category.heading} |=== |Key|CLI|ENV|Description|Default|Values + <#list categoryOptions as option> |${option.key} |${option.keyCli} diff --git a/docs/guides/src/main/server/db.adoc b/docs/guides/src/main/server/db.adoc index ccc60bfa03..5f4aba3d28 100644 --- a/docs/guides/src/main/server/db.adoc +++ b/docs/guides/src/main/server/db.adoc @@ -5,6 +5,7 @@ <@tmpl.guide title="Relational database setup" summary="Understand how to configure different relational databases for Keycloak" + priority=10 includedOptions="db db.* hostname"> First step is to decide which database vendor you are going to use. Keycloak has support for a number of different vendors. diff --git a/docs/guides/src/main/server/proxy.adoc b/docs/guides/src/main/server/proxy.adoc index 6e77b3747d..057c63cfe0 100644 --- a/docs/guides/src/main/server/proxy.adoc +++ b/docs/guides/src/main/server/proxy.adoc @@ -5,6 +5,7 @@ <@tmpl.guide title="Configuring Keycloak to run behind a reverse proxy" summary="Understand how to configure Keycloak when using a reverse proxy" +priority=20 includedOptions="proxy proxy.*"> It is pretty common nowadays to use a reverse proxy in distributed environments. If you want to use Keycloak together with such a proxy, you can use different proxy modes depending on the proxy and TLS termination in your specific environment: diff --git a/docs/guides/src/main/templates/guide.adoc b/docs/guides/src/main/templates/guide.adoc index ced8c9e9aa..9c71cba7b1 100644 --- a/docs/guides/src/main/templates/guide.adoc +++ b/docs/guides/src/main/templates/guide.adoc @@ -1,11 +1,13 @@ -<#macro guide title summary includedOptions=""> -:title: ${title} -:summary: ${summary} +<#macro guide title summary priority=999 includedOptions=""> +:guide-id: ${id} +:guide-title: ${title} +:guide-summary: ${summary} +:guide-priority: ${priority} -[[${ctx.getAnchor(title)}]] -= {title} +[[${id}]] += ${title} -{summary} +${summary} <#nested> @@ -14,6 +16,7 @@ |=== |Key|CLI|ENV|Description|Default|Values + <#list ctx.options.getOptions(includedOptions) as option> |${option.key} |${option.keyCli} diff --git a/docs/maven-plugin/src/main/java/org/keycloak/guides/maven/Context.java b/docs/maven-plugin/src/main/java/org/keycloak/guides/maven/Context.java index 9b3b248ca3..a8469447e1 100644 --- a/docs/maven-plugin/src/main/java/org/keycloak/guides/maven/Context.java +++ b/docs/maven-plugin/src/main/java/org/keycloak/guides/maven/Context.java @@ -14,10 +14,6 @@ public class Context { this.serverGuides = new File(srcDir, "server").list((dir, f) -> f.endsWith(".adoc") && !f.equals("index.adoc")); } - public String getAnchor(String title) { - return title.toLowerCase().replace(' ', '_'); - } - public Options getOptions() { return options; } diff --git a/docs/maven-plugin/src/main/java/org/keycloak/guides/maven/FreeMarker.java b/docs/maven-plugin/src/main/java/org/keycloak/guides/maven/FreeMarker.java index 25e127a298..2f7901e807 100644 --- a/docs/maven-plugin/src/main/java/org/keycloak/guides/maven/FreeMarker.java +++ b/docs/maven-plugin/src/main/java/org/keycloak/guides/maven/FreeMarker.java @@ -9,6 +9,7 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.Writer; +import java.util.HashMap; import java.util.Map; public class FreeMarker { @@ -37,8 +38,11 @@ public class FreeMarker { parent.mkdir(); } + HashMap attrs = new HashMap<>(attributes); + attrs.put("id", template.split("/")[1].replace(".adoc", "")); + Writer w = new FileWriter(out); - t.process(attributes, w); + t.process(attrs, w); } }