Skip to content

Disqus - preserve the thread when page is redirected

Marcia Ramos requested to merge disqus-preserve-thread-redirects into master

Closes https://gitlab.com/gitlab-com/gitlab-docs/issues/138

I'm using this method to preserve the comments thread when we redirect a page on the docs:

  1. Define Disqus' this.page.identifier as the page slug
  2. When there's a redirect, we use redirect_from in the new page frontmatter so Disqus will use the old URL as identifier

The old doc will have in its frontmatter (https://gitlab.com/gitlab-com/gitlab-docs/issues/144):

---
redirect_to: 'new/path.md'
---

And the redirect layout will not include the comments.

The new doc will have in its frontmatter:

---
redirect_from: 'old/path.hml'
---

So that Disqus will always identify the page from the redirect_from slug.

Page with redirect_from:

Screen_Shot_2017-12-01_at_13.09.14

Normal page:

Screen_Shot_2017-12-01_at_13.10.39

@axil is my logic right?

Refs:

Edited by Marcia Ramos

Merge request reports