Changeset c974223 in Klonkt for src/views/pages
- Timestamp:
- 06/16/2026 07:28:52 AM (3 months ago)
- Branches:
- main
- Children:
- 1578f5d
- Parents:
- ec2e358
- File:
-
- 1 edited
-
src/views/pages/archive.ejs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/views/pages/archive.ejs
rec2e358 rc974223 1 <% 2 // Archive — chronological feed of all posts. 3 // 4 // Renders both a timeline view (year/month grouped link list) AND a grid 5 // view (flat tiles) — same toggle pattern as home.ejs. The view-switcher 6 // at the top lets the user pick. Body class is `on-archive`; the inline 7 // <style> below adds an `.on-archive` clause to the existing home-only 8 // feed toggle in style.css (cleaner than editing the global CSS). 9 // 10 // Flatten posts for grid mode: skip the year/month grouping (it doesn't 11 // translate well to a tile grid). Newest-first order is preserved by the 12 // route's SQL ORDER BY. 13 const _flatPosts = []; 14 Object.keys(grouped).sort((a, b) => b - a).forEach(function(y) { 15 Object.keys(grouped[y]).forEach(function(m) { 16 grouped[y][m].forEach(function(p) { _flatPosts.push(p); }); 17 }); 18 }); 19 %> 1 <%# Archief — altijd de chronologische jaar/maand-lijst. Het archief negeert 2 bewust de timeline/grid-keuze (geen grid-weergave): de view-switcher is hier 3 grijs en springt bij klik terug naar de feed. Zie de CSS in style.css. %> 20 4 21 <%# View switcher used to be rendered here; now lives in shell.ejs above 22 #pcms-main, visible on every non-admin page. %> 23 24 <!-- ========== TIMELINE (year/month grouped) ========== --> 5 <!-- ========== TIJDLIJN (jaar/maand gegroepeerd) ========== --> 25 6 <div class="container archive-page feed-timeline"> 26 7 <% var _archBase = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : ''; %> … … 61 42 </div> 62 43 63 <!-- ========== GRID (only visible when body[data-feed-view="grid"]) ========== -->64 <% if (_flatPosts.length > 0) { %>65 <section class="feed-grid container" aria-label="Grid-weergave">66 <div class="grid-tiles">67 <% _flatPosts.forEach(function(post) { %>68 <%- include('../partials/post-tile', { post: post }) %>69 <% }); %>70 </div>71 </section>72 <% } %>73 74 44 <style> 75 45 .archive-page { max-width: 700px; margin: 2rem auto; padding: 0 1rem; }
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)