forked from rDrama/rDrama
1
0
Fork 0

Add assetcache.asset_siteimg, has_logo.

Commit began by changing the duplicated SITE_NAME conditional in the
header to use a `has_logo` param, much like the recent `has_sidebar`.
From there, a need to include site-specific assets in assetcache was
revealed, adding the `asset_siteimg(...)` macro. This was applied
quite broadly, though not comprehensively.
master
Snakes 2022-07-01 01:55:53 -04:00
parent 39c945f7ca
commit 1b9237ceaf
19 changed files with 97 additions and 78 deletions

View File

@ -307,6 +307,9 @@ elif SITE == 'lgbdropthet.com':
HOLE_CREATE_JL_MIN = 3 HOLE_CREATE_JL_MIN = 3
SNAKES_ID = 9 SNAKES_ID = 9
PROCOINS_ENABLED = False
LOTTERY_ENABLED = False
else: # localhost or testing environment implied else: # localhost or testing environment implied
pass pass
@ -944,3 +947,4 @@ COMMENT_SPAM_COUNT_THRESHOLD = int(environ.get("COMMENT_SPAM_COUNT_THRESHOLD", 1
DESCRIPTION = environ.get("DESCRIPTION", "rdrama.net caters to drama in all forms such as: Real life, videos, photos, gossip, rumors, news sites, Reddit, and Beyond™. There isn't drama we won't touch, and we want it all!").strip() DESCRIPTION = environ.get("DESCRIPTION", "rdrama.net caters to drama in all forms such as: Real life, videos, photos, gossip, rumors, news sites, Reddit, and Beyond™. There isn't drama we won't touch, and we want it all!").strip()
has_sidebar = path.exists(f'files/templates/sidebar_{SITE_NAME}.html') has_sidebar = path.exists(f'files/templates/sidebar_{SITE_NAME}.html')
has_logo = path.exists(f'files/assets/images/{SITE_NAME}/logo.webp')

View File

@ -58,4 +58,4 @@ def inject_constants():
"HOLE_NAME": HOLE_NAME, "HOLE_STYLE_FLAIR": HOLE_STYLE_FLAIR, "HOLE_REQUIRED": HOLE_REQUIRED, "HOLE_NAME": HOLE_NAME, "HOLE_STYLE_FLAIR": HOLE_STYLE_FLAIR, "HOLE_REQUIRED": HOLE_REQUIRED,
"LOTTERY_ENABLED": LOTTERY_ENABLED, "GUMROAD_LINK": GUMROAD_LINK, "LOTTERY_ENABLED": LOTTERY_ENABLED, "GUMROAD_LINK": GUMROAD_LINK,
"DEFAULT_THEME": DEFAULT_THEME, "DESCRIPTION": DESCRIPTION, "DEFAULT_THEME": DEFAULT_THEME, "DESCRIPTION": DESCRIPTION,
"PROCOINS_ENABLED": PROCOINS_ENABLED, "has_sidebar": has_sidebar} "PROCOINS_ENABLED": PROCOINS_ENABLED, "has_sidebar": has_sidebar, "has_logo": has_logo}

View File

@ -1,4 +1,4 @@
{%- from 'util/assetcache.html' import asset -%} {%- from 'util/assetcache.html' import asset, asset_siteimg with context -%}
{%- import 'util/helpers.html' as help -%} {%- import 'util/helpers.html' as help -%}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
@ -12,7 +12,7 @@
<meta name="author" content=""> <meta name="author" content="">
<link rel="icon" type="image/webp" href="/i/{{SITE_NAME}}/icon.webp?v=2000"> <link rel="icon" type="image/webp" href="{{asset_siteimg('icon.webp')}}">
<title>{% block pagetitle %}{{SITE_NAME}}{% endblock %}</title> <title>{% block pagetitle %}{{SITE_NAME}}{% endblock %}</title>

View File

@ -1,4 +1,4 @@
{%- from 'util/assetcache.html' import asset -%} {%- from 'util/assetcache.html' import asset, asset_siteimg with context -%}
{%- import 'util/helpers.html' as help -%} {%- import 'util/helpers.html' as help -%}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
@ -11,7 +11,7 @@
<meta name="author" content=""> <meta name="author" content="">
<link id="favicon" rel="icon" type="image/webp" href="/i/{{SITE_NAME}}/icon.webp?v=2000"> <link id="favicon" rel="icon" type="image/webp" href="{{asset_siteimg('icon.webp')}}">
<title>Chat</title> <title>Chat</title>

View File

@ -1,4 +1,4 @@
{%- from 'util/assetcache.html' import asset -%} {%- from 'util/assetcache.html' import asset, asset_siteimg with context -%}
{%- import 'util/helpers.html' as help -%} {%- import 'util/helpers.html' as help -%}
{% if not ajax %} {% if not ajax %}
{% if comment_info %} {% if comment_info %}

View File

@ -1,4 +1,4 @@
{%- from 'util/assetcache.html' import asset -%} {%- from 'util/assetcache.html' import asset, asset_siteimg with context -%}
{%- import 'util/helpers.html' as help -%} {%- import 'util/helpers.html' as help -%}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
@ -84,16 +84,16 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="thumbnail" content="/i/{{SITE_NAME}}/site_preview.webp?v=2000"> <meta name="thumbnail" content="{{asset_siteimg('site_preview.webp')}}">
<link rel="icon" type="image/webp" href="/i/{{SITE_NAME}}/icon.webp?v=2000"> <link rel="icon" type="image/webp" href="{{asset_siteimg('icon.webp')}}">
{% block title %} {% block title %}
<title>{{SITE_NAME}}</title> <title>{{SITE_NAME}}</title>
<meta property="og:type" content="article"> <meta property="og:type" content="article">
<meta property="og:title" content="{{SITE_NAME}}"> <meta property="og:title" content="{{SITE_NAME}}">
<meta property="og:site_name" content="{{request.host}}"> <meta property="og:site_name" content="{{request.host}}">
<meta property="og:image" content="/i/{{SITE_NAME}}/site_preview.webp?v=2000"> <meta property="og:image" content="{{asset_siteimg('site_preview.webp')}}">
<meta property="og:url" content="{{SITE_FULL}}{{request.full_path}}"> <meta property="og:url" content="{{SITE_FULL}}{{request.full_path}}">
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{DESCRIPTION}}"> <meta property="og:description" name="description" content="{{SITE_NAME}} - {{DESCRIPTION}}">
<meta property="og:author" name="author" content="{{SITE_FULL}}"> <meta property="og:author" name="author" content="{{SITE_FULL}}">
@ -104,7 +104,7 @@
<meta name="twitter:title" content="{{SITE_NAME}}"> <meta name="twitter:title" content="{{SITE_NAME}}">
<meta name="twitter:creator" content="{{SITE_FULL}}"> <meta name="twitter:creator" content="{{SITE_FULL}}">
<meta name="twitter:description" content="{{SITE_NAME}} - {{DESCRIPTION}}"> <meta name="twitter:description" content="{{SITE_NAME}} - {{DESCRIPTION}}">
<meta name="twitter:image" content="/i/{{SITE_NAME}}/site_preview.webp?v=2000"> <meta name="twitter:image" content="{{asset_siteimg('site_preview.webp')}}">
<meta name="twitter:url" content="{{SITE_FULL}}{{request.full_path}}"> <meta name="twitter:url" content="{{SITE_FULL}}{{request.full_path}}">
{% endblock %} {% endblock %}
@ -113,10 +113,10 @@
<meta name="format-detection" content="telephone=no"> <meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" sizes="180x180" href="/i/{{SITE_NAME}}/icon.webp?v=2000"> <link rel="apple-touch-icon" sizes="180x180" href="{{asset_siteimg('icon.webp')}}">
<link rel="manifest" href="/assets/manifest_{{SITE_NAME}}.json?v=6"> <link rel="manifest" href="/assets/manifest_{{SITE_NAME}}.json?v=6">
<link rel="mask-icon" href="/i/{{SITE_NAME}}/icon.webp?v=2000"> <link rel="mask-icon" href="{{asset_siteimg('icon.webp')}}">
<link rel="shortcut icon" href="/i/{{SITE_NAME}}/icon.webp?v=2000"> <link rel="shortcut icon" href="{{asset_siteimg('icon.webp')}}">
<meta name="apple-mobile-web-app-title" content="{{SITE_NAME}}"> <meta name="apple-mobile-web-app-title" content="{{SITE_NAME}}">
<meta name="application-name" content="{{SITE_NAME}}"> <meta name="application-name" content="{{SITE_NAME}}">
<meta name="msapplication-TileColor" content="#{% if v %}{{v.themecolor}}{% else %}{{DEFAULT_COLOR}}{% endif %}"> <meta name="msapplication-TileColor" content="#{% if v %}{{v.themecolor}}{% else %}{{DEFAULT_COLOR}}{% endif %}">
@ -128,127 +128,127 @@
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="320x480" sizes="320x480"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="640x960" sizes="640x960"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-icon" rel="apple-touch-icon"
sizes="640x1136" sizes="640x1136"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-icon" rel="apple-touch-icon"
sizes="750x1334" sizes="750x1334"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="768x1004" sizes="768x1004"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="768x1024" sizes="768x1024"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="828x1792" sizes="828x1792"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="1024x748" sizes="1024x748"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="1024x768" sizes="1024x768"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="1125x2436" sizes="1125x2436"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="1242x2208" sizes="1242x2208"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="1242x2688" sizes="1242x2688"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="1334x750" sizes="1334x750"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="1536x2008" sizes="1536x2008"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="1536x2048" sizes="1536x2048"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="1668x2224" sizes="1668x2224"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="1792x828" sizes="1792x828"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="2048x1496" sizes="2048x1496"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="2048x1536" sizes="2048x1536"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="2048x2732" sizes="2048x2732"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="2208x1242" sizes="2208x1242"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="2224x1668" sizes="2224x1668"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="2436x1125" sizes="2436x1125"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="2668x1242" sizes="2668x1242"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
<link <link
rel="apple-touch-startup-image" rel="apple-touch-startup-image"
sizes="2737x2048" sizes="2737x2048"
href="/i/{{SITE_NAME}}/icon.webp?v=2000" href="{{asset_siteimg('icon.webp')}}"
> >
{% block fixedMobileBarJS %} {% block fixedMobileBarJS %}
@ -292,7 +292,7 @@
</a> </a>
{% else %} {% else %}
<a href="/"> <a href="/">
<img alt="site banner" src="/i/{{SITE_NAME}}/banner.webp?v=2001" width="100%"> <img alt="site banner" src="{{asset_siteimg('banner.webp')}}" width="100%">
</a> </a>
{% endif %} {% endif %}
{% endif %} {% endif %}

View File

@ -29,13 +29,13 @@
<div class="navbar navbar-expand-md navbar-light" id="navbar"> <div class="navbar navbar-expand-md navbar-light" id="navbar">
<div class="container-fluid" style="padding:0;"> <div class="container-fluid" style="padding:0;">
<a href="/" class="navbar-brand mr-auto {% if SITE_NAME in ('PCM','WPD') and not sub %}flex-grow-1{% endif %}"> <a href="/" class="navbar-brand mr-auto {% if not has_logo and not sub %}flex-grow-1{% endif %}">
<img alt="header icon" height=33 src="/i/{{SITE_NAME}}/headericon.webp?v=2001"> <img alt="header icon" height=33 src="{{asset_siteimg('headericon.webp')}}">
</a> </a>
{% if sub %} {% if sub %}
<a href="/h/{{sub.name}}" class="font-weight-bold ml-2 flex-grow-1 mt-1" style="font-size:max(14px,1.2vw)">{% if not HOLE_STYLE_FLAIR %}/h/{% endif %}{{sub.name}}</a> <a href="/h/{{sub.name}}" class="font-weight-bold ml-2 flex-grow-1 mt-1" style="font-size:max(14px,1.2vw)">{% if not HOLE_STYLE_FLAIR %}/h/{% endif %}{{sub.name}}</a>
{% elif SITE_NAME not in ('PCM','WPD') %} {% elif has_logo %}
<style> <style>
{% if g.webview %} {% if g.webview %}
@media (min-width: 480px) { @media (min-width: 480px) {
@ -50,7 +50,7 @@
</style> </style>
<div id="logo-container" class="flex-grow-1 logo-container"> <div id="logo-container" class="flex-grow-1 logo-container">
<a href="/"> <a href="/">
<img class="ml-1" id="logo" alt="logo" src="/i/{{SITE_NAME}}/logo.webp?v=2000" width=70> <img class="ml-1" id="logo" alt="logo" src="{{asset_siteimg('logo.webp')}}" width=70>
</a> </a>
</div> </div>
{% endif %} {% endif %}
@ -151,7 +151,7 @@
</div> </div>
<div class="text-left pl-2"> <div class="text-left pl-2">
<div style="color: #{{v.namecolor}}" class="text-small font-weight-bold" id="header--username"><span {% if v.patron %}class="patron" style="background-color:#{{v.namecolor}}"{% endif %}>{{v.username}}</span></div> <div style="color: #{{v.namecolor}}" class="text-small font-weight-bold" id="header--username"><span {% if v.patron %}class="patron" style="background-color:#{{v.namecolor}}"{% endif %}>{{v.username}}</span></div>
<div class="header--currency"><img alt="coins" class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" src="/i/{{SITE_NAME}}/coins.webp?v=2000" title="coins" aria-label="coins"><span id="user-coins-amount">{{v.coins}}</span>{% if not PROCOINS_ENABLED %} Coin{{ help.plural(v.coins) }}{% endif %}</div> <div class="header--currency"><img alt="coins" class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" src="{{asset_siteimg('coins.webp')}}" title="coins" aria-label="coins"><span id="user-coins-amount">{{v.coins}}</span>{% if not PROCOINS_ENABLED %} Coin{{ help.plural(v.coins) }}{% endif %}</div>
{% if PROCOINS_ENABLED %} {% if PROCOINS_ENABLED %}
<div class="header--currency"><img alt="marseybux" class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" src="/i/marseybux.webp?v=2000" title="Marseybux" aria-label="Marseybux"><span id="user-bux-amount">{{v.procoins}}</span></div> <div class="header--currency"><img alt="marseybux" class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" src="/i/marseybux.webp?v=2000" title="Marseybux" aria-label="Marseybux"><span id="user-bux-amount">{{v.procoins}}</span></div>
{% endif %} {% endif %}

View File

@ -1,10 +1,10 @@
{%- from 'util/assetcache.html' import asset -%} {%- from 'util/assetcache.html' import asset, asset_siteimg with context -%}
{%- import 'util/helpers.html' as help -%} {%- import 'util/helpers.html' as help -%}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<link rel="icon" type="image/webp" href="/i/{{SITE_NAME}}/icon.webp?v=2000"> <link rel="icon" type="image/webp" href="{{asset_siteimg('icon.webp')}}">
<meta name="description" content="{{DESCRIPTION}}"> <meta name="description" content="{{DESCRIPTION}}">
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'; connect-src 'self'; object-src 'none';"> <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'; connect-src 'self'; object-src 'none';">

View File

@ -1,10 +1,10 @@
{%- from 'util/assetcache.html' import asset -%} {%- from 'util/assetcache.html' import asset, asset_siteimg with context -%}
{%- import 'util/helpers.html' as help -%} {%- import 'util/helpers.html' as help -%}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<link rel="icon" type="image/webp" href="/i/{{SITE_NAME}}/icon.webp?v=2000"> <link rel="icon" type="image/webp" href="{{asset_siteimg('icon.webp')}}">
<meta name="description" content="{{DESCRIPTION}}"> <meta name="description" content="{{DESCRIPTION}}">
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'; connect-src 'self'; object-src 'none';"> <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'; connect-src 'self'; object-src 'none';">

View File

@ -62,7 +62,7 @@
data-bs-toggle="tooltip" data-bs-toggle="tooltip"
data-bs-placement="bottom" data-bs-placement="bottom"
height="13" height="13"
src="/i/{{SITE_NAME}}/coins.webp?v=2000" src="{{asset_siteimg('coins.webp')}}"
title="" title=""
aria-label="coins" aria-label="coins"
data-bs-original-title="coins" data-bs-original-title="coins"
@ -123,7 +123,7 @@
data-bs-toggle="tooltip" data-bs-toggle="tooltip"
data-bs-placement="bottom" data-bs-placement="bottom"
height="13" height="13"
src="/i/{{SITE_NAME}}/coins.webp?v=2000" src="{{asset_siteimg('coins.webp')}}"
title="" title=""
aria-label="coins" aria-label="coins"
data-bs-original-title="coins" data-bs-original-title="coins"

View File

@ -1,4 +1,4 @@
{%- from 'util/assetcache.html' import asset -%} {%- from 'util/assetcache.html' import asset, asset_siteimg with context -%}
{%- import 'util/helpers.html' as help -%} {%- import 'util/helpers.html' as help -%}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
@ -13,13 +13,13 @@
<meta name="author" content=""> <meta name="author" content="">
<link rel="icon" type="image/webp" href="/i/{{SITE_NAME}}/icon.webp?v=2000"> <link rel="icon" type="image/webp" href="{{asset_siteimg('icon.webp')}}">
<title>{% block pagetitle %}Settings - {{SITE_NAME}}{% endblock %}</title> <title>{% block pagetitle %}Settings - {{SITE_NAME}}{% endblock %}</title>
<meta property="og:type" content="article"> <meta property="og:type" content="article">
<meta property="og:title" content="{{SITE_NAME}}"> <meta property="og:title" content="{{SITE_NAME}}">
<meta property="og:site_name" content="{{request.host}}"> <meta property="og:site_name" content="{{request.host}}">
<meta property="og:image" content="/i/{{SITE_NAME}}/site_preview.webp?v=2000"> <meta property="og:image" content="{{asset_siteimg('site_preview.webp')}}">
<meta property="og:url" content="{{request.host}}"> <meta property="og:url" content="{{request.host}}">
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{DESCRIPTION}}"> <meta property="og:description" name="description" content="{{SITE_NAME}} - {{DESCRIPTION}}">
<meta property="og:author" name="author" content="{{SITE_FULL}}"> <meta property="og:author" name="author" content="{{SITE_FULL}}">
@ -30,7 +30,7 @@
<meta name="twitter:title" content="{{SITE_NAME}}"> <meta name="twitter:title" content="{{SITE_NAME}}">
<meta name="twitter:creator" content="{{SITE_FULL}}"> <meta name="twitter:creator" content="{{SITE_FULL}}">
<meta name="twitter:description" content="{{SITE_NAME}} - {{DESCRIPTION}}"> <meta name="twitter:description" content="{{SITE_NAME}} - {{DESCRIPTION}}">
<meta name="twitter:image" content="/i/{{SITE_NAME}}/site_preview.webp?v=2000"> <meta name="twitter:image" content="{{asset_siteimg('site_preview.webp')}}">
<meta name="twitter:url" content="{{request.host}}"> <meta name="twitter:url" content="{{request.host}}">

View File

@ -1,4 +1,4 @@
{%- from 'util/assetcache.html' import asset -%} {%- from 'util/assetcache.html' import asset, asset_siteimg with context -%}
{%- import 'util/helpers.html' as help -%} {%- import 'util/helpers.html' as help -%}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
@ -13,13 +13,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content=""> <meta name="author" content="">
<meta name="thumbnail" content="/i/{{SITE_NAME}}/site_preview.webp?v=2000"> <meta name="thumbnail" content="{{asset_siteimg('site_preview.webp')}}">
<link rel="icon" type="image/webp" href="/i/{{SITE_NAME}}/icon.webp?v=2000"> <link rel="icon" type="image/webp" href="{{asset_siteimg('icon.webp')}}">
<meta property="og:type" content="article"> <meta property="og:type" content="article">
<meta property="og:title" content="{{SITE_NAME}}"> <meta property="og:title" content="{{SITE_NAME}}">
<meta property="og:site_name" content="{{request.host}}"> <meta property="og:site_name" content="{{request.host}}">
<meta property="og:image" content="/i/{{SITE_NAME}}/site_preview.webp?v=2000"> <meta property="og:image" content="{{asset_siteimg('site_preview.webp')}}">
<meta property="og:url" content="{{SITE_FULL}}{{request.full_path}}"> <meta property="og:url" content="{{SITE_FULL}}{{request.full_path}}">
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{DESCRIPTION}}"> <meta property="og:description" name="description" content="{{SITE_NAME}} - {{DESCRIPTION}}">
<meta property="og:author" name="author" content="{{SITE_FULL}}"> <meta property="og:author" name="author" content="{{SITE_FULL}}">
@ -30,7 +30,7 @@
<meta name="twitter:title" content="{{SITE_NAME}}"> <meta name="twitter:title" content="{{SITE_NAME}}">
<meta name="twitter:creator" content="{{SITE_FULL}}"> <meta name="twitter:creator" content="{{SITE_FULL}}">
<meta name="twitter:description" content="{{SITE_NAME}} - {{DESCRIPTION}}"> <meta name="twitter:description" content="{{SITE_NAME}} - {{DESCRIPTION}}">
<meta name="twitter:image" content="/i/{{SITE_NAME}}/site_preview.webp?v=2000"> <meta name="twitter:image" content="{{asset_siteimg('site_preview.webp')}}">
<meta name="twitter:url" content="{{SITE_FULL}}{{request.full_path}}"> <meta name="twitter:url" content="{{SITE_FULL}}{{request.full_path}}">

View File

@ -1,9 +1,9 @@
{%- from 'util/assetcache.html' import asset -%} {%- from 'util/assetcache.html' import asset, asset_siteimg with context -%}
{%- import 'util/helpers.html' as help -%} {%- import 'util/helpers.html' as help -%}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<link rel="icon" type="image/webp" href="/i/{{SITE_NAME}}/icon.webp?v=2000"> <link rel="icon" type="image/webp" href="{{asset_siteimg('icon.webp')}}">
<meta name="description" content="{{DESCRIPTION}}"> <meta name="description" content="{{DESCRIPTION}}">
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'; connect-src 'self'; object-src 'none';"> <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'; connect-src 'self'; object-src 'none';">
@ -17,7 +17,7 @@
<meta property="og:type" content="article"> <meta property="og:type" content="article">
<meta property="og:title" content="{{SITE_NAME}}"> <meta property="og:title" content="{{SITE_NAME}}">
<meta property="og:site_name" content="{{request.host}}"> <meta property="og:site_name" content="{{request.host}}">
<meta property="og:image" content="/i/{{SITE_NAME}}/site_preview.webp?v=2000"> <meta property="og:image" content="{{asset_siteimg('site_preview.webp')}}">
<meta property="og:url" content="{{request.host}}"> <meta property="og:url" content="{{request.host}}">
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{DESCRIPTION}}"> <meta property="og:description" name="description" content="{{SITE_NAME}} - {{DESCRIPTION}}">
<meta property="og:author" name="author" content="{{SITE_FULL}}"> <meta property="og:author" name="author" content="{{SITE_FULL}}">
@ -28,7 +28,7 @@
<meta name="twitter:title" content="{{SITE_NAME}}"> <meta name="twitter:title" content="{{SITE_NAME}}">
<meta name="twitter:creator" content="{{SITE_FULL}}"> <meta name="twitter:creator" content="{{SITE_FULL}}">
<meta name="twitter:description" content="{{SITE_NAME}} - {{DESCRIPTION}}"> <meta name="twitter:description" content="{{SITE_NAME}} - {{DESCRIPTION}}">
<meta name="twitter:image" content="/i/{{SITE_NAME}}/site_preview.webp?v=2000"> <meta name="twitter:image" content="{{asset_siteimg('site_preview.webp')}}">
<meta name="twitter:url" content="{{request.host}}"> <meta name="twitter:url" content="{{request.host}}">
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %}</title> <title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %}</title>

View File

@ -1,10 +1,10 @@
{%- from 'util/assetcache.html' import asset -%} {%- from 'util/assetcache.html' import asset, asset_siteimg with context -%}
{%- import 'util/helpers.html' as help -%} {%- import 'util/helpers.html' as help -%}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<link rel="icon" type="image/webp" href="/i/{{SITE_NAME}}/icon.webp?v=2000"> <link rel="icon" type="image/webp" href="{{asset_siteimg('icon.webp')}}">
<meta name="description" content="{{DESCRIPTION}}"> <meta name="description" content="{{DESCRIPTION}}">
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'; connect-src 'self'; object-src 'none';"> <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'; connect-src 'self'; object-src 'none';">
@ -18,7 +18,7 @@
<meta property="og:type" content="article"> <meta property="og:type" content="article">
<meta property="og:title" content="{{SITE_NAME}}"> <meta property="og:title" content="{{SITE_NAME}}">
<meta property="og:site_name" content="{{request.host}}"> <meta property="og:site_name" content="{{request.host}}">
<meta property="og:image" content="/i/{{SITE_NAME}}/site_preview.webp?v=2000"> <meta property="og:image" content="{{asset_siteimg('site_preview.webp')}}">
<meta property="og:url" content="{{request.host}}"> <meta property="og:url" content="{{request.host}}">
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{DESCRIPTION}}"> <meta property="og:description" name="description" content="{{SITE_NAME}} - {{DESCRIPTION}}">
<meta property="og:author" name="author" content="{{SITE_FULL}}"> <meta property="og:author" name="author" content="{{SITE_FULL}}">
@ -29,7 +29,7 @@
<meta name="twitter:title" content="{{SITE_NAME}}"> <meta name="twitter:title" content="{{SITE_NAME}}">
<meta name="twitter:creator" content="{{SITE_FULL}}"> <meta name="twitter:creator" content="{{SITE_FULL}}">
<meta name="twitter:description" content="{{SITE_NAME}} - {{DESCRIPTION}}"> <meta name="twitter:description" content="{{SITE_NAME}} - {{DESCRIPTION}}">
<meta name="twitter:image" content="/i/{{SITE_NAME}}/site_preview.webp?v=2000"> <meta name="twitter:image" content="{{asset_siteimg('site_preview.webp')}}">
<meta name="twitter:url" content="{{request.host}}"> <meta name="twitter:url" content="{{request.host}}">
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %}</title> <title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %}</title>

View File

@ -598,7 +598,7 @@
<meta property="og:description" name="description" content="{{comment_info.plainbody(v)}}"> <meta property="og:description" name="description" content="{{comment_info.plainbody(v)}}">
<meta property="og:author" name="author" content="{{'@'+comment_info.author_name}}"> <meta property="og:author" name="author" content="{{'@'+comment_info.author_name}}">
<meta property="og:title" content="{{'@'+comment_info.author_name}} comments on {{p.plaintitle(v)}} - {{SITE_NAME}}"> <meta property="og:title" content="{{'@'+comment_info.author_name}} comments on {{p.plaintitle(v)}} - {{SITE_NAME}}">
<meta property="og:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/assets/images/{{SITE_NAME}}/site_preview.webp?v=1016{% endif %}"> <meta property="og:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE}}{{asset_siteimg('site_preview.webp')}}{% endif %}">
{% if p.is_video %} {% if p.is_video %}
<meta property="og:video" content="{{p.realurl(v)}}"> <meta property="og:video" content="{{p.realurl(v)}}">
{% elif p.is_audio %} {% elif p.is_audio %}
@ -612,7 +612,7 @@
<meta name="twitter:title" content="{{'@'+comment_info.author_name}} comments on {{p.plaintitle(v)}} - {{SITE_NAME}}"> <meta name="twitter:title" content="{{'@'+comment_info.author_name}} comments on {{p.plaintitle(v)}} - {{SITE_NAME}}">
<meta name="twitter:creator" content="{{'@'+comment_info.author_name}}"> <meta name="twitter:creator" content="{{'@'+comment_info.author_name}}">
<meta name="twitter:description" content="{{comment_info.plainbody(v)}}"> <meta name="twitter:description" content="{{comment_info.plainbody(v)}}">
<meta name="twitter:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/assets/images/{{SITE_NAME}}/site_preview.webp?v=1016{% endif %}"> <meta name="twitter:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE}}{{asset_siteimg('site_preview.webp')}}{% endif %}">
<meta name="twitter:url" content="{{p.permalink}}"> <meta name="twitter:url" content="{{p.permalink}}">
{% else %} {% else %}
@ -626,7 +626,7 @@
{% if not v_forbid_deleted -%} {% if not v_forbid_deleted -%}
<meta property="og:description" name="description" content="{{p.plainbody(v)}}"> <meta property="og:description" name="description" content="{{p.plainbody(v)}}">
<meta property="og:title" content="{{p.plaintitle(v)}} - {{SITE_NAME}}"> <meta property="og:title" content="{{p.plaintitle(v)}} - {{SITE_NAME}}">
<meta property="og:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/assets/images/{{SITE_NAME}}/site_preview.webp?v=1016{% endif %}"> <meta property="og:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE}}{{asset_siteimg('site_preview.webp')}}{% endif %}">
<meta property="og:url" content="{{p.permalink}}"> <meta property="og:url" content="{{p.permalink}}">
{%- endif %} {%- endif %}
<meta property="og:site_name" content="{{request.host}}"> <meta property="og:site_name" content="{{request.host}}">
@ -637,7 +637,7 @@
{% if not v_forbid_deleted -%} {% if not v_forbid_deleted -%}
{% if p.author %}<meta name="twitter:creator" content="{{'@'+p.author_name}}">{% endif %} {% if p.author %}<meta name="twitter:creator" content="{{'@'+p.author_name}}">{% endif %}
<meta name="twitter:description" content="{{p.plainbody(v)}}"> <meta name="twitter:description" content="{{p.plainbody(v)}}">
<meta name="twitter:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb %}{{p.thumb_url}}{% else %}{{SITE_NAME}}/assets/images/{{SITE_NAME}}/site_preview.webp?v=1016{% endif %}"> <meta name="twitter:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb %}{{p.thumb_url}}{% else %}{{SITE}}{{asset_siteimg('site_preview.webp')}}{% endif %}">
{%- endif %} {%- endif %}
<meta name="twitter:url" content="{{p.permalink}}"> <meta name="twitter:url" content="{{p.permalink}}">

View File

@ -1,4 +1,4 @@
{%- from 'util/assetcache.html' import asset -%} {%- from 'util/assetcache.html' import asset, asset_siteimg with context -%}
{%- import 'util/helpers.html' as help -%} {%- import 'util/helpers.html' as help -%}
{% if v %} {% if v %}

View File

@ -1,4 +1,4 @@
{%- from 'util/assetcache.html' import asset -%} {%- from 'util/assetcache.html' import asset, asset_siteimg with context -%}
{%- import 'util/helpers.html' as help -%} {%- import 'util/helpers.html' as help -%}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
@ -12,7 +12,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content=""> <meta name="author" content="">
<link rel="icon" type="image/webp" href="/i/{{SITE_NAME}}/icon.webp?v=2000"> <link rel="icon" type="image/webp" href="{{asset_siteimg('icon.webp')}}">
{% if request.host == 'pcmemes.net' %} {% if request.host == 'pcmemes.net' %}
{% set cc='Splash Mountain' %} {% set cc='Splash Mountain' %}

View File

@ -113,7 +113,7 @@
<div class="font-weight-bolder"> <div class="font-weight-bolder">
<span id="profile-coins-amount">{{u.coins}}</span> <span id="profile-coins-amount">{{u.coins}}</span>
<img alt="coins" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="coins" height="20" src="/i/{{SITE_NAME}}/coins.webp?v=2000">&nbsp;&nbsp; <img alt="coins" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="coins" height="20" src="{{asset_siteimg('coins.webp')}}">&nbsp;&nbsp;
{% if PROCOINS_ENABLED %} {% if PROCOINS_ENABLED %}
<span id="profile-bux-amount">{{u.procoins}}</span> <span id="profile-bux-amount">{{u.procoins}}</span>
@ -417,7 +417,7 @@
<div class="font-weight-normal"> <div class="font-weight-normal">
<span id="profile-coins-amount-mobile" class="font-weight-bold">{{u.coins}}</span> <span id="profile-coins-amount-mobile" class="font-weight-bold">{{u.coins}}</span>
<img alt="coins" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="coins" height="15" src="/i/{{SITE_NAME}}/coins.webp?v=2000">&nbsp;&nbsp; <img alt="coins" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="coins" height="15" src="{{asset_siteimg('coins.webp')}}">&nbsp;&nbsp;
{% if PROCOINS_ENABLED %} {% if PROCOINS_ENABLED %}
<span id="profile-bux-amount-mobile" class="font-weight-bold">{{u.procoins}}</span> <span id="profile-bux-amount-mobile" class="font-weight-bold">{{u.procoins}}</span>

View File

@ -31,6 +31,21 @@ set CACHE_VER = {
'images/badges/': 1022, 'images/badges/': 1022,
} }
-%} -%}
{%-
set CACHE_VER_SITEIMG = {
'rDrama': 2000,
'FunOnly': 2000,
'PCM': 2000,
'Cringetopia': 2000,
'WPD': 2000,
'LGBDropTheT': 2010,
}
-%}
{%- macro asset(name, file='') -%} {%- macro asset(name, file='') -%}
/assets/{{name}}{{file}}?v={{ CACHE_VER[name] }} /assets/{{name}}{{file}}?v={{ CACHE_VER[name] }}
{%- endmacro -%} {%- endmacro -%}
{%- macro asset_siteimg(name) -%}
/i/{{SITE_NAME}}/{{name}}?v={{ CACHE_VER_SITEIMG[name] }}
{%- endmacro -%}