myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hno...@apache.org
Subject [myfaces-tobago] branch master updated: improve demo * hide deprecated & tests from googlebot
Date Fri, 01 Dec 2017 09:54:00 GMT
This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new d2af844  improve demo * hide deprecated & tests from googlebot
d2af844 is described below

commit d2af844575b96d62ea8ad58b566e8bab8efd604a
Author: Henning Noeth <hnoeth@apache.org>
AuthorDate: Fri Dec 1 10:53:53 2017 +0100

    improve demo
    * hide deprecated & tests from googlebot
---
 .../java/org/apache/myfaces/tobago/example/demo/MetaController.java | 6 ++++++
 tobago-example/tobago-example-demo/src/main/webapp/main.xhtml       | 1 +
 2 files changed, 7 insertions(+)

diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/MetaController.java
b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/MetaController.java
index fbc8242..cc7d4bc 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/MetaController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/MetaController.java
@@ -1,6 +1,7 @@
 package org.apache.myfaces.tobago.example.demo;
 
 import javax.enterprise.context.SessionScoped;
+import javax.faces.context.FacesContext;
 import javax.inject.Named;
 import java.io.Serializable;
 
@@ -17,4 +18,9 @@ public class MetaController implements Serializable {
   public void setFormatDetection(final boolean formatDetection) {
     this.formatDetection = formatDetection;
   }
+
+  public boolean isRenderNoindex() {
+    final String viewId = FacesContext.getCurrentInstance().getViewRoot().getViewId();
+    return viewId.contains("content/35-deprecated") || viewId.contains("content/40-test");
+  }
 }
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/main.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/main.xhtml
index 2c14018..556bc0b 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/main.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/main.xhtml
@@ -37,6 +37,7 @@
       <tc:style file="#{request.contextPath}/style/prism.css"/>
 
       <tc:meta name="keywords" content="jsf, tobago, demo"/>
+      <tc:meta name="googlebot" content="noindex" rendered="#{metaController.renderNoindex}"/>
 
       <ui:include src="/menu.xhtml"/>
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@myfaces.apache.org" <commits@myfaces.apache.org>'].

Mime
View raw message