Files
indiekit-blog/_data/funkwhaleActivity.js
svemagie 02f13db22c feat: convert Funkwhale/Last.fm to client-side Alpine.js
Replaces build-time Eleventy data fetches with live client-side fetches
so listening data is always current without requiring a blog rebuild.

- Add js/listening.js with three Alpine.data components:
  listeningWidget, funkwhalePage, listeningPage
- Replace _data/funkwhaleActivity.js and lastfmActivity.js with sync
  stubs (source: 'indiekit') — keeps slashes.njk links and widget
  guard working at build time
- Rewrite widgets/funkwhale.njk, funkwhale.njk, listening.njk as
  Alpine-driven templates with loading skeletons and error states
- Load listening.js globally in base.njk before Alpine core

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 08:23:05 +02:00

20 lines
543 B
JavaScript

/**
* Funkwhale Activity Data — build-time stub
*
* Data is now fetched client-side via Alpine.js (js/listening.js).
* This stub returns the minimal shape needed so Nunjucks templates
* (slashes.njk, widget guard) continue to render the listening sections,
* while the actual data is populated by the browser after page load.
*/
export default function () {
return {
source: "indiekit",
nowPlaying: null,
listenings: [],
favorites: [],
stats: null,
instanceUrl: process.env.FUNKWHALE_INSTANCE || "",
};
}