Skip to content

Commit df95813

Browse files
author
TechStack Global
committed
Add professional branding favicons and update header tags
1 parent 4505acd commit df95813

15 files changed

+112
-10
lines changed

about.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap"
99
rel="stylesheet">
1010
<link rel="stylesheet" href="/style.css">
11-
<link rel="icon" type="image/png" href="/favicon.png">
11+
<link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/favicon-32.png">
12+
<link rel="icon" type="image/png" sizes="16x16" href="/assets/icons/favicon-16.png">
13+
<link rel="apple-touch-icon" sizes="192x192" href="/assets/icons/techstack-logo-192.png">
14+
<link rel="shortcut icon" href="/assets/icons/favicon.ico">
1215
</head>
1316

1417
<body class="dark-theme">

affiliate-disclosure.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap"
99
rel="stylesheet">
1010
<link rel="stylesheet" href="/style.css">
11-
<link rel="icon" type="image/png" href="/favicon.png">
11+
<link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/favicon-32.png">
12+
<link rel="icon" type="image/png" sizes="16x16" href="/assets/icons/favicon-16.png">
13+
<link rel="apple-touch-icon" sizes="192x192" href="/assets/icons/techstack-logo-192.png">
14+
<link rel="shortcut icon" href="/assets/icons/favicon.ico">
1215
</head>
1316

1417
<body class="dark-theme">

assets/icons/favicon-16.png

461 Bytes
Loading

assets/icons/favicon-32.png

828 Bytes
Loading

assets/icons/favicon.ico

1.32 KB
Binary file not shown.
955 Bytes
Loading

assets/icons/techstack-logo.svg

Lines changed: 4 additions & 0 deletions
Loading

blog.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap"
99
rel="stylesheet">
1010
<link rel="stylesheet" href="/style.css">
11-
<link rel="icon" type="image/png" href="/favicon.png">
11+
1212
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
13+
<link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/favicon-32.png">
14+
<link rel="icon" type="image/png" sizes="16x16" href="/assets/icons/favicon-16.png">
15+
<link rel="apple-touch-icon" sizes="192x192" href="/assets/icons/techstack-logo-192.png">
16+
<link rel="shortcut icon" href="/assets/icons/favicon.ico">
1317
</head>
1418

1519
<body class="dark-theme">

contact.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap"
99
rel="stylesheet">
1010
<link rel="stylesheet" href="/style.css">
11-
<link rel="icon" type="image/png" href="/favicon.png">
11+
<link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/favicon-32.png">
12+
<link rel="icon" type="image/png" sizes="16x16" href="/assets/icons/favicon-16.png">
13+
<link rel="apple-touch-icon" sizes="192x192" href="/assets/icons/techstack-logo-192.png">
14+
<link rel="shortcut icon" href="/assets/icons/favicon.ico">
1215
</head>
1316

1417
<body class="dark-theme">

generate_brand_icons.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import os
2+
import glob
3+
import re
4+
from PIL import Image, ImageDraw
5+
6+
base_dir = r'c:\Users\PMLS\Desktop\Youtube Shorts\b2b_blog'
7+
icons_dir = os.path.join(base_dir, 'assets', 'icons')
8+
os.makedirs(icons_dir, exist_ok=True)
9+
10+
size = 192
11+
img = Image.new('RGBA', (size, size), (0,0,0,0))
12+
draw = ImageDraw.Draw(img)
13+
14+
# Dark sleek background
15+
draw.rounded_rectangle([(0,0), (size-1, size-1)], radius=40, fill=(15, 23, 42, 255))
16+
17+
# Sharp tech 'T' logo in TechStack Blue
18+
draw.rectangle([(50, 60), (142, 85)], fill=(56, 189, 248, 255)) # Top bar
19+
draw.rectangle([(84, 85), (108, 140)], fill=(56, 189, 248, 255)) # Stem
20+
21+
# Save files
22+
img.save(os.path.join(icons_dir, 'techstack-logo-192.png'))
23+
24+
img_32 = img.resize((32, 32), Image.Resampling.LANCZOS)
25+
img_32.save(os.path.join(icons_dir, 'favicon-32.png'))
26+
27+
img_16 = img.resize((16, 16), Image.Resampling.LANCZOS)
28+
img_16.save(os.path.join(icons_dir, 'favicon-16.png'))
29+
30+
img_32.save(os.path.join(icons_dir, 'favicon.ico'), format='ICO', sizes=[(16, 16), (32, 32)])
31+
32+
svg = '''<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 192">
33+
<rect width="192" height="192" rx="40" fill="#0f172a"/>
34+
<path d="M 50 60 L 142 60 L 142 85 L 108 85 L 108 140 L 84 140 L 84 85 L 50 85 Z" fill="#38bdf8"/>
35+
</svg>'''
36+
with open(os.path.join(icons_dir, 'techstack-logo.svg'), 'w') as f:
37+
f.write(svg)
38+
39+
print('Icons generated.')
40+
41+
html_files = glob.glob(os.path.join(base_dir, '*.html')) + glob.glob(os.path.join(base_dir, 'posts', '*.html'))
42+
43+
new_tags = ''' <link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/favicon-32.png">
44+
<link rel="icon" type="image/png" sizes="16x16" href="/assets/icons/favicon-16.png">
45+
<link rel="apple-touch-icon" sizes="192x192" href="/assets/icons/techstack-logo-192.png">
46+
<link rel="shortcut icon" href="/assets/icons/favicon.ico">'''
47+
48+
for fpath in html_files:
49+
with open(fpath, 'r', encoding='utf-8') as f:
50+
content = f.read()
51+
52+
# Strip existing favicon tags
53+
content = re.sub(r'<link[^>]+rel=[\'"](?:shortcut )?icon[\'"][^>]*>', '', content, flags=re.IGNORECASE)
54+
content = re.sub(r'<link[^>]+rel=[\'"]apple-touch-icon[\'"][^>]*>', '', content, flags=re.IGNORECASE)
55+
56+
# Clean up empty lines left behind by re.sub
57+
content = re.sub(r'\n\s*\n\s*</head>', '\n</head>', content)
58+
59+
# Insert new tags
60+
content = content.replace('</head>', f'{new_tags}\n</head>')
61+
62+
with open(fpath, 'w', encoding='utf-8') as f:
63+
f.write(content)
64+
65+
print('HTML headers updated.')

0 commit comments

Comments
 (0)