You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2019/06/15 21:30:11 UTC
[maven-fluido-skin] 01/01: [MSKINS-107] Add "generator" meta tag in
HTML head
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch MSKINS-107
in repository https://gitbox.apache.org/repos/asf/maven-fluido-skin.git
commit 57405f71ea3d38840f9711fb9b2c02f5033eb768
Author: Smaarn <an...@gmail.com>
AuthorDate: Sat Jun 15 15:57:51 2019 +0200
[MSKINS-107] Add "generator" meta tag in HTML head
This closes #9
---
src/it/mskins-107/pom.xml | 58 ++++++++++++++++++++++++
src/it/mskins-107/src/site/apt/index.apt.vm | 31 +++++++++++++
src/it/mskins-107/src/site/site.xml | 35 ++++++++++++++
src/it/mskins-107/verify.groovy | 23 ++++++++++
src/main/resources/META-INF/maven/site-macros.vm | 6 ++-
src/main/resources/META-INF/maven/site.vm | 3 +-
6 files changed, 154 insertions(+), 2 deletions(-)
diff --git a/src/it/mskins-107/pom.xml b/src/it/mskins-107/pom.xml
new file mode 100644
index 0000000..17ff374
--- /dev/null
+++ b/src/it/mskins-107/pom.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<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>org.apache.maven.skins.its</groupId>
+ <artifactId>mskins-107</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <properties>
+ <skinName>@project.name@</skinName>
+ <skinDescription>@project.description@</skinDescription>
+ <skinGroupId>@project.groupId@</skinGroupId>
+ <skinArtifactId>@project.artifactId@</skinArtifactId>
+ <skinVersion>@project.version@</skinVersion>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>@sitePluginVersion@</version>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
+ <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
+</project>
\ No newline at end of file
diff --git a/src/it/mskins-107/src/site/apt/index.apt.vm b/src/it/mskins-107/src/site/apt/index.apt.vm
new file mode 100644
index 0000000..f2c9434
--- /dev/null
+++ b/src/it/mskins-107/src/site/apt/index.apt.vm
@@ -0,0 +1,31 @@
+ ------
+ ${project.name}
+ ------
+ Antoine Malliarakis
+ ------
+ 2019-06-15
+ ------
+
+~~ 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.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+${project.name}
+
+ This is a test for ${skinName} regarding the generation of the generator meta tag.
diff --git a/src/it/mskins-107/src/site/site.xml b/src/it/mskins-107/src/site/site.xml
new file mode 100644
index 0000000..f3fb063
--- /dev/null
+++ b/src/it/mskins-107/src/site/site.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/*
+ * 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.
+ */
+ -->
+
+<project xmlns="http://maven.apache.org/DECORATION/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/DECORATION/1.1.0 http://maven.apache.org/xsd/decoration-1.1.0.xsd"
+ name="${skinName}">
+
+ <skin>
+ <groupId>${skinGroupId}</groupId>
+ <artifactId>${skinArtifactId}</artifactId>
+ <version>${skinVersion}</version>
+ </skin>
+
+ <body />
+</project>
\ No newline at end of file
diff --git a/src/it/mskins-107/verify.groovy b/src/it/mskins-107/verify.groovy
new file mode 100644
index 0000000..20297bc
--- /dev/null
+++ b/src/it/mskins-107/verify.groovy
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+File index = new File( basedir, "target/site/index.html" )
+
+assert index.exists()
+assert 1 == index.getText().count("<meta name=\"generator\" content=\"Apache Maven Doxia Site Renderer 1.8\" />")
diff --git a/src/main/resources/META-INF/maven/site-macros.vm b/src/main/resources/META-INF/maven/site-macros.vm
index 077d7e9..e9553f0 100644
--- a/src/main/resources/META-INF/maven/site-macros.vm
+++ b/src/main/resources/META-INF/maven/site-macros.vm
@@ -835,4 +835,8 @@ $indent </ul>##
</li></ul>
#* *##end
#**##end
-#end
\ No newline at end of file
+#end
+#macro( generatedBy )
+Apache Maven Doxia Site Renderer#if( $doxiaSiteRendererVersion ) $doxiaSiteRendererVersion#end##
+#end
+##
\ No newline at end of file
diff --git a/src/main/resources/META-INF/maven/site.vm b/src/main/resources/META-INF/maven/site.vm
index 37b8a07..a23c43b 100644
--- a/src/main/resources/META-INF/maven/site.vm
+++ b/src/main/resources/META-INF/maven/site.vm
@@ -18,7 +18,7 @@
#parse( "site-macros.vm" )
#set ( $skipGenerationDate = 'true' == $decoration.getCustomValue( 'fluidoSkin.skipGenerationDate' ) )
<!--
- | Generated by Apache Maven Doxia Site Renderer#if( $doxiaSiteRendererVersion ) $doxiaSiteRendererVersion#end##
+ | Generated by #generatedBy()
#if( $docRenderingContext && ( $docRenderingContext.generator || $docRenderingContext.doxiaSource ) ) from##
#**##if( $docRenderingContext.generator ) $docRenderingContext.generator#end##
#**##if( $docRenderingContext.doxiaSource ) $docRenderingContext.doxiaSourcePath#end##
@@ -33,6 +33,7 @@
<meta charset="${outputEncoding}" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
## put meta together
+ <meta name="generator" content="#generatedBy($doxiaSiteRendererVersion)" />
#foreach( $author in $authors )
<meta name="author" content="$author" />
#end