Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add title to blog index page and image to newsletter #252

Merged
merged 3 commits into from
Feb 1, 2024
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
Binary file added content/images/feb-2024.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions content/posts/newsletter-february-2024.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ category: Newsletter
tags: newsletter, community
authors: Eric Holscher
status: published
image: /images/feb-2024.jpg
image_credit: Photo by <a href="https://unsplash.com/@kevinoetiker?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Kevin Oetiker</a> on <a href="https://unsplash.com/photos/snow-covered-brown-trees-_AL1zHGc5_Q?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Unsplash</a>


## News and updates

Expand Down
4 changes: 2 additions & 2 deletions readthedocs_theme/templates/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="ui medium header">
{{ article.title }}
</div>

<div class="ui text menu">
<time class="item" datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time>

Expand Down Expand Up @@ -53,7 +53,7 @@

<div class="ui divider"></div>

<img class="ui big rounded centered image" src="{{ article.image or '/images/posts/default.svg' }}" alt="{{ article.image_credit }}">
<img class="ui big rounded centered image" src="{{ article.image or '/images/posts/default.svg' }}" alt="{{ article.image }}">
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the alt was replaced with the image URL. I think this was correct before, no?

Copy link
Contributor

@agjohnson agjohnson Feb 2, 2024

Choose a reason for hiding this comment

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

Yeah, the issue comes from using HTML in the image_credit, which isn't valid in an HTML attribute. I would use striptags or escape the HTML instead of replacing with the URL.

With striptags:

image

Edit: added in #253

{% if article.image and article.image_credit %}
<div class="ui basic center aligned segment">
<p><i>{{ article.image_credit}}</i></p>
Expand Down
4 changes: 3 additions & 1 deletion readthedocs_theme/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% macro article_card(article) %}
<a class="ui card" href="/{{ article.url }}">
<div class="image">
<img src="{{ article.image or '/images/posts/default.svg'}}" alt="{{ article.image_credit }}">
<img src="{{ article.image or '/images/posts/default.svg'}}" alt="{{ article.image }}">
</div>
<div class="content">
<div class="header">{{ article.title }}</div>
Expand Down Expand Up @@ -38,6 +38,8 @@
</a>
{% endmacro %}

{% block title%} Blog - Read the Docs {% endblock %}

{% block content %}

<section>
Expand Down