This commit is contained in:
retoor 2025-05-13 20:35:42 +02:00
parent a21e3590ef
commit b55d74fb12
2 changed files with 6 additions and 2 deletions
src/snek
system
templates

View File

@ -131,7 +131,7 @@ def enrich_image_rendering(text):
soup = BeautifulSoup(text, "html.parser")
for element in soup.find_all("img"):
if element.attrs["src"].startswith("/" ):
element.attrs["src"] += "?width=420"
element.attrs["src"] += "?width=240"
picture_template = f'''
<picture>
<source srcset="{element.attrs["src"]}" type="{mimetypes.guess_type(element.attrs["src"])[0]}" />

View File

@ -331,7 +331,11 @@
overlay.style.zIndex = 9999;
const fullImg = document.createElement('img');
fullImg.src = img.src;
const urlObj = new URL(img.src);
urlObj.search = ''
fullImg.src = urlObj.toString();
fullImg.alt = img.alt;
fullImg.style.maxWidth = '90%';
fullImg.style.maxHeight = '90%';