getnikola / nikola

A static website and blog generator
https://getnikola.com/
MIT License
2.62k stars 450 forks source link

enable/disable comments per post or story #278

Closed Svenito closed 11 years ago

Svenito commented 11 years ago

Any interest in adding the ability to enable/disable comments per post/story via

.. comments: true|false

defaulting to whatever setting is set in the conf.py if omitted from the post?

ralsina commented 11 years ago

You can do that from the page itself using the disqus moderation button. Would this be really more convenient?

Or you mean having the comment box not even appear?

Svenito commented 11 years ago

Yes, if the comments are disabled it would not show the disqus box at all.

Not sure if that's something anyone might prefer to just closing the thread

ralsina commented 11 years ago

Don't know either. I would just close the thread, but it could be implemented, it's not terribly hard, I am just a bit hesitant about adding yet more metadata into the posts.

Svenito commented 11 years ago

Valid point. It would be optional in any case.

I'll stick with closing threads for now.

./Sven

On 7 Feb 2013, at 18:25, Roberto Alsina notifications@github.com wrote:

Don't know either. I would just close the thread, but it could be implemented, it's not terribly hard, I am just a bit hesitant about adding yet more metadata into the posts.

— Reply to this email directly or view it on GitHub.

ralsina commented 11 years ago

Now that we have custom metadata fields, this could be done by adding something like this in the templates:

% if not post.nocomments:
[the disqus stuff]
%endif

And a ".. nocomments: True" in the post metadata.

So, I am closing as "possible but not supported in the default templates"

ralsina commented 11 years ago

This is easy to do now.

Svenito commented 11 years ago

thanks for the fix. Will try it out as soon as I can

ralsina commented 11 years ago

Fixed in master. Just add a ".. nocomments: True" in your post and that's it.