Changeset cb01666 in Klonkt for src/views


Ignore:
Timestamp:
06/23/2026 02:54:36 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
9b851e7
Parents:
8f2f97c
Message:

feat: lite mode (KLONKT_AUDIO=off) — audio disabled, single codebase

Boot flag that skips the entire audio feature: no audio/playlist/download/
embed routes (no ffmpeg calls), no tracks loaded, own-audio shortcodes
(track/album/playlist) stripped, audio buttons in admin/profile
hidden. Hub and Circles keep working; external embeds (YouTube/SoundCloud/
Spotify) keep working too. Default = on (full version unchanged).
This lets Klonkt run as a lightweight blog/photo/EPK site on an environment
without ffmpeg.

Co-Authored-By: Claude <noreply@…>

Location:
src/views
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/admin-site-edit.ejs

    r8f2f97c rcb01666  
    159159        </select>
    160160      </label>
     161      <% if (typeof audioEnabled === 'undefined' || audioEnabled) { %>
    161162      <label class="cb">
    162163        <input type="checkbox" name="enable_audio_player" value="1" <%= site.enable_audio_player ? 'checked' : '' %>>
    163164        <span><%= t('asite.enable_audio') %></span>
    164165      </label>
     166      <% } %>
    165167    </fieldset>
    166168
  • src/views/pages/admin.ejs

    r8f2f97c rcb01666  
    1111      <a href="/admin/sites" class="btn"><%= t('admin.b_sites') %></a>
    1212      <a href="/admin/users" class="btn"><%= t('admin.b_users') %></a>
     13      <% if (typeof audioEnabled === 'undefined' || audioEnabled) { %>
    1314      <a href="/admin/audio" class="btn"><%= t('admin.b_audio') %></a>
    1415      <a href="/admin/playlists" class="btn"><%= t('admin.b_playlists') %></a>
     16      <% } %>
    1517      <a href="/admin/comments" class="btn"><%= t('admin.b_comments') %></a>
    1618      <% if (primarySite) { %><a href="/admin/seo" class="btn"><%= t('admin.b_seo') %></a><% } %>
     
    1820    <% } else { %>
    1921      <a href="/posts/new" class="btn"><%= t('admin.b_newpost') %></a>
     22      <% if (typeof audioEnabled === 'undefined' || audioEnabled) { %>
    2023      <a href="/admin/audio" class="btn"><%= t('admin.b_audio') %></a>
     24      <% } %>
    2125      <a href="/admin/comments" class="btn"><%= t('admin.b_comments') %></a>
    2226      <% if (primarySite) { %>
  • src/views/partials/profile-header.ejs

    r8f2f97c rcb01666  
    4141      <% } else if (typeof siteOwnerAvatar !== 'undefined' && siteOwnerAvatar) { %>
    4242        <img src="<%= siteOwnerAvatar %>" alt="">
    43       <% } else if (site.enable_audio_player) { %>
     43      <% } else if (site.enable_audio_player && (typeof audioEnabled === 'undefined' || audioEnabled)) { %>
    4444        <span class="profile-photo-fallback profile-photo-fallback--music" aria-hidden="true">
    4545          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
Note: See TracChangeset for help on using the changeset viewer.