Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nightly guides, including guides from keycloak-client #494

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions guides.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
guides:
- id: migration
title: Migration
- id: getting-started
title: Getting started
- id: server
title: Server
- id: operator
title: Operator
- id: securing-apps
title: Securing applications
- id: high-availability
title: High availability

sources:
- id: keycloak
dir: target/keycloak-guides-$$VERSION$$
github: https://github.com/keycloak/keycloak/tree/main/docs/guides/
- id: keycloak-client
dir: target/keycloak-client-guides-$$VERSION$$
github: https://github.com/keycloak/keycloak-client/tree/main/docs/guides/
- id: keycloak-web
dir: guides
github: https://github.com/keycloak/keycloak-web/tree/main/guides/
6 changes: 3 additions & 3 deletions pages/guides.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ul class="nav navbar-nav">
<#list guides.categories as c>
<li>
<a class="nav-link" href="#${c.id}">${c.label}</a>
<a class="nav-link" href="#${c.id}">${c.title}</a>
</li>
</#list>
</ul>
Expand All @@ -25,9 +25,9 @@
<div class="container">
<#list guides.categories as c>
<div class="row guide-category" id="${c.id}">
<h2>${c.label}</h2>
<h2>${c.title}</h2>
<#list guides.getGuides(c) as g>
<#if g.tileVisible>
<#if g.tileVisible && !g.snapshot>
<div class="col-sm-4">
<div class="card shadow-sm mb-4">
<div class="card-body">
Expand Down
61 changes: 61 additions & 0 deletions pages/nightly/guides.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<#import "/templates/template.ftl" as tmpl>

<@tmpl.page current="guides" title="Guides">

<script src="${links.getResource('js/guides.js')}" type="text/javascript"></script>

<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container">
<ul class="nav navbar-nav">
<#list guides.categories as c>
<li>
<a class="nav-link" href="#${c.id}">${c.title}</a>
</li>
</#list>
</ul>
<div class="float-right">
<form>
<input id="guide-search" class="form-control" type="text" placeholder="Search" aria-label="Search">
</form>
</div>
</div>
</nav>

<div class="jumbotron jumbotron-fluid bg-light kc-bg-triangles pt-4">
<div class="container">
<#list guides.categories as c>
<div class="row guide-category" id="${c.id}">
<h2>${c.title}</h2>
<#list guides.getGuides(c) as g>
<#if g.tileVisible && g.snapshot>
<div class="col-sm-4">
<div class="card shadow-sm mb-4">
<div class="card-body">
<h5 class="card-title">
${g.title}
<#if g.community><span class="float-end badge bg-primary fs-xsmall"><i class="fa fa-users"></i> community</span></#if>
<#if g.external><span class="float-end badge bg-primary fs-xsmall"><i class="fa fa-link"></i> external</span></#if>
</h5>
<#if g.summary??>
<span class="card-text">${g.summary}</span>
</#if>
<div>
<#if g.tags??>
<#list g.tags as tag>
<span class="badge bg-light text-muted fs-xsmall mt-3">${tag}</span>
</#list>
</#if>
</div>
<a href="${links.get(g)}" <#if g.external>target="_blank"</#if> class="stretched-link link-dark"></a>
</div>
</div>
</div>
</#if>
</#list>
</div>
</#list>
</div>
</div>
</div>

</@tmpl.page>
50 changes: 47 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<version.github-api>1.300</version.github-api>
<version.freemarker>2.3.31</version.freemarker>
<version.asciidoctorj>2.5.2</version.asciidoctorj>
<version.jackson-core>2.13.2</version.jackson-core>
<version.jackson-databind>2.13.4.2</version.jackson-databind>
<version.jackson-core>2.17.2</version.jackson-core>
<version.commons-io>2.11.0</version.commons-io>
<version.commons-compress>1.26.0</version.commons-compress>

<version.keycloak>25.0.6</version.keycloak>
<version.keycloak.client>26.0.0</version.keycloak.client>

<version.frontend-maven-plugin>1.12.1</version.frontend-maven-plugin>
<version.node>v16.13.1</version.node>
Expand All @@ -33,6 +33,18 @@
<version.dependency-plugin>3.1.2</version.dependency-plugin>
</properties>

<repositories>
<repository>
<id>sonatype-snapshots</id>
<name>Sonatype Snapshots</name>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.kohsuke</groupId>
Expand All @@ -57,7 +69,12 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${version.jackson-databind}</version>
<version>${version.jackson-core}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>${version.jackson-core}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down Expand Up @@ -218,6 +235,33 @@
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-guides</artifactId>
<version>999.0.0-SNAPSHOT</version>
<classifier>asciidoc</classifier>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}</outputDirectory>
</artifactItem>
<!-- <artifactItem>-->
<!-- <groupId>org.keycloak</groupId>-->
<!-- <artifactId>keycloak-client-guides</artifactId>-->
<!-- <version>${version.keycloak.client}</version>-->
<!-- <classifier>asciidoc</classifier>-->
<!-- <type>zip</type>-->
<!-- <overWrite>true</overWrite>-->
<!-- <outputDirectory>${project.build.directory}</outputDirectory>-->
<!-- </artifactItem>-->
<artifactItem>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-client-guides</artifactId>
<version>999.0.0-SNAPSHOT</version>
<classifier>asciidoc</classifier>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/org/keycloak/webbuilder/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.keycloak.webbuilder.utils.AsciiDoctor;
import org.keycloak.webbuilder.utils.FreeMarker;
import org.keycloak.webbuilder.utils.JsonParser;
import org.keycloak.webbuilder.utils.YamlParser;

import java.io.File;

Expand All @@ -28,6 +29,7 @@ public class Context {
private Extensions extensions;
private Blogs blogs;
private Guides guides;
private GuidesMetadata guidesMetadata;
private News news;

private FreeMarker freeMarker;
Expand Down Expand Up @@ -63,7 +65,8 @@ public void init() throws Exception {
versions = new Versions(versionsDir, jsonParser);
extensions = new Extensions(extensionsDir, jsonParser);
blogs = new Blogs(blogDir, versions, config, freeMarker, asciiDoctor);
guides = new Guides(tmpDir, guidesDir, asciiDoctor);
guidesMetadata = new YamlParser().read(new File(getWebSrcDir(),"/guides.yaml"), GuidesMetadata.class);
guides = new Guides(guidesMetadata, tmpDir, getWebSrcDir(), asciiDoctor);
news = new News(newsDir, blogs, jsonParser, config);

freeMarker.init(this);
Expand Down Expand Up @@ -158,6 +161,10 @@ public File getBlogDir() {
return blogDir;
}

public GuidesMetadata getGuidesMetadata() {
return guidesMetadata;
}

public File getGuidesDir() {
return guidesDir;
}
Expand Down
Loading
Loading