This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-fluido-skin.git
commit 87d347f1e8f43cf5095c53c63baa86883e506173 Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Wed Nov 4 06:43:26 2026 +0000 Leave out the sidebar on the pages listed in sideBarSkipped --- src/it/sidebar/src/site/apt/guide/overview.apt | 25 +++++++++++++++++++++++++ src/it/sidebar/src/site/site.xml | 1 + src/it/sidebar/verify.groovy | 11 +++++++++++ src/main/resources/META-INF/maven/site.vm | 8 ++++++++ src/site/markdown/index.md.vm | 10 ++++++++++ 5 files changed, 55 insertions(+) diff --git a/src/it/sidebar/src/site/apt/guide/overview.apt b/src/it/sidebar/src/site/apt/guide/overview.apt new file mode 100644 index 0000000..1779732 --- /dev/null +++ b/src/it/sidebar/src/site/apt/guide/overview.apt @@ -0,0 +1,25 @@ + ------ + Overview + ------ + +~~ Licensed to the Apache Software Foundation (ASF) under one +~~ or more contributor license agreements. See the NOTICE file +~~ distributed with this work for additional information +~~ regarding copyright ownership. The ASF licenses this file +~~ to you under the Apache License, Version 2.0 (the +~~ "License"); you may not use this file except in compliance +~~ with the License. You may obtain a copy of the License at +~~ +~~ http://www.apache.org/licenses/LICENSE-2.0 +~~ +~~ Unless required by applicable law or agreed to in writing, +~~ software distributed under the License is distributed on an +~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +~~ KIND, either express or implied. See the License for the +~~ specific language governing permissions and limitations +~~ under the License. + + +Overview + + A page in a subdirectory, listed in sideBarSkipped. diff --git a/src/it/sidebar/src/site/site.xml b/src/it/sidebar/src/site/site.xml index ccbcfeb..0ecf89d 100644 --- a/src/it/sidebar/src/site/site.xml +++ b/src/it/sidebar/src/site/site.xml @@ -38,6 +38,7 @@ <fluidoSkin> <googleSearch/> <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled> + <sideBarSkipped>dependency-info.html, summary.html, guide/overview.html</sideBarSkipped> </fluidoSkin> </custom> <!-- END SNIPPET: skin-custom-config --> diff --git a/src/it/sidebar/verify.groovy b/src/it/sidebar/verify.groovy index 35680a7..94ec53f 100644 --- a/src/it/sidebar/verify.groovy +++ b/src/it/sidebar/verify.groovy @@ -67,3 +67,14 @@ for ( String icon : [ 'error', 'help', 'info', 'success', 'warning' ] ) { } // the Edit icon sits next to the theme switch in the menu assert html =~ /(?s)<div class="page-tools d-flex align-items-center gap-2 mb-2 px-3"><button type="button" class="theme-switch[^>]*>.*?<\/button>\s*<a class="edit-link btn btn-sm border" href="[^"]+"/ + +// pages listed in sideBarSkipped render without the side menu, the others keep it +String summary = new File( basedir, "target/site/summary.html" ).text +assert !summary.contains( 'id="leftColumn"' ) +assert !summary.contains( 'data-bs-target="#sidebarMenu"' ) +assert !new File( basedir, "target/site/dependency-info.html" ).text.contains( 'id="leftColumn"' ) +assert html.contains( 'id="leftColumn"' ) +assert new File( basedir, "target/site/plugins.html" ).text.contains( 'id="leftColumn"' ) + +// a page in a subdirectory is named by its path from the site root +assert !new File( basedir, "target/site/guide/overview.html" ).text.contains( 'id="leftColumn"' ) diff --git a/src/main/resources/META-INF/maven/site.vm b/src/main/resources/META-INF/maven/site.vm index baf5607..06768cd 100644 --- a/src/main/resources/META-INF/maven/site.vm +++ b/src/main/resources/META-INF/maven/site.vm @@ -82,6 +82,14 @@ #**##forkMeOnGitHub() ## #**##set( $sideBarEnabled = $convert.toBoolean( $site.getCustomValue( 'fluidoSkin.sideBarEnabled', 'true' ) ) && !$standalone ) +## pages listed in sideBarSkipped, such as a front page, go without the side menu +#**##if( $sideBarEnabled && $site.getCustomValue( 'fluidoSkin.sideBarSkipped' ) ) +#* *##foreach( $skippedPage in $site.getCustomValue( 'fluidoSkin.sideBarSkipped' ).split( ',' ) ) +#* *##if( $skippedPage.trim() == $currentFileName ) +#* *##set( $sideBarEnabled = false ) +#* *##end +#* *##end +#**##end #**##set( $searchEnabled = $site.getCustomChild( 'fluidoSkin.googleSearch' ) && ( $site.getCustomValue( 'fluidoSkin.googleSearch.sitesearch' ) || $project.url ) ) ## diff --git a/src/site/markdown/index.md.vm b/src/site/markdown/index.md.vm index 8cbe42a..619d45c 100644 --- a/src/site/markdown/index.md.vm +++ b/src/site/markdown/index.md.vm @@ -80,6 +80,16 @@ That allows users having 4 skins in only 1! Default skin setting is the option **1**. +To leave out the sidebar on a few pages only, such as a front page with its own layout, list them in `custom.fluidoSkin.sideBarSkipped`, separated by commas. A page is named by its path from the site root, such as `index.html` or `guide/overview.html`: + +```xml +<custom> + <fluidoSkin> + <sideBarSkipped>index.html</sideBarSkipped> + </fluidoSkin> +</custom> +``` + ${esc.h}${esc.h}${esc.h} <a id="Topbar_Icon"></a>Topbar Icon When users decide to enable the topbar, they can plug a small icon/logo there (typically 108*20 px) just configuring the `custom.fluidoSkin.topBarIcon` element in `site.xml`:
