Skip to content

Commit e3a225a

Browse files
starbopsclaude
andcommitted
fix: actually center blog post content by removing forced left alignment
- Remove problematic 'text-left' from prose-centered CSS class - Restructure blog single template to properly center content within flex layout - Wrap blog header and content in max-w-4xl mx-auto containers - Fix navigation section to use consistent centering - Ensure blog posts now display with proper centered text alignment This addresses the issue where blog content was still left-aligned despite previous attempts to fix text centering across the site. Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b65ae1f commit e3a225a

File tree

2 files changed

+30
-27
lines changed

2 files changed

+30
-27
lines changed

assets/css/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
/* Centered prose content with optimal reading width */
1414
.prose-centered {
15-
@apply max-w-4xl mx-auto text-left;
15+
@apply max-w-4xl mx-auto;
1616
}
1717

1818
/* Prose content specifically for main content sections */

layouts/_default/single.html

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,37 @@
44
<div class="flex flex-col lg:flex-row gap-8 mb-12">
55
<!-- Main Content -->
66
<article class="flex-1 min-w-0">
7-
<header class="reading-width-wide mb-8">
8-
{{ with .Params.categories }}
9-
<div class="mb-4">
10-
{{ range . }}
11-
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}"
12-
class="inline-block px-3 py-1 text-sm font-medium text-primary-600 bg-primary-50 rounded-full hover:bg-primary-100 mr-2">
13-
{{ . }}
14-
</a>
15-
{{ end }}
16-
</div>
17-
{{ end }}
7+
<!-- Header centered -->
8+
<div class="max-w-4xl mx-auto">
9+
<header class="mb-8">
10+
{{ with .Params.categories }}
11+
<div class="mb-4">
12+
{{ range . }}
13+
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}"
14+
class="inline-block px-3 py-1 text-sm font-medium text-primary-600 bg-primary-50 rounded-full hover:bg-primary-100 mr-2">
15+
{{ . }}
16+
</a>
17+
{{ end }}
18+
</div>
19+
{{ end }}
1820

19-
<h1 class="responsive-title mb-4">{{ .Title }}</h1>
20-
21-
{{ partial "post-meta.html" . }}
22-
</header>
21+
<h1 class="responsive-title mb-4">{{ .Title }}</h1>
22+
23+
{{ partial "post-meta.html" . }}
24+
</header>
2325

24-
{{ with .Params.featured_image }}
25-
<div class="reading-width-wide mb-8">
26-
<img src="{{ . }}"
27-
alt="{{ $.Title }}"
28-
class="w-full h-auto rounded-lg"
29-
loading="lazy">
30-
</div>
31-
{{ end }}
26+
{{ with .Params.featured_image }}
27+
<div class="mb-8">
28+
<img src="{{ . }}"
29+
alt="{{ $.Title }}"
30+
class="w-full h-auto rounded-lg"
31+
loading="lazy">
32+
</div>
33+
{{ end }}
34+
</div>
3235

33-
<!-- Content with optimal reading width -->
34-
<div class="prose prose-lg prose-centered">
36+
<!-- Content with optimal reading width and proper centering -->
37+
<div class="prose prose-lg max-w-4xl mx-auto">
3538
{{ .Content }}
3639
</div>
3740
</article>
@@ -44,7 +47,7 @@ <h1 class="responsive-title mb-4">{{ .Title }}</h1>
4447

4548
<!-- Full-width Navigation Section -->
4649
<nav class="border-t border-gray-200 mt-12 pt-8">
47-
<div class="reading-width-wide">
50+
<div class="max-w-4xl mx-auto">
4851
<div class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4">
4952
{{ with .PrevInSection }}
5053
<a href="{{ .RelPermalink }}"

0 commit comments

Comments
 (0)