Skip to main content

We use the embeddable widget on our Docusaurus 2 documentation website.

However, the content of the widget does not change when navigating to other topics, probably because it is a single-page application (SPA).

Is there a way to make the widget reload the content after the page title has changed?

@JasperK as long as you can pinpoint when the widget needs to reload then you should be able to trigger it with javascript.

You can find all the info you need here:

I think the one you are after is: inSided.conversational.reload() 


Thanks for the tip!

I managed to reload the widget content after a document title change using a MutationObserver:

// Create an observer instance
var observer = new MutationObserver(function (mutations) {
// Reload inSided widget
inSided.conversational.reload()
});

// Start receiving notifications
observer.observe(
document.querySelector('title'),
{ characterData: true, childList: true }
);

 


@JasperK great nice job!


Reply