d4f0eaa7d9
Co-authored-by: Cursor <cursoragent@cursor.com>
13 lines
369 B
Python
13 lines
369 B
Python
def photo_absolute_url(photo, base_url):
|
|
return f"{base_url.rstrip('/')}{photo.url}"
|
|
|
|
|
|
def photo_bbcode(photo, base_url):
|
|
return f"[img]{photo_absolute_url(photo, base_url)}[/img]"
|
|
|
|
|
|
def photo_html(photo, base_url):
|
|
url = photo_absolute_url(photo, base_url)
|
|
name = photo.original_name.replace('"', """)
|
|
return f'<img src="{url}" alt="{name}">'
|