Skip to content

Disqus - preserve the thread when a doc is redirected

Followup from https://gitlab.com/gitlab-com/gitlab-docs/merge_requests/151

We need to find a way to deal with redirects without losing the Disqus thread. There are a couple ways for this, but I think the best one is preserving the this.page.identifier (on the Disqus JS snippet) the same if we redirect a page.

I'm trying to create a conditional for: if there's a redirect, use the old page slug in this.page.identifier; else, this.page.identifier == page slug.

This guy tweaks the code for his PHP site, I guess we can do a similar thing to ours.

Another possible method:

  • Via CSV file (not recommended bc we have tons of URLs) and will need to update the CSV file every time we create a new redirect.

cc/ @axil

Edited by Marcia Ramos