Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow Markdown in author bio #2215

Merged
merged 4 commits into from
Jul 24, 2019
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
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ analytics:
author:
name : "Your Name"
avatar : # path of avatar image, e.g. "/assets/images/bio-photo.jpg"
bio : "I am an amazing person."
bio : "I am an **amazing** person."
location : "Somewhere"
email :
links:
Expand Down
6 changes: 3 additions & 3 deletions _includes/author-profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
<h3 class="author__name" itemprop="name">{{ author.name }}</h3>
{% endif %}
{% if author.bio %}
<p class="author__bio" itemprop="description">
{{ author.bio }}
</p>
<div class="author__bio" itemprop="description">
{{ author.bio | markdownify }}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

author__bio will need to be rethought to do this, perhaps changing the <p> element to a <div>. Not sure if that will break any styling though.

The reason for this is the markdownify filter will wrap text in <p></p> so you'll get something like

<p class="author__bio" itemprop="description">
  <p>I am an <em>amazing</em> person.</p>
</p>

Which isn't great.

</div>
{% endif %}
</div>

Expand Down
2 changes: 1 addition & 1 deletion test/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ analytics:
author:
name : "Your Name"
avatar : "/assets/images/bio-photo.jpg"
bio : "I am an amazing person."
bio : "I am an **amazing** person."
location : "Somewhere"
links:
- label: "Your Website"
Expand Down