plugin-disqus icon indicating copy to clipboard operation
plugin-disqus copied to clipboard

No way to disable disqus on given pages (disqus: false is not taking effect)

Open m0un10 opened this issue 8 years ago • 7 comments

As per the README.md it indicates that disqus can be disabled for a given page with this:

---
disqus: false
---

I've tried that and it doesn't seem to have any effect when I run gitbook serve. Even after doing a stop and only running gitbook serve after the change is saved to one or two .md files, it still has the comment on every single page including the pages with disqus: false.

The structure of my .md is like this:

---
disqus: false
---

# {{ page.title }}
 
Content is here 

My Gitbook version is:

CLI version: 2.3.0
GitBook version: 3.2.2

My installed plugins are:

├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└─┬ [email protected]
  ├─┬ [email protected]
  │ ├─┬ [email protected]
  │ │ ├── [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ ├── [email protected]
  │ │ │ ├── [email protected]
  │ │ │ ├── [email protected]
  │ │ │ ├── [email protected]
  │ │ │ ├── [email protected]
  │ │ │ └── [email protected]
  │ │ └── [email protected]
  │ ├─┬ [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ └── [email protected]
  │ │ ├── [email protected]
  │ │ └─┬ [email protected]
  │ │   ├─┬ [email protected]
  │ │   │ └── [email protected]
  │ │   └── [email protected]
  │ ├─┬ [email protected]
  │ │ └─┬ [email protected]
  │ │   └── [email protected]
  │ ├─┬ [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ └─┬ [email protected]
  │ │ │   ├── [email protected]
  │ │ │   └── [email protected]
  │ │ └─┬ [email protected]
  │ │   └─┬ [email protected]
  │ │     └── [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ ├── [email protected]
  │ │ └── [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected]
  │ ├─┬ [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ ├── [email protected]
  │ │ │ └── [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ └── [email protected]
  └─┬ [email protected]
    └── [email protected]

My book.json is

{
    "gitbook": "3.2.2",
    "plugins": [
        "hints",
        "simple-page-toc",
        "custom-favicon",
        "disqus"
    ],
    "pluginsConfig": {
        "theme-default": {
            "showLevel": false
        }, 
        "simple-page-toc": {
            "maxDepth": 7,
            "skipFirstH1": true
        },
        "favicon": "assets/favicon.ico",
        "disqus": {
            "shortName": "myst-studio-documentation"
        }
    }
}

Please help! 😄

m0un10 avatar Feb 17 '17 01:02 m0un10

Same issue here. Any updates?

joshmccall221 avatar Apr 22 '17 02:04 joshmccall221

I'm also having problems. It looks like you're installing gitbook-plugin-disqus version 0.1.0.

Latest released version is 1.0.1, but if I try enabling it with "plugins": ["[email protected]"],, I get Error: Found no satisfactory version for plugin "disqus" with requirement "1.0.1".

Whereas trying "plugins": ["[email protected]"] is fine.

1.0.1 cannot be satisfied because in 1.0.x, the engine required is:

  "engines": {
     "gitbook": ">=4.0.0-alpha"
  },

and default gitbook at the time is GitBook version: 3.2.2.

So master documentation of this project is not specific enough to indicate that it only works against an alpha version of gitbook engine.

If you wanted to customise anything, you'd need to look at the source code of version 0.1.0, which is here: https://github.com/GitbookIO/plugin-disqus/blob/0.1.0/book/plugin.js and README here. You'll notice there's nothing to enable/disable Disqus here, sadly enough.

The reason why I'm looking at this is so that I could only have Disqus enabled on one or two pages, rather than everywhere, for consolidation. Looks not possible to do right now, and even if I contribute a change it won't be visible until GitBook 4 is released.

@SamyPesse could advise?

ScalaWilliam avatar Apr 27 '17 23:04 ScalaWilliam

is there any updates in regard of this issue? I still experience the same

novalagung avatar Sep 24 '18 12:09 novalagung

is there any updates in regard of this issue? I still experience the same

freedom93 avatar Oct 22 '18 10:10 freedom93

I ended up by adding custom js script to forcefully hide the comment sections

novalagung avatar Oct 22 '18 20:10 novalagung

Just add <style> #disqus_thread { display: none } </style> on the pages where you want to disable disqus.

shivam-tripathi avatar May 04 '19 07:05 shivam-tripathi