Changeset 43dbf9c in Klonkt for src/views/partials/post-tile.ejs


Ignore:
Timestamp:
06/16/2026 01:52:09 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
9f81a09
Parents:
aa7f548
Message:

Circles: /cirkel uses the home view (timeline + grid + switcher)

  • post-card/post-tile external-aware: post.external_url -> external link (target=_blank, no htmx) instead of local /slug. Additive; normal posts unchanged. post-card shows 'via <source>' when external.
  • circle.js maps remote_posts to the local post shape + bodyClass on-cirkel.
  • circle-feed.ejs: feed-timeline (.post-list) + feed-grid (.grid-tiles), same classes as home -> the view-switcher works. shell: on-cirkel = feed-page.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/partials/post-tile.ejs

    raa7f548 r43dbf9c  
    88const _typeLabel = (post.type && post.type !== 'post') ? post.type : '';
    99const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
    10 const _href = _base + '/' + post.slug;
     10const _external = post.external_url || null;
     11const _href = _external || (_base + '/' + post.slug);
     12const _ext = !!_external;
    1113%>
    1214<a class="grid-tile<%= _hasCover ? '' : ' grid-tile-gradient' %><%= _isPinned ? ' is-pinned' : '' %>"
    1315   href="<%= _href %>"
    1416   <% if (_hasCover) { %>style="background-image: url('<%= post.cover_image_url %>'); --tile-hue: <%= _tileHue %>;"<% } else { %>style="--tile-hue: <%= _tileHue %>;"<% } %>
    15    hx-get="<%= _href %>?partial=1"
    16    hx-target="#pcms-main"
    17    hx-swap="innerHTML"
    18    hx-push-url="<%= _href %>"
    19    hx-indicator="#pcms-loading">
     17   <% if (_ext) { %>target="_blank" rel="noopener"<% } else { %>hx-get="<%= _href %>?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="<%= _href %>" hx-indicator="#pcms-loading"<% } %>>
    2018
    2119  <% if (_typeLabel) { %>
Note: See TracChangeset for help on using the changeset viewer.