Changeset 4d81de5 in Klonkt for src/routes/feed.js
- Timestamp:
- 08/08/2026 05:30:29 AM (5 weeks ago)
- Branches:
- main
- Children:
- cf5073b
- Parents:
- 34e63f0
- git-author:
- Robin <roboburr@…> (08/08/2026 05:28:46 AM)
- git-committer:
- Robin <roboburr@…> (08/08/2026 05:30:29 AM)
- File:
-
- 1 edited
-
src/routes/feed.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/feed.js
r34e63f0 r4d81de5 66 66 const tracks = siteOpenTracks(site.id); 67 67 const lastBuild = posts[0]?.published_at || new Date().toISOString(); 68 69 // De itunes-velden waar een podcast-app een kanaal aan herkent. Funkwhale 70 // bouwde onze kanaalpagina langs de RSS-kant op en liet de categorie leeg, 71 // want die leest hij hier -- niet uit `category` op de AP-actor. 72 // 73 // De categorie volgt DEZELFDE regel als daar: alleen 'Music' als er ook 74 // werkelijk publieke muziek is. Een blog zonder open track is naar buiten 75 // toe geen muziekkanaal, en gated muziek telt niet mee -- afwezig is 76 // afwezig, ook in een categorie. 77 const abs = (u) => !u ? null : (/^https?:/i.test(u) ? u : `${base}${u.startsWith('/') ? '' : '/'}${u}`); 78 const kanaalKunst = abs(site.profile_photo || site.og_image_default || null); 79 const kanaalTags = [ 80 ` <itunes:author>${escapeXml(site.author || site.title || '')}</itunes:author>`, 81 site.description || site.tagline 82 ? ` <itunes:summary>${escapeXml(site.description || site.tagline)}</itunes:summary>` : null, 83 kanaalKunst ? ` <itunes:image href="${escapeXml(kanaalKunst)}" />` : null, 84 tracks.length ? ' <itunes:category text="Music" />' : null, 85 ].filter(Boolean).join('\n'); 68 86 69 87 const wanneer = (d) => { const t = Date.parse(d); return Number.isNaN(t) ? 0 : t; }; … … 88 106 <description>${escapeXml(t.artist || '')}</description> 89 107 <enclosure url="${escapeXml(`${base}/audio/stream/${encodeURIComponent(fn)}`)}" length="${Number(t.size) || 0}" type="${escapeXml(t.mime_type || 'audio/mpeg')}" />${t.duration ? ` 90 <itunes:duration>${Math.round(t.duration)}</itunes:duration>` : ''} 108 <itunes:duration>${Math.round(t.duration)}</itunes:duration>` : ''}${t.artist ? ` 109 <itunes:author>${escapeXml(t.artist)}</itunes:author>` : ''}${abs(t.cover_url) ? ` 110 <itunes:image href="${escapeXml(abs(t.cover_url))}" />` : ''} 91 111 </item>` }; 92 112 }), … … 103 123 <lastBuildDate>${new Date(lastBuild).toUTCString()}</lastBuildDate> 104 124 <atom:link href="${escapeXml(base + '/feed.xml')}" rel="self" type="application/rss+xml" /> 125 ${kanaalTags} 105 126 ${items} 106 127 </channel>
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)