Double category images until I can figure out the 404 problem
BIN
images/categories/Additions
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
images/categories/Basement Finishing
Normal file
After Width: | Height: | Size: 144 KiB |
BIN
images/categories/Bathroom Renovations
Normal file
After Width: | Height: | Size: 72 KiB |
BIN
images/categories/Decks and Landscaping
Normal file
After Width: | Height: | Size: 106 KiB |
BIN
images/categories/Design Build
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
images/categories/Full House Renovations
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
images/categories/Kitchen Renovations
Normal file
After Width: | Height: | Size: 204 KiB |
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
@ -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>
|
||||||
|