changeset 3fed04e659f3 in www.tryton.org:default
details: https://hg.tryton.org/www.tryton.org?cmd=changeset;node=3fed04e659f3
description:
        Use redirect for alt entry points

        Crawlers works better with redirect than duplicate content.
diffstat:

 app.py |  48 ++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 40 insertions(+), 8 deletions(-)

diffs (147 lines):

diff -r aef1919df75d -r 3fed04e659f3 app.py
--- a/app.py    Thu Jun 27 13:25:01 2019 +0200
+++ b/app.py    Fri Jul 05 00:20:53 2019 +0200
@@ -191,7 +191,6 @@
 
 
 @app.route('/success-stories')
[email protected]('/business-cases.html', endpoint='success_stories-alt')
 @cache.cached()
 def success_stories():
     Case = namedtuple('Case', 'title description url logo'.split())
@@ -275,6 +274,11 @@
     return render_template('success_stories.html', cases=cases)
 
 
[email protected]('/business-cases.html', endpoint='success_stories-alt')
+def success_stories():
+    return redirect(url_for('success_stories'))
+
+
 @app.route('/success-stories/<story>')
 @cache.cached()
 def success_story(story):
@@ -285,12 +289,16 @@
 
 
 @app.route('/download')
[email protected]('/download.html', endpoint='download-alt')
 @cache.cached()
 def download():
     return render_template('download.html')
 
 
[email protected]('/download.html', endpoint='download-alt')
+def download():
+    return redirect(url_for('download'))
+
+
 @app.route('/forum')
 @cache.cached()
 def forum():
@@ -298,12 +306,16 @@
 
 
 @app.route('/presentations')
[email protected]('/papers.html', endpoint='presentations-alt')
 @cache.cached()
 def presentations():
     return render_template('presentations.html')
 
 
[email protected]('/papers.html', endpoint='presentations-alt')
+def presentations():
+    return redirect(url_for('presentations'))
+
+
 @app.route('/events/<event>')
 @cache.cached()
 def event(event):
@@ -357,12 +369,16 @@
 
 
 @app.route('/contribute')
[email protected]('/how-to-contribute.html', endpoint='contribute-alt')
 @cache.cached()
 def contribute():
     return render_template('contribute.html')
 
 
[email protected]('/how-to-contribute.html', endpoint='contribute-alt')
+def contribute():
+    return redirect(url_for('contribute'))
+
+
 @app.route('/develop')
 @cache.cached()
 def develop():
@@ -370,14 +386,17 @@
 
 
 @app.route('/foundation')
[email protected]('/foundation/', endpoint='foundation-alt')
 @cache.cached()
 def foundation():
     return render_template('foundation.html')
 
 
[email protected]('/foundation/', endpoint='foundation-alt')
+def foundation():
+    return redirect(url_for('foundation'))
+
+
 @app.route('/supporters')
[email protected]('/foundation/supporters.html', endpoint='supporters-alt')
 @cache.cached()
 def supporters():
     def url(supporter, start):
@@ -397,13 +416,17 @@
         roundup_url=partial(url, start='https://bugs.tryton.org/'))
 
 
[email protected]('/foundation/supporters.html', endpoint='supporters-alt')
+def supporters():
+    return redirect(url_for('supporters'))
+
+
 @app.template_filter('hostname')
 def hostname(url):
     return urlparse(url).hostname
 
 
 @app.route('/donate')
[email protected]('/foundation/donations.html', endpoint='donate-alt')
 @cache.cached()
 def donate():
     headers = {'Content-Type': 'application/json'}
@@ -424,6 +447,11 @@
         donations=donations)
 
 
[email protected]('/foundation/donations.html', endpoint='donate-alt')
+def donate():
+    return redirect(url_for('donate'))
+
+
 @app.route('/donate/thanks')
 @cache.cached()
 def donate_thanks():
@@ -437,13 +465,17 @@
 
 
 @app.route('/service-providers')
[email protected]('/services.html', endpoint='service_providers-alt')
 @cache.cached()
 def service_providers():
     shuffle(PROVIDERS)
     return render_template('service_providers.html', providers=PROVIDERS)
 
 
[email protected]('/services.html', endpoint='service_providers-alt')
+def service_providers():
+    return redirect(url_for('service_providers'))
+
+
 @app.route('/service-providers/start')
 @cache.cached()
 def service_providers_start():

Reply via email to