Skip to content

Commit c5dca35

Browse files
committed
Add globe icon for website link, improve plaintext filter for spacing
1 parent 30896d3 commit c5dca35

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

portfolio/templatetags/markdown_extras.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,15 @@ def plaintext(text):
4040
# Strip HTML tags
4141
plain = strip_tags(html)
4242

43+
# Decode common HTML entities
44+
import html as html_module
45+
plain = html_module.unescape(plain)
46+
4347
# Normalize whitespace: collapse multiple spaces/newlines into single space
4448
plain = re.sub(r'\s+', ' ', plain).strip()
4549

50+
# Remove any remaining special characters that might cause spacing issues
51+
plain = re.sub(r'[\u00a0\u2003\u2002\u2009]', ' ', plain) # various space characters
52+
plain = re.sub(r'\s+', ' ', plain).strip()
53+
4654
return plain

templates/base.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,15 @@ <h1 class="text-base md:text-xl font-bold">
7575
<nav class="flex items-center gap-2 md:gap-4 text-sm md:text-base">
7676
<a href="{% url 'posts' %}" class="text-white hover:text-purple-300 transition-colors">Posts</a>
7777
<a href="{% url 'saved-posts' %}" class="text-white hover:text-purple-300 transition-colors">Saved</a>
78-
<a href="https://developer.ericgitangu.com" class="text-white hover:text-purple-300 transition-colors hidden sm:inline">Website</a>
78+
<!-- Website Link with Globe Icon -->
79+
<a href="https://developer.ericgitangu.com" target="_blank" rel="noopener noreferrer"
80+
class="text-white hover:text-purple-300 transition-colors flex items-center gap-1"
81+
title="Visit developer.ericgitangu.com">
82+
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
83+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"/>
84+
</svg>
85+
<span class="hidden sm:inline">Website</span>
86+
</a>
7987
<!-- Theme Toggle Button -->
8088
<button onclick="toggleTheme()" class="p-2 rounded-lg bg-purple-700 hover:bg-purple-600 dark:bg-purple-800 dark:hover:bg-purple-700 text-white transition-colors" aria-label="Toggle theme">
8189
<!-- Sun icon (shown in dark mode) -->

0 commit comments

Comments
 (0)