Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .frontmatter_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ patterns:
- field_name: lang
- field_name: layout
- field_name: title
- field_name: author
2 changes: 1 addition & 1 deletion _layouts/blog-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h2><a href="{{ page }}.html">
{% if page.description %}
<p>{{page.description}}</p>
{% endif %}
<small>{{page.author | join(", ")}} - <strong>{{page.date | format_datetime}}</strong></small>
<small>{% if page.author %}{{page.author | join(", ")}} - {% endif %}<strong>{{page.date | format_datetime}}</strong></small>
</div>
</article>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion _layouts/event-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h1>{{title}}</h1>
<h2><a href="{{ page }}.html">
{{ page.title }}
</a></h2>
<small>{{page.author}} {{page.date}}</small>
<small>{% if page.author %}{{page.author | join(", ")}} {% endif %}{{page.date}}</small>
</article>
{% endfor %}
</section>
Expand Down
19 changes: 12 additions & 7 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
<header class="post-header">
<h1 class="post-title p-name" itemprop="name headline">{{ title }}</h1>
<p class="post-meta">
{% if author %}
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
{% for person in author %}
<span class="p-author h-card" itemprop="name">{{ person }}</span>
{% if not loop.last %}, {% endif %}
{% endfor %}
</span>

{% endif %}
</p>
</header>
<div class="post-content e-content" itemprop="articleBody">
Expand All @@ -30,13 +31,17 @@ <h1 class="post-title p-name" itemprop="name headline">{{ title }}</h1>
</article>
</section>

{% set author = authors %}
<section>
{% if author and author.bio %}
<hr />
<h3>About {{author.name}}</h3>
<p>{{author.bio|e}}</p>
</section>
{% if author %}
{% for author_name in author %}
{% set author_data = SITE_AUTHORS | selectattr("name", "equalto", author_name) | first %}
{% if author_data and author_data.bio %}
<hr />
<h3>About {{author_data.name}}</h3>
<p>{{author_data.bio|e}}</p>
{% endif %}
{% endfor %}
{% endif %}
</section>

{% endblock %}
3 changes: 3 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
app.site_vars["navigation"] = navigation
app.site_vars["DATETIME_FORMAT"] = "%d %b %Y"
app.site_vars["year"] = str(datetime.date.today().year)
app.site_vars["SITE_AUTHORS"] = json.loads(
pathlib.Path("_data/authors.json").read_text()
)


@app.page
Expand Down
5 changes: 5 additions & 0 deletions scripts/check_author_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ def check_authors():
if not isinstance(author, list):
print(f"Error: Author in {file_path} is not a list: {author}")
failed = True
elif len(author) == 0:
print(
f"Error: Author list in {file_path} is empty. Remove the field if there is no author."
)
failed = True
except Exception as e:
print(f"Error processing {file_path}: {e}")
failed = True
Expand Down