main
|
Last change
on this file since d549549 was 43dbf9c, checked in by roboburr <roboburr@…>, 3 months ago |
|
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@…>
|
-
Property mode
set to
100644
|
|
File size:
1.6 KB
|
| Rev | Line | |
|---|
| [7bc636b] | 1 | <%
|
|---|
| 2 | // Square Instagram-style tile for the .feed-grid view (v9 pattern).
|
|---|
| 3 | // - With cover → background-image, dark gradient overlay reveals title on hover/touch
|
|---|
| 4 | // - No cover → .grid-tile-gradient with the title centered (random hue per tile)
|
|---|
| 5 | const _tileHue = ((post.id || post.slug || '0').charCodeAt(0) * 7) % 360;
|
|---|
| 6 | const _isPinned = !!post.pinned;
|
|---|
| 7 | const _hasCover = !!post.cover_image_url;
|
|---|
| 8 | const _typeLabel = (post.type && post.type !== 'post') ? post.type : '';
|
|---|
| [7963a6e] | 9 | const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
|
|---|
| [43dbf9c] | 10 | const _external = post.external_url || null;
|
|---|
| 11 | const _href = _external || (_base + '/' + post.slug);
|
|---|
| 12 | const _ext = !!_external;
|
|---|
| [7bc636b] | 13 | %>
|
|---|
| 14 | <a class="grid-tile<%= _hasCover ? '' : ' grid-tile-gradient' %><%= _isPinned ? ' is-pinned' : '' %>"
|
|---|
| [7963a6e] | 15 | href="<%= _href %>"
|
|---|
| [7bc636b] | 16 | <% if (_hasCover) { %>style="background-image: url('<%= post.cover_image_url %>'); --tile-hue: <%= _tileHue %>;"<% } else { %>style="--tile-hue: <%= _tileHue %>;"<% } %>
|
|---|
| [43dbf9c] | 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"<% } %>>
|
|---|
| [7bc636b] | 18 |
|
|---|
| 19 | <% if (_typeLabel) { %>
|
|---|
| 20 | <span class="grid-tile-type"><%= _typeLabel %></span>
|
|---|
| 21 | <% } %>
|
|---|
| 22 | <% if (_isPinned) { %>
|
|---|
| 23 | <span class="grid-tile-pin">Pinned</span>
|
|---|
| 24 | <% } %>
|
|---|
| 25 |
|
|---|
| 26 | <% if (_hasCover) { %>
|
|---|
| 27 | <div class="grid-tile-overlay">
|
|---|
| 28 | <strong><%= post.title || '(untitled)' %></strong>
|
|---|
| 29 | </div>
|
|---|
| 30 | <% } else { %>
|
|---|
| 31 | <span class="grid-tile-title"><%= post.title || '(untitled)' %></span>
|
|---|
| 32 | <% } %>
|
|---|
| 33 | </a>
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.