Skip to content

Commit f93ae1d

Browse files
author
TechStack Global
committed
fix(mobile): restore toggle functionality by adding missing script tags to subpages
1 parent 6d8c344 commit f93ae1d

9 files changed

+37
-0
lines changed

fix_scripts.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import glob, os, re
2+
3+
files_root = glob.glob(r'c:\Users\PMLS\Desktop\Youtube Shorts\b2b_blog\*.html')
4+
files_posts = glob.glob(r'c:\Users\PMLS\Desktop\Youtube Shorts\b2b_blog\posts\*.html')
5+
6+
def fix_file(filepath, script_src):
7+
try:
8+
with open(filepath, 'r', encoding='utf-8') as f:
9+
content = f.read()
10+
11+
# Check if script is already there
12+
if re.search(r'<script src=[\"\']' + re.escape(script_src) + r'(\?v=\d+)?[\"\']></script>', content):
13+
return 0
14+
15+
if '</body>' in content:
16+
new_script = f' <script src=\"{script_src}\"></script>\n'
17+
new_content = content.replace('</body>', new_script + '</body>')
18+
with open(filepath, 'w', encoding='utf-8') as f:
19+
f.write(new_content)
20+
print(f'Fixed: {os.path.basename(filepath)}')
21+
return 1
22+
except Exception as e:
23+
print(f'Error fixing {filepath}: {e}')
24+
return 0
25+
26+
root_count = sum(fix_file(f, 'script.js') for f in files_root)
27+
posts_count = sum(fix_file(f, '../script.js') for f in files_posts)
28+
29+
print(f'\nTotal Fixed: {root_count + posts_count}')

posts/best-premium-laptop-for-work-2026.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ <h4>Legal</h4>
274274
</div>
275275
</div>
276276
</footer>
277+
<script src="../script.js"></script>
277278
</body>
278279

279280
</html>

posts/best-remote-work-setup-2026.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ <h3><a href="../index.html" style="text-decoration: none; color: inherit;">TechS
169169
</div>
170170
</div>
171171
</footer>
172+
<script src="../script.js"></script>
172173
</body>
173174

174175
</html>

posts/do-you-need-thunderbolt-dock.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ <h3><a href="../index.html" style="text-decoration: none; color: inherit;">TechS
210210
</div>
211211
</div>
212212
</footer>
213+
<script src="../script.js"></script>
213214
</body>
214215

215216
</html>

posts/is-a-4k-monitor-worth-it.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ <h3><a href="../index.html" style="text-decoration: none; color: inherit;">TechS
202202
</div>
203203
</div>
204204
</footer>
205+
<script src="../script.js"></script>
205206
</body>
206207

207208
</html>

posts/is-samsung-990-pro-worth-it.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ <h3><a href="../index.html" style="text-decoration: none; color: inherit;">TechS
184184
</div>
185185
</div>
186186
</footer>
187+
<script src="../script.js"></script>
187188
</body>
188189

189190
</html>

privacy-policy.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ <h2>Changes to This Policy</h2>
7575
style="display:inline-block; margin-top:1rem; color:var(--accent); text-decoration:none;">&larr; Back to
7676
Home</a>
7777
</main>
78+
<script src="script.js"></script>
7879
</body>
7980

8081
</html>

terms-of-service.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ <h2>Governing Law</h2>
6363
style="display:inline-block; margin-top:1rem; color:var(--accent); text-decoration:none;">&larr; Back to
6464
Home</a>
6565
</main>
66+
<script src="script.js"></script>
6667
</body>
6768

6869
</html>

test_images.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ <h2>71wZJ7mibSL</h2>
99
<img src="https://m.media-amazon.com/images/I/71wZJ7mibSL._AC_SL1500_.jpg" width="500">
1010
<h2>11RNLXhvOXL</h2>
1111
<img src="https://m.media-amazon.com/images/I/11RNLXhvOXL._AC_SL1500_.jpg" width="500">
12+
<script src="script.js"></script>
1213
</body>
1314

1415
</html>

0 commit comments

Comments
 (0)