Skip to content

Commit

Permalink
Merge pull request #206 from Bernardo-MG/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
Bernardo-MG authored Jul 10, 2021
2 parents acdc307 + 6c1bd0e commit 159bb5d
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 11 deletions.
21 changes: 11 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<groupId>com.bernardomg.maven.skins</groupId>
<artifactId>docs-maven-skin</artifactId>
<version>2.2.2</version>
<version>2.2.3</version>

<name>Docs Maven Skin</name>
<description>A Maven skin for using Maven Site as a documentation site</description>
Expand Down Expand Up @@ -175,8 +175,6 @@
<name>Bernardo Martínez Garrido</name>
<email>programming@bernardomg.com</email>
<url>https://github.com/Bernardo-MG</url>
<organization>Bernardo Martínez Garrido</organization>
<organizationUrl>https://github.com/Bernardo-MG</organizationUrl>
<roles>
<role>Developer</role>
</roles>
Expand All @@ -190,25 +188,28 @@
<name>Collin Doyle Brooks</name>
<email>collin.brooks@gmail.com</email>
<url>https://github.com/cobhimself</url>
<organization>Collin Doyle Brooks</organization>
<organizationUrl>https://github.com/cobhimself</organizationUrl>
<roles>
<role>Developer</role>
</roles>
<timezone>-6</timezone>
<properties />
</contributor>
<contributor>
<name>Hunter Anderson</name>
<email>ghunteranderson@gmail.com</email>
<url>https://github.com/ghunteranderson</url>
<organization>Hunter Anderson</organization>
<organizationUrl>https://github.com/ghunteranderson</organizationUrl>
<roles>
<role>Developer</role>
</roles>
<timezone>-6</timezone>
<properties />
</contributor>
<contributor>
<name>Oscar Korz</name>
<email>okorz001@gmail.com</email>
<url>https://github.com/okorz001</url>
<roles>
<role>Developer</role>
</roles>
<timezone>-6</timezone>
</contributor>
</contributors>

Expand Down Expand Up @@ -241,7 +242,7 @@
<!-- ============================================== -->
<!-- ================= MAVEN SITE ================= -->
<!-- ============================================== -->
<site.skin.version>2.2.0</site.skin.version>
<site.skin.version>2.2.2</site.skin.version>
<mavenURL>https://mvnrepository.com/artifact/${project.groupId}/${project.artifactId}</mavenURL>
<githubArtifactURL><![CDATA[https://github.com/Bernardo-MG?tab=packages&amp;repo_name=docs-maven-skin]]></githubArtifactURL>
</properties>
Expand Down
7 changes: 7 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -224,5 +224,12 @@
Added shine configuration option for backgrounds.
</action>
</release>
<release version="2.2.3" date="2021-07-10" description="Dark theme image support">
<action dev="okorz001" type="fix">
Corrected images on dark shine.
</action>
</release>
<release version="2.3.0" date="2021-07-04" description="">
</release>
</body>
</document>
6 changes: 5 additions & 1 deletion src/main/resources/META-INF/maven/macros/setup-macros.vm
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@
#**##set( $empty = $siteTool.transformImagesToFigures( $bodyContentParsed ) )
#**##set( $empty = $htmlTool.wrap($bodyContentParsed, 'figure', '<div class="d-inline-flex"></div>') )
#**##set( $empty = $htmlTool.addClass( $bodyContentParsed, 'figure', 'shadow' ) )
#**##set( $empty = $htmlTool.addClass( $bodyContentParsed, 'figure', 'bg-white' ) )
#**##if ( $config.shine && $config.shine.getValue() == "dark" )
#* *##set( $empty = $htmlTool.addClass( $bodyContentParsed, 'figure', 'bg-dark' ) )
#**##else
#* *##set( $empty = $htmlTool.addClass( $bodyContentParsed, 'figure', 'bg-white' ) )
#**##end
#**##set( $empty = $htmlTool.addClass( $bodyContentParsed, 'figure', 'rounded' ) )
#**##set( $empty = $htmlTool.addClass( $bodyContentParsed, 'figure', 'p-2' ) )
#**##set( $empty = $htmlTool.addClass( $bodyContentParsed, 'figure > img', 'img-fluid' ) )
Expand Down
52 changes: 52 additions & 0 deletions src/test/resources/it/image_shine_dark/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<!-- ********************************************** -->
<!-- **************** PROJECT INFO **************** -->
<!-- ********************************************** -->

<groupId>com.bernardomg.maven.skins</groupId>
<artifactId>image-shine-dark</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>

<!-- ********************************************** -->
<!-- **************** PROPERTIES ****************** -->
<!-- ********************************************** -->

<properties>
<!-- Plugins versions -->
<plugin.site.version>@plugin.site.version@</plugin.site.version>
<!-- Maven Site -->
<site.skin.version>@project.version@</site.skin.version>
</properties>

<!-- ********************************************** -->
<!-- ******************* BUILD ******************** -->
<!-- ********************************************** -->

<build>
<defaultGoal>clean package install</defaultGoal>
<plugins>
<plugin>
<!-- Site -->
<!-- Generates the Maven Site -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${plugin.site.version}</version>
<dependencies>
<dependency>
<!-- Docs Maven Skin -->
<groupId>com.bernardomg.maven.skins</groupId>
<artifactId>docs-maven-skin</artifactId>
<version>${site.skin.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

</project>
12 changes: 12 additions & 0 deletions src/test/resources/it/image_shine_dark/src/site/markdown/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Site With Images

This is an example for a Maven Site with images.

![Dice class diagram][dice-class_diagram]

## Big Image

![Big image][big-image]

[big-image]: ./images/Fronalpstock_big.jpg
[dice-class_diagram]: ./images/example_class_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions src/test/resources/it/image_shine_dark/src/site/site.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/DECORATION/1.8.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.8.0 http://maven.apache.org/xsd/decoration-1.8.0.xsd">

<skin>
<groupId>com.bernardomg.maven.skins</groupId>
<artifactId>docs-maven-skin</artifactId>
<version>${site.skin.version}</version>
</skin>

<custom>
<skinConfig>
<bootswatchStyle>darkly</bootswatchStyle>
<shine>dark</shine>
</skinConfig>
</custom>

</project>
26 changes: 26 additions & 0 deletions src/test/resources/it/image_shine_dark/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// This script verifies that a minimal site contains only the barebones of a site.

import org.jsoup.Jsoup

// Acquires the sample HTML content
def html = new File(basedir, 'target/site/index.html').text

// Parses HTML
def parsed = Jsoup.parse(html)
def body = parsed.body()

// Images
def fig = body.select( 'figure' ).first()
assert fig.hasClass( 'shadow' )
assert fig.hasClass( 'bg-dark' )
assert fig.hasClass( 'rounded' )
assert fig.hasClass( 'p-2' )

def firstImg = fig.select( 'img' ).first()
assert firstImg.attr( 'src' ).contains( './images/example_class_diagram.png' )
assert firstImg.attr( 'alt' ).contains( 'Dice class diagram' )
assert firstImg.hasClass( 'img-fluid' )

def firstCaption = fig.select( 'figcaption' ).first()
assert firstCaption.html().contains( 'Dice class diagram' )
assert firstCaption.hasClass( 'font-italic' )

0 comments on commit 159bb5d

Please sign in to comment.