You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2022/06/13 13:55:30 UTC

[allura] 01/03: [#8437] set noindex, follow for empty blog and dicussion tools

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 03398c9b0d3e50e494428d8958c514b5b26c179a
Author: Guillermo Cruz <gu...@slashdotmedia.com>
AuthorDate: Tue Jun 7 13:10:46 2022 -0600

    [#8437] set noindex, follow for empty blog and dicussion tools
---
 ForgeBlog/forgeblog/templates/blog/index.html                      | 6 ++++++
 .../forgediscussion/templates/discussionforums/index.html          | 7 +++++++
 2 files changed, 13 insertions(+)

diff --git a/ForgeBlog/forgeblog/templates/blog/index.html b/ForgeBlog/forgeblog/templates/blog/index.html
index 97fd05e80..b9e82d71c 100644
--- a/ForgeBlog/forgeblog/templates/blog/index.html
+++ b/ForgeBlog/forgeblog/templates/blog/index.html
@@ -20,6 +20,12 @@
 
 {% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}}{% endblock %}
 
+{% block head %}
+    {% if count == 0 %}
+    <meta name="robots" content="noindex, follow"/>
+    {% endif %}
+{% endblock %}
+
 {% block header %}{{c.project.name}} / {{c.app.config.options.mount_label}}: Recent posts{% endblock %}
 
 {% block extra_css %}
diff --git a/ForgeDiscussion/forgediscussion/templates/discussionforums/index.html b/ForgeDiscussion/forgediscussion/templates/discussionforums/index.html
index 941a62d37..d5ee47eb8 100644
--- a/ForgeDiscussion/forgediscussion/templates/discussionforums/index.html
+++ b/ForgeDiscussion/forgediscussion/templates/discussionforums/index.html
@@ -21,6 +21,13 @@
 
 {% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}}{% endblock %}
 
+{%  block head %}
+    {%  if not forums|length %}
+        <meta name="robots" content="noindex, follow">
+    {% endif %}
+{%  endblock %}
+
+
 {% block header %}{{c.app.config.options.mount_label}}{% endblock %}
 
 {% block actions %}