Static images now use flask url_for to get url
This commit is contained in:
parent
9610d995de
commit
b6f7f7a2b7
@ -1,4 +1,4 @@
|
|||||||
title = 'Frequently asked question'
|
title = 'Frequently asked questions'
|
||||||
|
|
||||||
content = {
|
content = {
|
||||||
'How does this process work?': {
|
'How does this process work?': {
|
||||||
|
|||||||
@ -1,12 +1,14 @@
|
|||||||
|
from flask import url_for
|
||||||
|
|
||||||
title = 'About me'
|
title = 'About me'
|
||||||
|
|
||||||
content = {
|
content = {
|
||||||
'section 1': {
|
'section 1': {
|
||||||
'images': ['../static/img/about_me/about_me_1_sm.jpg',
|
'images': ['img/about_me/about_me_1_sm.jpg',
|
||||||
'../static/img/about_me/about_me_1_md.jpg',
|
'img/about_me/about_me_1_md.jpg',
|
||||||
'../static/img/about_me/about_me_1_lg.jpg',
|
'img/about_me/about_me_1_lg.jpg',
|
||||||
'../static/img/about_me/about_me_1_xl.jpg',
|
'img/about_me/about_me_1_xl.jpg',
|
||||||
'../static/img/about_me/about_me_1_xxl.jpg'],
|
'img/about_me/about_me_1_xxl.jpg'],
|
||||||
|
|
||||||
'content': '''Before I provided animal caretaking services,
|
'content': '''Before I provided animal caretaking services,
|
||||||
I focused my time on computers. I attended AACC
|
I focused my time on computers. I attended AACC
|
||||||
@ -15,11 +17,11 @@ content = {
|
|||||||
I designed and coded this website!'''
|
I designed and coded this website!'''
|
||||||
},
|
},
|
||||||
'section 2': {
|
'section 2': {
|
||||||
'images': ['../static/img/about_me/about_me_2_sm.jpg',
|
'images': ['img/about_me/about_me_2_sm.jpg',
|
||||||
'../static/img/about_me/about_me_2_md.jpg',
|
'img/about_me/about_me_2_md.jpg',
|
||||||
'../static/img/about_me/about_me_2_lg.jpg',
|
'img/about_me/about_me_2_lg.jpg',
|
||||||
'../static/img/about_me/about_me_2_xl.jpg',
|
'img/about_me/about_me_2_xl.jpg',
|
||||||
'../static/img/about_me/about_me_2_xxl.jpg'],
|
'img/about_me/about_me_2_xxl.jpg'],
|
||||||
'content': '''For the past 5 years, my interest in plants and
|
'content': '''For the past 5 years, my interest in plants and
|
||||||
horticulture have expanded exponentially. As a kid,
|
horticulture have expanded exponentially. As a kid,
|
||||||
my mother always had plants around our home. I
|
my mother always had plants around our home. I
|
||||||
@ -29,11 +31,11 @@ content = {
|
|||||||
because they're so easy to grow.'''
|
because they're so easy to grow.'''
|
||||||
},
|
},
|
||||||
'section 3': {
|
'section 3': {
|
||||||
'images': ['../static/img/about_me/about_me_3_sm.jpg',
|
'images': ['img/about_me/about_me_3_sm.jpg',
|
||||||
'../static/img/about_me/about_me_3_md.jpg',
|
'img/about_me/about_me_3_md.jpg',
|
||||||
'../static/img/about_me/about_me_3_lg.jpg',
|
'img/about_me/about_me_3_lg.jpg',
|
||||||
'../static/img/about_me/about_me_3_xl.jpg',
|
'img/about_me/about_me_3_xl.jpg',
|
||||||
'../static/img/about_me/about_me_3_xxl.jpg'],
|
'img/about_me/about_me_3_xxl.jpg'],
|
||||||
'content': '''My passion for animals and plants are what I
|
'content': '''My passion for animals and plants are what I
|
||||||
spend most my time on currently. I love providing
|
spend most my time on currently. I love providing
|
||||||
quality animal care.'''
|
quality animal care.'''
|
||||||
|
|||||||
@ -5,11 +5,11 @@ content = {
|
|||||||
{
|
{
|
||||||
'title': 'Walking',
|
'title': 'Walking',
|
||||||
'images': [
|
'images': [
|
||||||
'../static/img/services/dog_walking_card_sm.png',
|
'img/services/dog_walking_card_sm.png',
|
||||||
'../static/img/services/dog_walking_card_md.png',
|
'img/services/dog_walking_card_md.png',
|
||||||
'../static/img/services/dog_walking_card_lg.png',
|
'img/services/dog_walking_card_lg.png',
|
||||||
'../static/img/services/dog_walking_card_xl.png',
|
'img/services/dog_walking_card_xl.png',
|
||||||
'../static/img/services/dog_walking_card_xxl.png'],
|
'img/services/dog_walking_card_xxl.png'],
|
||||||
'price': '$20/visit',
|
'price': '$20/visit',
|
||||||
'included': [
|
'included': [
|
||||||
'30 minute walk.',
|
'30 minute walk.',
|
||||||
@ -18,11 +18,11 @@ content = {
|
|||||||
{
|
{
|
||||||
'title': 'Drop-in',
|
'title': 'Drop-in',
|
||||||
'images': [
|
'images': [
|
||||||
'../static/img/services/drop_in_card_sm.png',
|
'img/services/drop_in_card_sm.png',
|
||||||
'../static/img/services/drop_in_card_md.png',
|
'img/services/drop_in_card_md.png',
|
||||||
'../static/img/services/drop_in_card_lg.png',
|
'img/services/drop_in_card_lg.png',
|
||||||
'../static/img/services/drop_in_card_xl.png',
|
'img/services/drop_in_card_xl.png',
|
||||||
'../static/img/services/drop_in_card_xxl.png'],
|
'img/services/drop_in_card_xxl.png'],
|
||||||
'price': '$20/visit',
|
'price': '$20/visit',
|
||||||
'included': [
|
'included': [
|
||||||
'30 minute in home visit.',
|
'30 minute in home visit.',
|
||||||
@ -31,11 +31,11 @@ content = {
|
|||||||
{
|
{
|
||||||
'title': 'House sitting',
|
'title': 'House sitting',
|
||||||
'images': [
|
'images': [
|
||||||
'../static/img/services/house_sitting_card_sm.png',
|
'img/services/house_sitting_card_sm.png',
|
||||||
'../static/img/services/house_sitting_card_md.png',
|
'img/services/house_sitting_card_md.png',
|
||||||
'../static/img/services/house_sitting_card_lg.png',
|
'img/services/house_sitting_card_lg.png',
|
||||||
'../static/img/services/house_sitting_card_xl.png',
|
'img/services/house_sitting_card_xl.png',
|
||||||
'../static/img/services/house_sitting_card_xxl.png'],
|
'img/services/house_sitting_card_xxl.png'],
|
||||||
'price': '$38/visit',
|
'price': '$38/visit',
|
||||||
'included': [
|
'included': [
|
||||||
'Animal care.',
|
'Animal care.',
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row text-center mb-2">
|
<div class="row text-center mb-2">
|
||||||
<h1 class="text-primary display-1">
|
<h1 class="text-primary display-1">
|
||||||
Frequently asked questions
|
{{ page.get_title() }}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -21,15 +21,16 @@
|
|||||||
<picture>
|
<picture>
|
||||||
{% for img in page.get_content()[row]['images'] %}
|
{% for img in page.get_content()[row]['images'] %}
|
||||||
{% if not loop.last %}
|
{% if not loop.last %}
|
||||||
<source srcset="{{ img }}"
|
<source srcset="{{ url_for('static', filename=img) }}"
|
||||||
media="(max-width: {{ config.IMG_BREAKPOINTS[loop.index] }})" />
|
media="(max-width: {{ config.IMG_BREAKPOINTS[loop.index] }})" />
|
||||||
{% else %}
|
{% else %}
|
||||||
<source srcset="{{ img }}"
|
<source srcset="{{ url_for('static', filename=img) }}"
|
||||||
media="(min-width: {{ config.IMG_BREAKPOINTS[loop.index] }})" />
|
media="(min-width: {{ config.IMG_BREAKPOINTS[loop.index] }})" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<img class="img-fluid" src="{{ page.get_content()[row]['images'][1] }}">
|
<img class="img-fluid"
|
||||||
|
src="{{ url_for('static', filename=page.get_content()[row]['images'][1]) }}">
|
||||||
</picture>
|
</picture>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -25,16 +25,16 @@
|
|||||||
<picture>
|
<picture>
|
||||||
{% for img in service['images'] %}
|
{% for img in service['images'] %}
|
||||||
{% if not loop.last %}
|
{% if not loop.last %}
|
||||||
<source srcset="{{ img }}"
|
<source srcset="{{ url_for('static', filename=img) }}"
|
||||||
media="(max-width: {{ config.IMG_BREAKPOINTS[loop.index] }})" />
|
media="(max-width: {{ config.IMG_BREAKPOINTS[loop.index] }})" />
|
||||||
{% else %}
|
{% else %}
|
||||||
<source srcset="{{ img }}"
|
<source srcset="{{ url_for('static', filename=img) }}"
|
||||||
media="(min-width: {{ config.IMG_BREAKPOINTS[loop.index] }})" />
|
media="(min-width: {{ config.IMG_BREAKPOINTS[loop.index] }})" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<img class="img-fluid card-img-top"
|
<img class="img-fluid card-img-top"
|
||||||
src="{{ service['images'][1] }}">
|
src="{{ url_for('static', filename=service['images'][1]) }}">
|
||||||
</picture>
|
</picture>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h1 class="card-title text-center text-primary">{{ service['title'] }}</h1>
|
<h1 class="card-title text-center text-primary">{{ service['title'] }}</h1>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user