Skip to content

Commit

Permalink
People Page: change photo alt and id #60
Browse files Browse the repository at this point in the history
Changes the photos on the People Page to include a more descriptive alt tag: Roger Mark to photo of Roger Mark. Also changes photo id to be more descriptive: Roger_Mark to photo_of_Roger_Mark. Fixes part of #60.

Changes photo alt tag
  • Loading branch information
Lucas-Mc committed Sep 9, 2020
1 parent 29fb777 commit dcfeec0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 7 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,15 @@ def people():
"""
data = _data()

path = "sitedata"
fn = "people.yml"
path = 'sitedata'
fn = 'people.yml'

with open(os.path.join(path, fn), 'r') as f:
data["people"] = yaml.safe_load(f)
data['people'] = yaml.safe_load(f)

for i in range(len(data['people']['current_members'])):
data['people']['current_members'][i]['tag_id'] = 'photo_of_' + \
data['people']['current_members'][i]['name'].replace(' ','_')

return render_template('people.html', **data)

Expand Down
8 changes: 4 additions & 4 deletions templates/people.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ <h1 class="site-section-title">People</h1>
<h2 class="site-section border-bottom" id="researchers">Current members</h2>

{% for person in people.current_members %}
<div id="{{ person.name | replace(' ','_') }}">
<div id="{{ person.tag_id }}">
<h2 class="site-section-meta">{{ person.name }}</h2>
<div class="row">
<div class="col-md-2">
{% if person.image %}
<img class="img-fluid" width="120" src="{{ url_for('static', filename='images/' + person.image )}}" alt="{{ person.name }}">
<img class="img-fluid" width="120" src="{{ url_for('static', filename='images/' + person.image )}}" alt="Photo of {{ person.name }}">
{% else %}
<img class="img-fluid" width="120" src="{{ url_for('static', filename='images/missing.jpg' )}}" alt="{{ person.name }}">
<img class="img-fluid" width="120" src="{{ url_for('static', filename='images/missing.jpg' )}}" alt="Photo of {{ person.name }}">
{% endif %}
</div>
<div class="col-md-9">
Expand All @@ -47,7 +47,7 @@ <h2 class="site-section-meta">{{ person.name }}</h2>
<h4 class="font-italic">People</h4>
<ul>
{% for person in people.current_members %}
<li><a href="#{{ person.name | replace(' ','_') }}">{{ person.name }}</a></li>
<li><a href="#{{ person.tag_id }}">{{ person.name }}</a></li>
{% endfor %}
</ul>
</div>
Expand Down

0 comments on commit dcfeec0

Please sign in to comment.