mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Use meta tag to tell search engines not to index
Google’s documentation says: > robots.txt is not a mechanism for keeping a web page out of Google. To > keep a web page out of Google, you should use noindex directives A noindex directive means adding the following meta tag to pages that shouldn’t be indexed: ```html <meta name="robots" content="noindex" /> ``` It’s also possible to set the directive as a HTTP header, but this seems trickier to achieve on a per-view basis in Flask. I’ve implemented this as a decorator so it can quickly be added to any other pages that we decide shouldn’t appear in search results.
This commit is contained in:
@@ -19,11 +19,13 @@ from app.models.feedback import (
|
||||
PROBLEM_TICKET_TYPE,
|
||||
QUESTION_TICKET_TYPE,
|
||||
)
|
||||
from app.utils import hide_from_search_engines
|
||||
|
||||
bank_holidays = BankHolidays(use_cached_holidays=True)
|
||||
|
||||
|
||||
@main.route('/support', methods=['GET', 'POST'])
|
||||
@hide_from_search_engines
|
||||
def support():
|
||||
|
||||
if current_user.is_authenticated:
|
||||
@@ -50,12 +52,14 @@ def support():
|
||||
|
||||
|
||||
@main.route('/support/public')
|
||||
@hide_from_search_engines
|
||||
def support_public():
|
||||
return render_template('views/support/public.html')
|
||||
|
||||
|
||||
@main.route('/support/triage', methods=['GET', 'POST'])
|
||||
@main.route('/support/triage/<ticket_type:ticket_type>', methods=['GET', 'POST'])
|
||||
@hide_from_search_engines
|
||||
def triage(ticket_type=PROBLEM_TICKET_TYPE):
|
||||
form = Triage()
|
||||
if form.validate_on_submit():
|
||||
@@ -75,6 +79,7 @@ def triage(ticket_type=PROBLEM_TICKET_TYPE):
|
||||
|
||||
|
||||
@main.route('/support/<ticket_type:ticket_type>', methods=['GET', 'POST'])
|
||||
@hide_from_search_engines
|
||||
def feedback(ticket_type):
|
||||
form = FeedbackOrProblem()
|
||||
|
||||
@@ -153,6 +158,7 @@ def feedback(ticket_type):
|
||||
|
||||
|
||||
@main.route('/support/escalate', methods=['GET', 'POST'])
|
||||
@hide_from_search_engines
|
||||
def bat_phone():
|
||||
|
||||
if current_user.is_authenticated:
|
||||
@@ -162,6 +168,7 @@ def bat_phone():
|
||||
|
||||
|
||||
@main.route('/support/thanks', methods=['GET', 'POST'])
|
||||
@hide_from_search_engines
|
||||
def thanks():
|
||||
return render_template(
|
||||
'views/support/thanks.html',
|
||||
|
||||
Reference in New Issue
Block a user