aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2014-06-18 05:10:02 +0700
committerGravatar Ugnich Anton2014-06-18 05:10:02 +0700
commit2e844c16e2ae2054096d2d0abb84280e0b1af3dc (patch)
tree6cffd9c2ae32f5bdf3e3c0cde2b19e6cebce92d5 /src
parent52ad8e863986008ac45cf901d9ebefc5e610e92d (diff)
+ meta noindex on "before=" and tags
Diffstat (limited to 'src')
-rw-r--r--src/java/com/juick/http/www/Discover.java8
-rw-r--r--src/java/com/juick/http/www/Home.java6
-rw-r--r--src/java/com/juick/http/www/User.java8
3 files changed, 19 insertions, 3 deletions
diff --git a/src/java/com/juick/http/www/Discover.java b/src/java/com/juick/http/www/Discover.java
index dcc0c441..ccc460d9 100644
--- a/src/java/com/juick/http/www/Discover.java
+++ b/src/java/com/juick/http/www/Discover.java
@@ -69,7 +69,13 @@ public class Discover {
response.setContentType("text/html; charset=UTF-8");
PrintWriter out = response.getWriter();
try {
- PageTemplates.pageHead(out, title, null);
+ String head = "";
+ if (TagQueries.getTagNoIndex(sql, paramTag.TID)) {
+ head = "<meta name=\"robots\" content=\"noindex,nofollow\"/>";
+ } else if (paramBefore > 0) {
+ head = "<meta name=\"robots\" content=\"noindex\"/>";
+ }
+ PageTemplates.pageHead(out, title, head);
PageTemplates.pageNavigation(out, visitor, null);
PageTemplates.pageHomeColumn(out, sql, visitor);
diff --git a/src/java/com/juick/http/www/Home.java b/src/java/com/juick/http/www/Home.java
index db8b0b2c..465640d8 100644
--- a/src/java/com/juick/http/www/Home.java
+++ b/src/java/com/juick/http/www/Home.java
@@ -93,7 +93,11 @@ public class Home {
response.setContentType("text/html; charset=UTF-8");
PrintWriter out = response.getWriter();
try {
- PageTemplates.pageHead(out, title, null);
+ String head = "";
+ if (paramBefore > 0) {
+ head = "<meta name=\"robots\" content=\"noindex\"/>";
+ }
+ PageTemplates.pageHead(out, title, head);
PageTemplates.pageNavigation(out, visitor, paramSearch);
PageTemplates.pageHomeColumn(out, sql, visitor);
diff --git a/src/java/com/juick/http/www/User.java b/src/java/com/juick/http/www/User.java
index 382d3be9..23b80dd0 100644
--- a/src/java/com/juick/http/www/User.java
+++ b/src/java/com/juick/http/www/User.java
@@ -117,7 +117,13 @@ public class User {
response.setContentType("text/html; charset=UTF-8");
PrintWriter out = response.getWriter();
try {
- PageTemplates.pageHead(out, title, "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"@" + user.UName + "\" href=\"//rss.juick.com/" + user.UName + "/blog\"/>");
+ String head = "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"@" + user.UName + "\" href=\"//rss.juick.com/" + user.UName + "/blog\"/>";
+ if (paramTag != null && TagQueries.getTagNoIndex(sql, paramTag.TID)) {
+ head += "<meta name=\"robots\" content=\"noindex,nofollow\"/>";
+ } else if (paramBefore > 0) {
+ head += "<meta name=\"robots\" content=\"noindex\"/>";
+ }
+ PageTemplates.pageHead(out, title, head);
PageTemplates.pageNavigation(out, visitor, null);
pageUserColumn(out, sql, user, visitor);