Skip to content

Commit 4708dc1

Browse files
committed
Improve post display and image readability
- Increase generated image font size from 42 to 56px - Center posts on /posts page with flexbox - Update tag font size to 20px for better visibility - Style profile image as circular in README
1 parent d38db4e commit 4708dc1

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
<div align="center">
1212
<a href="https://developer.ericgitangu.com">
13-
<img src="https://developer.ericgitangu.com/_next/image?url=%2Ffavicon.png&w=96&q=75" style="border-radius: 50%" alt="deveric.io logo"/>
13+
<img src="https://developer.ericgitangu.com/_next/image?url=%2Ffavicon.png&w=128&q=75" width="128" height="128" style="border-radius: 50%; overflow: hidden; display: inline-block;" alt="Eric Gitangu"/>
14+
<br/>
1415
<h2>Eric Gitangu</h2>
1516
</a>
1617

portfolio/management/commands/generate_images.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def generate_image(self, post):
118118
draw = ImageDraw.Draw(image)
119119

120120
# Try to load a font, fall back to default
121-
font_size = 42
121+
font_size = 56
122122
try:
123123
font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", font_size)
124124
except (IOError, OSError):
@@ -132,7 +132,7 @@ def generate_image(self, post):
132132
lines = self.wrap_text(title, font, width - 80, draw)
133133

134134
# Calculate vertical position to center text
135-
line_height = font_size + 10
135+
line_height = font_size + 14
136136
total_height = len(lines) * line_height
137137
y_start = (height - total_height) // 2
138138

@@ -153,10 +153,10 @@ def generate_image(self, post):
153153
if tags:
154154
tag_text = ' | '.join(tags)
155155
try:
156-
small_font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 16)
156+
small_font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 20)
157157
except (IOError, OSError):
158158
small_font = font
159-
draw.text((20, height - 30), tag_text.upper(), font=small_font, fill=(255, 255, 255, 180))
159+
draw.text((20, height - 35), tag_text.upper(), font=small_font, fill=(255, 255, 255, 180))
160160

161161
return image
162162

portfolio/static/all-posts.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ ul {
2424
list-style: none;
2525
margin: 0 auto;
2626
padding: 0;
27-
display: content;
28-
27+
display: flex;
28+
flex-wrap: wrap;
29+
justify-content: center;
30+
gap: 2rem;
2931
}
3032

3133
.post img {

0 commit comments

Comments
 (0)