Skip to content

Commit

Permalink
Featrues/docs openidentityplatform branding (#114)
Browse files Browse the repository at this point in the history
* fix documentation build && change branding

* update github actions

* update node and npm
  • Loading branch information
maximthomas authored Jun 17, 2024
1 parent 24bbc16 commit 5151aff
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
<nav class="container-fluid">
<div class="navbar-header">
<a href="index.html" class="navbar-brand">
<img src='includes/logos/FR_logo_horiz_FC_rev.png'
alt="ForgeRock Documentation"/>
<span>Open Identity Platform</span>
</a>
</div>
<ul id="pdf-link">
Expand Down Expand Up @@ -135,17 +134,14 @@
<div class="footer-left"><span class="footer-item">Copyright ©
<xsl:value-of select="db:info/db:copyright/db:year"/>&#160;
<xsl:value-of select="db:info/db:copyright/db:holder"/></span></div>
<div class="footer-right"><a target="_blank"
class="footer-item snap-left"
href="legalnotice.html"><i
class="glyphicon glyphicon-briefcase"></i> Legal Notice</a> <a
target="_blank" class="footer-item snap-left">
<xsl:attribute name="href">
<xsl:value-of select="'https://bugster.forgerock.org/jira/secure/CreateIssueDetails!init.jspa?pid=10290&amp;issuetype=1&amp;summary=Feedback on: '"/>
<xsl:apply-templates select="/*[1]" mode="title.markup"/>
</xsl:attribute>
<i class="glyphicon glyphicon-ok-sign"></i> Feedback</a>
<a target="_blank" class="footer-item snap-left" href="#" data-toggle="modal" data-target="#myModal"><i class="glyphicon glyphicon-info-sign"></i> About</a> </div>
<div class="footer-right">
<a target="_blank" class="footer-item snap-left" href="legalnotice.html">
<i class="glyphicon glyphicon-briefcase"></i> Legal Notice</a>
<a target="_blank" class="footer-item snap-left" href="https://github.com/OpenIdentityPlatform/OpenAM/issues">
<i class="glyphicon glyphicon-ok-sign"></i> Feedback</a>
<a target="_blank" class="footer-item snap-left" href="#" data-toggle="modal" data-target="#myModal">
<i class="glyphicon glyphicon-info-sign"></i> About</a>
</div>
</div>
</div>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015 ForgeRock AS.
* Portions copyright 2024 3A Systems LLC.
*/

/***********************************/
Expand Down Expand Up @@ -232,6 +233,8 @@ li.L8 {

.navbar-brand {
padding: 7px 15px;
display: flex;
align-items: center;
}
.navbar-brand > img {
height: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015 ForgeRock AS.
* Portions copyright 2024 3A Systems LLC.
*/

package org.forgerock.doc.maven;
Expand All @@ -30,7 +31,6 @@
import org.forgerock.doc.maven.pre.CreateThumbs;
import org.forgerock.doc.maven.pre.Dpi;
import org.forgerock.doc.maven.pre.Filter;
import org.forgerock.doc.maven.pre.HeaderColor;
import org.forgerock.doc.maven.pre.ImageData;
import org.forgerock.doc.maven.pre.JCite;
import org.forgerock.doc.maven.pre.KeepTogether;
Expand Down Expand Up @@ -77,7 +77,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
new XCite(this).execute();
new Filter(this).execute();
new ImageData(this).execute();
new HeaderColor(this).execute();
//new HeaderColor(this).execute(); //this line corrupts table header and crashes docs build
new PlantUml(this).execute();
if (getFormats().contains(Format.pdf) || getFormats().contains(Format.rtf)) {
new KeepTogether(this).execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2012-2015 ForgeRock AS.
* Portions copyright 2024 3A Systems LLC.
*/

package org.forgerock.doc.maven.build;
Expand Down Expand Up @@ -153,10 +154,11 @@ void prepareOlinkDB() throws MojoExecutionException {
}

for (String docName : m.getDocNames()) {
ArrayList<MojoExecutor.Element> cfg = new ArrayList<MojoExecutor.Element>();
ArrayList<MojoExecutor.Element> cfg = new ArrayList<>();
cfg.addAll(m.getBaseConfiguration());
cfg.add(element(name("xincludeSupported"), m.isXincludeSupported()));
cfg.add(element(name("sourceDirectory"), m.path(m.getDocbkxModifiableSourcesDirectory())));
cfg.add(element(name("foCustomization"), m.path(m.getFoCustomization())));
cfg.add(element(name("fop1Extensions"), "1"));
cfg.add(element(name("fopLogLevel"), m.getFopLogLevel()));
cfg.add(element(name("collectXrefTargets"), "yes"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2012-2014 ForgeRock AS
* Portions copyright 2024 3A Systems LLC.
*/

package org.forgerock.doc.maven.post;
Expand All @@ -27,6 +28,7 @@
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;

/**
Expand Down Expand Up @@ -192,27 +194,31 @@ private void addScript() throws MojoExecutionException {
*/
final void editBuiltHtml(final String htmlDir) throws MojoExecutionException {
try {
HashMap<String, String> replacements = new HashMap<String, String>();
HashMap<String, String> replacements = new HashMap<>();

String doctype = IOUtils.toString(
getClass().getResourceAsStream("/starthtml-doctype.txt"), "UTF-8");
getClass().getResourceAsStream("/starthtml-doctype.txt"), StandardCharsets.UTF_8);
replacements.put("<html>", doctype);

// See https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag
String robots = "<head>" + System.getProperty("line.separator")
+ IOUtils.toString(getClass().getResourceAsStream("/robots.txt"), "UTF-8");
+ IOUtils.toString(getClass().getResourceAsStream("/robots.txt"), StandardCharsets.UTF_8);
replacements.put("<head>", robots);

String favicon = IOUtils.toString(
getClass().getResourceAsStream("/endhead-favicon.txt"), "UTF-8");
getClass().getResourceAsStream("/endhead-favicon.txt"), StandardCharsets.UTF_8);
favicon = favicon.replace("FAVICON-LINK", m.getFaviconLink());
replacements.put("</head>", favicon);

String linkToJira = getLinkToJira();

String gascript = IOUtils.toString(
getClass().getResourceAsStream("/endbody-ga.txt"), "UTF-8");
gascript = gascript.replace("ANALYTICS-ID", m.getGoogleAnalyticsId());
String gascript = "";
if(m.getGoogleAnalyticsId() != null && !"".equals(m.getGoogleAnalyticsId())) {
gascript = IOUtils.toString(
getClass().getResourceAsStream("/endbody-ga.txt"), StandardCharsets.UTF_8);
gascript = gascript.replace("ANALYTICS-ID", m.getGoogleAnalyticsId());
}

replacements.put("</body>", linkToJira + "\n" + gascript);

HtmlUtils.updateHtml(htmlDir, replacements);
Expand All @@ -233,7 +239,7 @@ private String getLinkToJira() {
+ "<a href=\"JIRA-URL\">Log a documentation bug.</a></p></div>";

// https://confluence.atlassian.com/display/JIRA/Creating+Issues+via+direct+HTML+links
String jiraURL = "https://github.com/OpenIdentityPlatform/"+m.getProjectName()+"/issues/new";
String jiraURL = "https://github.com/OpenIdentityPlatform/"+m.getProjectName()+"/issues";

if (!jiraURL.contains("pid")) {
link = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2012-2014 ForgeRock AS
* Portions copyright 2024 3A Systems LLC.
*/

package org.forgerock.doc.maven.release;
Expand All @@ -23,6 +24,7 @@

import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
* Add an index.html file to the release layout.
Expand Down Expand Up @@ -54,10 +56,14 @@ public void execute() throws MojoExecutionException {
FileUtils.deleteQuietly(indexHtml);

try {
String content = IOUtils.toString(getClass().getResource("/dfo.index.html"), "UTF-8");
String content = IOUtils.toString(getClass().getResource("/dfo.index.html"), StandardCharsets.UTF_8);
content = content.replace("PRODUCT", m.getProjectName().toLowerCase());
content = content.replace("VERSION", m.getReleaseVersion());
content = content.replace("ANALYTICS-ID", m.getGoogleAnalyticsId());
if(m.getGoogleAnalyticsId() != null) {
content = content.replace("ANALYTICS-ID", m.getGoogleAnalyticsId());
} else {
content = content.replace("ANALYTICS-ID", "");
}

FileUtils.writeStringToFile(indexHtml, content, "UTF-8");
} catch (IOException e) {
Expand Down
2 changes: 1 addition & 1 deletion commons/doc-maven-plugin/src/site/xdoc/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
xsi:schemaLocation="http://maven.apache.org/XDOC/2.0
http://maven.apache.org/xsd/xdoc-2.0.xsd">
<properties>
<title>ForgeRock Doc Build Maven Plugin</title>
<title>Doc Build Maven Plugin</title>
<author email="docs@forgerock.org">ForgeRock AS</author>
</properties>
<body>
Expand Down
3 changes: 2 additions & 1 deletion commons/doc-maven-plugin/src/test/resources/unit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014 ForgeRock AS
* Portions copyright 2024 3A Systems LLC.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>commons.forgerock.org</groupId>
<groupId>org.openidentityplatform.commons</groupId>
<artifactId>doc-plugin-test</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
Expand Down

0 comments on commit 5151aff

Please sign in to comment.