Changeset 48027f2 in Klonkt
- Timestamp:
- 06/28/2026 10:23:01 PM (2 months ago)
- Branches:
- main
- Children:
- 8308c9ca
- Parents:
- 3487567
- git-author:
- Robin Genis <roboburr@…> (06/28/2026 10:21:57 PM)
- git-committer:
- Robin Genis <roboburr@…> (06/28/2026 10:23:01 PM)
- File:
-
- 1 edited
-
src/views/shell.ejs (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/views/shell.ejs
r3487567 r48027f2 1 1 <% 2 2 // ── Helpers used inside this template ───────────────────────────── 3 // Escape for double-quoted HTML attributes. IMPORTANT: emit this with the RAW EJS output 4 // tag, never the escaping one — escaping it a second time turned og:title "Jason's" into the 5 // double-escaped "Jason&#39;s", and naive OG scrapers (Signal/WhatsApp) show that literally. 6 // We deliberately do NOT escape the apostrophe: it is safe inside a double-quoted attribute and 7 // a literal apostrophe is what link-preview scrapers expect. 3 8 function _e(s) { 4 9 return String(s == null ? '' : s) 5 10 .replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>') 6 .replace(/"/g, '"') .replace(/'/g, ''');11 .replace(/"/g, '"'); 7 12 } 8 13 … … 104 109 } 105 110 %><!DOCTYPE html> 106 <html lang="<% = _e(lang) %>" data-palette="<%=_e((typeof palette !== 'undefined' && palette) ? palette : (safeSite.palette || 'klonkt')) %>">111 <html lang="<%- _e(lang) %>" data-palette="<%- _e((typeof palette !== 'undefined' && palette) ? palette : (safeSite.palette || 'klonkt')) %>"> 107 112 <head> 108 113 <meta charset="utf-8"> … … 111 116 112 117 <title><%= _finalTitle %></title> 113 <meta name="description" content="<% =_e(_socialDescr) %>">114 <meta name="theme-color" content="<% =_e(safeAccent) %>">118 <meta name="description" content="<%- _e(_socialDescr) %>"> 119 <meta name="theme-color" content="<%- _e(safeAccent) %>"> 115 120 <meta name="robots" content="<%= _shouldIndex ? 'index,follow' : 'noindex,nofollow' %>"> 116 <% if (safeSite.author) { %><meta name="author" content="<% =_e(safeSite.author) %>"><% } %>117 <% if (_canonical) { %><link rel="canonical" href="<% =_e(_canonical) %>"><% } %>121 <% if (safeSite.author) { %><meta name="author" content="<%- _e(safeSite.author) %>"><% } %> 122 <% if (_canonical) { %><link rel="canonical" href="<%- _e(_canonical) %>"><% } %> 118 123 119 124 <!-- Search-engine verification --> 120 <% if (safeSite.google_verification) { %><meta name="google-site-verification" content="<% =_e(safeSite.google_verification) %>"><% } %>121 <% if (safeSite.bing_verification) { %><meta name="msvalidate.01" content="<% =_e(safeSite.bing_verification) %>"><% } %>122 <% if (safeSite.pinterest_verification) { %><meta name="p:domain_verify" content="<% =_e(safeSite.pinterest_verification) %>"><% } %>123 <% if (safeSite.yandex_verification) { %><meta name="yandex-verification" content="<% =_e(safeSite.yandex_verification) %>"><% } %>125 <% if (safeSite.google_verification) { %><meta name="google-site-verification" content="<%- _e(safeSite.google_verification) %>"><% } %> 126 <% if (safeSite.bing_verification) { %><meta name="msvalidate.01" content="<%- _e(safeSite.bing_verification) %>"><% } %> 127 <% if (safeSite.pinterest_verification) { %><meta name="p:domain_verify" content="<%- _e(safeSite.pinterest_verification) %>"><% } %> 128 <% if (safeSite.yandex_verification) { %><meta name="yandex-verification" content="<%- _e(safeSite.yandex_verification) %>"><% } %> 124 129 125 130 <!-- Feed autodiscovery --> 126 131 <% if (site) { %> 127 <link rel="alternate" type="application/rss+xml" title="<% = _e(_siteTitle) %> — RSS" href="<%=_e(safeUrlBase + '/feed.xml') %>">128 <link rel="alternate" type="application/atom+xml" title="<% = _e(_siteTitle) %> — Atom" href="<%=_e(safeUrlBase + '/atom.xml') %>">132 <link rel="alternate" type="application/rss+xml" title="<%- _e(_siteTitle) %> — RSS" href="<%- _e(safeUrlBase + '/feed.xml') %>"> 133 <link rel="alternate" type="application/atom+xml" title="<%- _e(_siteTitle) %> — Atom" href="<%- _e(safeUrlBase + '/atom.xml') %>"> 129 134 <% } %> 130 135 131 136 <!-- PWA --> 132 <link rel="manifest" href="<% =_e(safeUrlBase + '/manifest.webmanifest') %>">137 <link rel="manifest" href="<%- _e(safeUrlBase + '/manifest.webmanifest') %>"> 133 138 <meta name="mobile-web-app-capable" content="yes"> 134 139 <meta name="apple-mobile-web-app-capable" content="yes"> 135 140 <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> 136 <meta name="apple-mobile-web-app-title" content="<% =_e(_siteTitle.slice(0, 16)) %>">137 <link rel="apple-touch-icon" href="<% =_e(safeSite.profile_photo || '/favicon.ico') %>">141 <meta name="apple-mobile-web-app-title" content="<%- _e(_siteTitle.slice(0, 16)) %>"> 142 <link rel="apple-touch-icon" href="<%- _e(safeSite.profile_photo || '/favicon.ico') %>"> 138 143 <link rel="icon" type="image/svg+xml" href="/favicon.svg?v=sf"> 139 144 <link rel="alternate icon" href="/favicon.ico?v=sf"> … … 141 146 <!-- OpenGraph --> 142 147 <meta property="og:type" content="<%= _ogType %>"> 143 <meta property="og:title" content="<% =_e(_socialTitle) %>">144 <meta property="og:description" content="<% =_e(_socialDescr) %>">145 <meta property="og:site_name" content="<% =_e(_siteTitle) %>">146 <meta property="og:locale" content="<% =_e(ogLocale) %>">148 <meta property="og:title" content="<%- _e(_socialTitle) %>"> 149 <meta property="og:description" content="<%- _e(_socialDescr) %>"> 150 <meta property="og:site_name" content="<%- _e(_siteTitle) %>"> 151 <meta property="og:locale" content="<%- _e(ogLocale) %>"> 147 152 <% if (_socialImage) { %> 148 <meta property="og:image" content="<% =_e(_socialImage) %>">149 <meta property="og:image:alt" content="<% =_e(_socialTitle) %>">153 <meta property="og:image" content="<%- _e(_socialImage) %>"> 154 <meta property="og:image:alt" content="<%- _e(_socialTitle) %>"> 150 155 <% if (_ogGenerated) { %> 151 156 <meta property="og:image:width" content="1200"> … … 154 159 <% } %> 155 160 <% } %> 156 <% if (_canonical) { %><meta property="og:url" content="<% =_e(_canonical) %>"><% } %>161 <% if (_canonical) { %><meta property="og:url" content="<%- _e(_canonical) %>"><% } %> 157 162 <% 158 163 // Fediverse/social PLAYER card for posts with audio: instead of shipping the raw … … 167 172 %> 168 173 <% if (_postAudio) { %> 169 <meta property="og:video" content="<% =_e(_embedUrl) %>">170 <meta property="og:video:secure_url" content="<% =_e(_embedUrl) %>">174 <meta property="og:video" content="<%- _e(_embedUrl) %>"> 175 <meta property="og:video:secure_url" content="<%- _e(_embedUrl) %>"> 171 176 <meta property="og:video:type" content="text/html"> 172 177 <meta property="og:video:width" content="480"> … … 174 179 <% } %> 175 180 <% if (typeof post !== 'undefined' && post && post.published_at) { %> 176 <meta property="article:published_time" content="<% =_e(post.published_at) %>">177 <% if (post.author_username) { %><meta property="article:author" content="<% =_e(post.author_username) %>"><% } %>178 <% } %> 179 <% if (safeSite.facebook_app_id) { %><meta property="fb:app_id" content="<% =_e(safeSite.facebook_app_id) %>"><% } %>181 <meta property="article:published_time" content="<%- _e(post.published_at) %>"> 182 <% if (post.author_username) { %><meta property="article:author" content="<%- _e(post.author_username) %>"><% } %> 183 <% } %> 184 <% if (safeSite.facebook_app_id) { %><meta property="fb:app_id" content="<%- _e(safeSite.facebook_app_id) %>"><% } %> 180 185 181 186 <!-- Twitter Cards --> 182 187 <meta name="twitter:card" content="<%= _postAudio ? 'player' : (_socialImage ? 'summary_large_image' : 'summary') %>"> 183 188 <% if (_postAudio) { %> 184 <meta name="twitter:player" content="<% =_e(_embedUrl) %>">189 <meta name="twitter:player" content="<%- _e(_embedUrl) %>"> 185 190 <meta name="twitter:player:width" content="480"> 186 191 <meta name="twitter:player:height" content="480"> 187 192 <% } %> 188 <meta name="twitter:title" content="<% =_e(_socialTitle) %>">189 <meta name="twitter:description" content="<% =_e(_socialDescr) %>">190 <% if (_socialImage) { %><meta name="twitter:image" content="<% =_e(_socialImage) %>"><% } %>191 <% if (safeSite.twitter) { %><meta name="twitter:creator" content="<% = _e(safeSite.twitter) %>"><meta name="twitter:site" content="<%=_e(safeSite.twitter) %>"><% } %>193 <meta name="twitter:title" content="<%- _e(_socialTitle) %>"> 194 <meta name="twitter:description" content="<%- _e(_socialDescr) %>"> 195 <% if (_socialImage) { %><meta name="twitter:image" content="<%- _e(_socialImage) %>"><% } %> 196 <% if (safeSite.twitter) { %><meta name="twitter:creator" content="<%- _e(safeSite.twitter) %>"><meta name="twitter:site" content="<%- _e(safeSite.twitter) %>"><% } %> 192 197 193 198 <% if (_jsonLd) { %> … … 266 271 :root, 267 272 [data-palette] { 268 --accent: <% =_e(safeAccent) %>;269 --accent-soft: color-mix(in srgb, <% =_e(safeAccent) %> 80%, white);270 --accent-tint: color-mix(in srgb, <% =_e(safeAccent) %> 12%, transparent);273 --accent: <%- _e(safeAccent) %>; 274 --accent-soft: color-mix(in srgb, <%- _e(safeAccent) %> 80%, white); 275 --accent-tint: color-mix(in srgb, <%- _e(safeAccent) %> 12%, transparent); 271 276 } 272 277 </style> … … 323 328 </head> 324 329 325 <body class="<%= bodyClass || 'on-home' %> has-bottom-tab" data-feed-view="<% = _e(safeSite.feed_view_default || 'timeline') %>" data-grid-cols="3" data-site-base="<%=_e((typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '') %>">330 <body class="<%= bodyClass || 'on-home' %> has-bottom-tab" data-feed-view="<%- _e(safeSite.feed_view_default || 'timeline') %>" data-grid-cols="3" data-site-base="<%- _e((typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '') %>"> 326 331 327 332 <% if (typeof isViewer !== 'undefined' && isViewer) { %>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)