Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Commit

Permalink
link to correct docs pdf location
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Jan 27, 2016
1 parent 70f9c13 commit 763ddeb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 1 addition & 3 deletions flask_website/__init__.py
Expand Up @@ -33,9 +33,7 @@ def current_year():
app.add_url_rule('/docs/', endpoint='docs.index', build_only=True)
app.add_url_rule('/docs/<path:page>/', endpoint='docs.show',
build_only=True)
app.add_url_rule('/docs/flask-docs.pdf', endpoint='docs.pdf',
build_only=True)
app.add_url_rule('/docs/flask-docs.zip', endpoint='docs.zip',
app.add_url_rule('/docs/<version>/.latex/Flask.pdf', endpoint='docs.pdf',
build_only=True)

from flask_website.views import general
Expand Down
3 changes: 1 addition & 2 deletions flask_website/templates/general/index.html
Expand Up @@ -63,8 +63,7 @@ <h2>Interested?</h2>
<li><a href="{{ latest_release.download_url }}">Download latest release</a> ({{ latest_release.version }})
<li>
<a href="{{ url_for('docs.index') }}">Read the documentation</a> or download as
<a href="{{ url_for('docs.pdf') }}">PDF</a> and
<a href="{{ url_for('docs.zip') }}">zipped HTML</a>
<a href="{{ url_for('docs.pdf', version=docs_pdf_version) }}">PDF</a>
<li><a href="{{ url_for('mailinglist.index') }}">Join the mailinglist</a>
<li><a href=http://github.com/mitsuhiko/flask>Fork it on github</a>
<li><a href=http://github.com/mitsuhiko/flask/issues>Add issues and feature requests</a>
Expand Down
10 changes: 8 additions & 2 deletions flask_website/views/general.py
Expand Up @@ -14,8 +14,14 @@
def index():
if request_wants_json():
return jsonify(releases=[r.to_json() for r in releases])
return render_template('general/index.html',
latest_release=releases[-1])

return render_template(
'general/index.html',
latest_release=releases[-1],
# pdf link does not redirect, needs version
# docs version only includes major.minor
docs_pdf_version='.'.join(releases[-1].version.split('.', 2)[:2])
)


@mod.route('/search/')
Expand Down

0 comments on commit 763ddeb

Please sign in to comment.