this post was submitted on 11 Apr 2025
4 points (100.0% liked)

HTML

359 readers
1 users here now

founded 2 years ago
MODERATORS
 

Most of the links in my website (i haven't gotten around to all of them yet) have the size of the page they link to as a title, so you can see how big the page will be before you click the link. Is there an easy way to generate new titles for all my links based on what they link to, instead of doing it manually? Even better if it can include embedded files like images in the size preview.

I currently just edit my code in xed, my computer's built in text editor. I haven't looked into dedicated HTML editors yet, but i'd be open to trying one (that runs on Linux) if it can do this.

Thanks in advance.

top 1 comments
sorted by: hot top controversial new old
[–] AnAmericanPotato 2 points 1 month ago

There's no way to do this entirely within HTML. What you need is some kind of HTML builder/compiler. You could potentially write a simple Python script to loop through your tags, check the size of the linked URL, and update the link text.