Events

Events emitted by the widget (planned).

Events

All events are dispatched on the <script> element (the same one you embed).

nanoblog:loaded

Emitted after an initial page load or after “Load more”.

script.addEventListener("nanoblog:loaded", (e) => {
  console.log(e.detail); // { page, count }
});

nanoblog:post-click

Emitted when a user clicks a post title link.

script.addEventListener("nanoblog:post-click", (e) => {
  console.log(e.detail); // { slug }
});

nanoblog:error

Emitted when the widget fails to fetch posts.

script.addEventListener("nanoblog:error", (e) => {
  console.error(e.detail); // { message }
});
Cookies

We use essential cookies to run the app. With your consent, we’ll also use analytics to improve Nanoblog.

Cookie policy