Skip to content

Commit bfc7a98

Browse files
ThorFuchsclaude
andcommitted
feat: Book cover integration — 7 covers, 3 sizes, hero + list
Process 7 source TIFFs into optimized WebP at 3 sizes (96/256/512px). Two-column hero layout on book pages: text left, cover right, stacking on mobile with cover above. Subtle shadow + border treatment, no cropping, no rounded corners. Thumbnail covers (88px) on books list page. Responsive srcset with appropriate sizes attribute. 21 new assets in /assets/books/covers/. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0267b6e commit bfc7a98

24 files changed

Lines changed: 122 additions & 15 deletions

‎_layouts/publication-book.html‎

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,29 @@
1010
{% endif %}
1111
{% endfor %}
1212

13-
<div class="hero-card">
14-
<span class="eyebrow">Publications · Books</span>
15-
<h1>{{ page.title }}</h1>
16-
{% if page.subtitle %}
17-
<p class="hero-subtitle">{{ page.subtitle }}</p>
18-
{% endif %}
19-
{% if page.summary_short and page.summary_short != page.subtitle %}
20-
<p>{{ page.summary_short }}</p>
21-
{% endif %}
13+
{% assign cover_path = '/assets/books/covers/' | append: page.book_slug | append: '-cover-' %}
14+
15+
<div class="hero-card book-hero">
16+
<div class="book-hero-inner">
17+
<div class="book-hero-text">
18+
<span class="eyebrow">Publications · Books</span>
19+
<h1>{{ page.title }}</h1>
20+
{% if page.subtitle %}
21+
<p class="hero-subtitle">{{ page.subtitle }}</p>
22+
{% endif %}
23+
</div>
24+
<div class="book-hero-cover">
25+
<img
26+
src="{{ cover_path | append: '256.webp' | relative_url }}"
27+
srcset="{{ cover_path | append: '256.webp' | relative_url }} 256w, {{ cover_path | append: '512.webp' | relative_url }} 512w"
28+
sizes="(max-width: 760px) min(72vw, 260px), 240px"
29+
width="256" height="410"
30+
alt="Cover of {{ page.title }}: {{ page.subtitle }}"
31+
class="book-cover-img"
32+
loading="eager"
33+
>
34+
</div>
35+
</div>
2236
</div>
2337

2438
{% include summary-cards.html %}

‎_sass/_components.scss‎

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,97 @@
145145
margin-top: 4px;
146146
}
147147

148+
// ================================================================
149+
// Book Cover Hero (two-column layout)
150+
// ================================================================
151+
152+
.book-hero-inner {
153+
display: flex;
154+
gap: 28px;
155+
align-items: flex-start;
156+
157+
@media (max-width: $bp-stack) {
158+
flex-direction: column;
159+
align-items: center;
160+
text-align: center;
161+
}
162+
}
163+
164+
.book-hero-text {
165+
flex: 1;
166+
min-width: 0;
167+
}
168+
169+
.book-hero-cover {
170+
flex-shrink: 0;
171+
width: 240px;
172+
173+
@media (max-width: $bp-collapse) {
174+
width: 200px;
175+
}
176+
177+
@media (max-width: $bp-stack) {
178+
width: min(72vw, 260px);
179+
order: -1; // cover above text on mobile
180+
}
181+
}
182+
183+
.book-cover-img {
184+
width: 100%;
185+
height: auto;
186+
display: block;
187+
border-radius: 6px;
188+
box-shadow:
189+
0 4px 16px rgba(22, 29, 37, 0.10),
190+
0 1px 4px rgba(22, 29, 37, 0.06);
191+
border: 1px solid rgba(0, 0, 0, 0.06);
192+
}
193+
194+
// Book list thumbnails
195+
.book-list-thumb {
196+
width: 88px;
197+
height: auto;
198+
border-radius: 4px;
199+
box-shadow: 0 2px 8px rgba(22, 29, 37, 0.08);
200+
border: 1px solid rgba(0, 0, 0, 0.05);
201+
flex-shrink: 0;
202+
}
203+
204+
.book-list-item {
205+
display: flex;
206+
gap: 16px;
207+
align-items: flex-start;
208+
padding: 12px 0;
209+
border-bottom: 1px solid $divider;
210+
211+
&:last-child { border-bottom: none; }
212+
213+
.book-list-info {
214+
flex: 1;
215+
min-width: 0;
216+
217+
h3 {
218+
font-family: $font-display;
219+
font-size: 1rem;
220+
font-weight: 500;
221+
margin: 0 0 4px;
222+
223+
a {
224+
color: $text;
225+
text-decoration: none;
226+
&:hover { color: $accent; }
227+
}
228+
}
229+
230+
p {
231+
font-size: 0.86rem;
232+
color: $text-muted;
233+
margin: 0;
234+
line-height: 1.45;
235+
}
236+
}
237+
}
238+
148239
// ================================================================
149240
// Format Cards (Amazon book formats)
150241
// ================================================================
40.3 KB
Loading
150 KB
Loading
5.98 KB
Loading
39.1 KB
Loading
144 KB
Loading
6.06 KB
Loading
39.3 KB
Loading
141 KB
Loading

0 commit comments

Comments
 (0)