Getting started
Install
npm install docusaurus-plugin-new-post-toast
Minimum config
// docusaurus.config.ts
export default {
plugins: ['docusaurus-plugin-new-post-toast'],
};
That's literally it — the plugin picks up the default blog instance and starts tracking lastVisit.
Verify
- Start the site with
npm start - Visit any page
- In DevTools → Application → Local Storage, you should see
docusaurus-new-post-toastwith a JSON value containinglastVisit - Manually set
lastVisitto a date in the past, reload, and you should see toasts for any posts published after that timestamp
Next
- Configuration — tune position, duration,
maxAgeDays - Multiple blogs — if you have more than one blog instance