Double category images until I can figure out the 404 problem

This commit is contained in:
Alexander Hosking 2018-12-31 01:57:08 -05:00
parent 2ad00de402
commit 32ef15b386
9 changed files with 4 additions and 6 deletions

BIN
images/categories/Additions Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

View File

@ -99,14 +99,12 @@ def show_project_file(category, project_name, filename):
@freezer.register_generator @freezer.register_generator
def category_photo_url_generator(): def category_photo_url_generator():
categories = os.getcwd() + '/images/categories/' categories = os.getcwd() + '/images/categories/'
for category in categories: for category in os.listdir(categories):
print(category) category = category.replace(" ", "%20")
yield ('show_category_banner', {'filename': category}) yield ('show_category_banner', {'filename': category})
@app.route('/category/<filename>') @app.route('/category/<path:filename>')
def show_category_banner(filename): def show_category_banner(filename):
print(filename)
filename = filename + ".jpg"
return send_from_directory('images/categories/', filename) return send_from_directory('images/categories/', filename)

View File

@ -37,7 +37,7 @@
<div class="portfolio-image"> <div class="portfolio-image">
<div class="px-media"> <div class="px-media">
<figure> <figure>
<a href="{{ url_for('show_project_category', category=category) }}"><img src="{{ url_for('show_category_banner', filename=category) }}" alt=""></a> <a href="{{ url_for('show_project_category', category=category) }}"><img src="{{ url_for('show_category_banner', filename=category) }}.jpg" alt=""></a>
<figcaption> <figcaption>
<h6><a href="{{ url_for('show_project_category', category=category) }}">{{ category }}</a></h6> <h6><a href="{{ url_for('show_project_category', category=category) }}">{{ category }}</a></h6>
<span><a href="{{ url_for('show_project_category', category=category) }}">{{ category }}</a></span> <span><a href="{{ url_for('show_project_category', category=category) }}">{{ category }}</a></span>