Skip to content

Commit d98d889

Browse files
Fix article header image and language description (#4238)
A couple touch ups for `homepage` and `language#show`
1 parent ceec34b commit d98d889

File tree

8 files changed

+43
-18
lines changed

8 files changed

+43
-18
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
Alerts
3+
https://getbootstrap.com/docs/5.3/components/alerts/
4+
*/
5+
6+
.alert p:last-child { margin-bottom: 0; }
7+
8+
.alert-primary a { color: var(--bs-primary-text-emphasis); }
9+
.alert-secondary a { color: var(--bs-secondary-text-emphasis); }
10+
.alert-success a { color: var(--bs-success-text-emphasis); }
11+
.alert-info a { color: var(--bs-info-text-emphasis); }
12+
.alert-warning a { color: var(--bs-warning-text-emphasis); }
13+
.alert-danger a { color: var(--bs-danger-text-emphasis); }
14+
.alert-light a { color: var(--bs-light-text-emphasis); }
15+
.alert-dark a { color: var(--bs-dark-text-emphasis); }

app/assets/stylesheets/2025/lead.css

+5
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ https://getbootstrap.com/docs/5.3/content/typography/#lead
77
.lead {
88
font-weight: normal;
99
}
10+
11+
/* make .lead links a little bolder for better visibility */
12+
.lead a {
13+
font-weight: 500;
14+
}

app/assets/stylesheets/2025/links.css

-5
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,3 @@ a:active {
2020
.underlined-links a {
2121
text-decoration: underline;
2222
}
23-
24-
/* make .lead links a little bolder for better visibility */
25-
.lead a {
26-
font-weight: 500;
27-
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<%# locals: (article:) %>
2+
3+
<% if article.image.present? %>
4+
<figure class='text-secondary'>
5+
<%= link_to image_tag(article.image, class: 'u-photo mb-2', alt: article.image_description, loading: :lazy), article.path %>
6+
7+
<% if article.image_description.present? %>
8+
<figcaption><%= render_markdown article.image_description %></figcaption>
9+
<% end %>
10+
</figure>
11+
<% end %>

app/views/2025/home/sections/_article.html.erb

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<article class='row mb-3'>
44
<div class='col-12 col-md-4 col-lg-6 order-md-<%= image_class %>'>
5-
<%= render_markdown "[[#{article.image} #{article.path} #{article.image_description}]]" %>
5+
<%= render_themed 'articles/header_image', article: article %>
66
</div><!-- /.col-6 -->
77

88
<div class='col-12 col-md-8 col-lg-6 order-md-<%= text_class %>'>
@@ -15,6 +15,10 @@
1515
<%= render_markdown article.lede %>
1616
</div><!-- /.col-6 -->
1717

18-
<p class='text-uppercase text-end'><%= link_to 'Keep reading →', article.path %></p>
18+
<p class='text-uppercase text-end'>
19+
<%= link_to article.path do %>
20+
<%= tt :keep_reading %>
21+
<% end %>
22+
</p>
1923
</div><!-- /.row -->
2024
</article>

app/views/2025/languages/show.html.erb

+3-11
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
<%= @locale.name %>
1717

1818
<% unless @locale.english? %>
19-
(<%= @locale.name_in_english %>)
19+
<span class='fw-normal text-secondary'>(<%= @locale.name_in_english %>)</span>
2020
<% end %>
2121

2222
<small>
23-
<%= link_to tt(:rss), [:feed, lang: @locale.abbreviation] %>
23+
<%= link_to tt(:rss), [:feed, lang: @locale.abbreviation], class: 'text-secondary' %>
2424
</small>
2525
</h1>
2626
</header>
@@ -36,15 +36,7 @@
3636
<article class='h-entry mb-5 pb-3'>
3737
<div class='row'>
3838
<div class='col-md-6 col-lg-5 col-xl-4'>
39-
<% if article.image.present? %>
40-
<figure class='text-secondary'>
41-
<%= link_to image_tag(article.image, class: 'u-photo mb-2', alt: article.image_description, loading: :lazy), article.path %>
42-
43-
<% if article.image_description.present? %>
44-
<figcaption><%= render_markdown article.image_description %></figcaption>
45-
<% end %>
46-
</figure>
47-
<% end %>
39+
<%= render_themed 'articles/header_image', article: article %>
4840
</div>
4941

5042
<div class='col-md-6 col-lg-7 col-xl-8'>

app/views/layouts/2025/_stylesheets.html.erb

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
stylesheet_partials = %w[
1616
vendor/bootstrap
1717
bootstrap-overrides
18+
19+
alerts
1820
buttons
1921
fonts
2022
headings

config/locales/en/2025.yml

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ en:
6161
ex_workers_collection: Ex-Workers’ Collection
6262
featured_books: Featured books
6363
just_published: Just published
64+
keep_reading: Keep reading
6465
latest_article: Latest article
6566
latest_podcast_episode: Latest podcast episode
6667
learn_more: Learn more

0 commit comments

Comments
 (0)