Changeset 7963a6e in Klonkt for src/views/partials/post-tile.ejs


Ignore:
Timestamp:
06/14/2026 05:13:12 PM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
b94c08e
Parents:
0c2228a
Message:

fix: feed post links use siteUrlBase (clicking did not work in hub)

post-card + post-tile linked to '/<slug>' (absolute). In hub that falls back
to the main site -> 404 -> click did nothing. Now siteUrlBase + '/<slug>'
(and likewise for tag chips), so /user/<slug>/<post> in hub and '/<post>'
in solo.

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

File:
1 edited

Legend:

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

    r0c2228a r7963a6e  
    77const _hasCover = !!post.cover_image_url;
    88const _typeLabel = (post.type && post.type !== 'post') ? post.type : '';
     9const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
     10const _href = _base + '/' + post.slug;
    911%>
    1012<a class="grid-tile<%= _hasCover ? '' : ' grid-tile-gradient' %><%= _isPinned ? ' is-pinned' : '' %>"
    11    href="/<%= post.slug %>"
     13   href="<%= _href %>"
    1214   <% if (_hasCover) { %>style="background-image: url('<%= post.cover_image_url %>'); --tile-hue: <%= _tileHue %>;"<% } else { %>style="--tile-hue: <%= _tileHue %>;"<% } %>
    13    hx-get="/<%= post.slug %>?partial=1"
     15   hx-get="<%= _href %>?partial=1"
    1416   hx-target="#pcms-main"
    1517   hx-swap="innerHTML"
    16    hx-push-url="/<%= post.slug %>"
     18   hx-push-url="<%= _href %>"
    1719   hx-indicator="#pcms-loading">
    1820
Note: See TracChangeset for help on using the changeset viewer.