Changeset 4c9c60b in Klonkt for src/views/shell.ejs
- Timestamp:
- 06/25/2026 05:27:29 AM (3 months ago)
- Branches:
- main
- Children:
- ca25f360
- Parents:
- e951b7c
- File:
-
- 1 edited
-
src/views/shell.ejs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/views/shell.ejs
re951b7c r4c9c60b 153 153 <% } %> 154 154 <% if (_canonical) { %><meta property="og:url" content="<%= _e(_canonical) %>"><% } %> 155 <% 156 // Fediverse/social PLAYER card for posts with audio: instead of shipping the raw 157 // mp3, point at our embeddable player (/embed?post=slug) so Mastodon shows an 158 // inline player that streams via the gated /audio/stream (no downloadable file). 159 const _postAudio = !!(typeof post !== 'undefined' && post 160 && /\[\[(track|album|playlist):/i.test(post.content || post.content_html || '') 161 && typeof premiumUnlocked !== 'undefined' && premiumUnlocked); 162 const _embedUrl = _postAudio 163 ? ((typeof ogOrigin !== 'undefined' && ogOrigin ? ogOrigin : '') + safeUrlBase + '/embed?post=' + encodeURIComponent(post.slug)) 164 : ''; 165 %> 166 <% if (_postAudio) { %> 167 <meta property="og:video" content="<%= _e(_embedUrl) %>"> 168 <meta property="og:video:secure_url" content="<%= _e(_embedUrl) %>"> 169 <meta property="og:video:type" content="text/html"> 170 <meta property="og:video:width" content="480"> 171 <meta property="og:video:height" content="160"> 172 <% } %> 155 173 <% if (typeof post !== 'undefined' && post && post.published_at) { %> 156 174 <meta property="article:published_time" content="<%= _e(post.published_at) %>"> … … 160 178 161 179 <!-- Twitter Cards --> 162 <meta name="twitter:card" content="<%= _socialImage ? 'summary_large_image' : 'summary' %>"> 180 <meta name="twitter:card" content="<%= _postAudio ? 'player' : (_socialImage ? 'summary_large_image' : 'summary') %>"> 181 <% if (_postAudio) { %> 182 <meta name="twitter:player" content="<%= _e(_embedUrl) %>"> 183 <meta name="twitter:player:width" content="480"> 184 <meta name="twitter:player:height" content="160"> 185 <% } %> 163 186 <meta name="twitter:title" content="<%= _e(_socialTitle) %>"> 164 187 <meta name="twitter:description" content="<%= _e(_socialDescr) %>">
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)