mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-06 00:08:25 -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:
@@ -14,9 +14,11 @@ from app import login_manager
|
||||
from app.main import main
|
||||
from app.main.forms import LoginForm
|
||||
from app.models.user import InvitedUser, User
|
||||
from app.utils import hide_from_search_engines
|
||||
|
||||
|
||||
@main.route('/sign-in', methods=(['GET', 'POST']))
|
||||
@hide_from_search_engines
|
||||
def sign_in():
|
||||
if current_user and current_user.is_authenticated:
|
||||
return redirect(url_for('main.show_accounts_or_dashboard'))
|
||||
|
||||
Reference in New Issue
Block a user