Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to enable comments in page? #63

Closed
calfzhou opened this issue Nov 11, 2013 · 8 comments
Closed

Is it possible to enable comments in page? #63

calfzhou opened this issue Nov 11, 2013 · 8 comments

Comments

@calfzhou
Copy link
Contributor

My previous WordPress pages also allow user leave comments. So I'd like to add comments to pages.

@talha131
Copy link
Member

It's pretty easy to implement. Lets think about two use cases.

  1. User wants comments on Page
  2. User wants to keep Page clean from comments

Now for the user who wants comments, there can be two ways.

  1. Set a meta variable in Page metadata, like set_comments: true
  2. Use Pelican feature of assigning custom template

I personally prefer way 1, it means less code.

@calfzhou
Copy link
Contributor Author

I prefer way 1.

@talha131
Copy link
Member

Note to self

  • enable comments for page by default
  • if comments_intro is defined in a post/page but it is empty then don't show comments. It is to help user disable comments on page/post on per post basis.

talha131 added a commit that referenced this issue Nov 28, 2013
talha131 added a commit that referenced this issue Nov 28, 2013
@talha131
Copy link
Member

@calfzhou @tshepang

Page template has Disqus comment. I have also used Jinja Macro in the code which enables us to use Polymorphism. This means less code maintenance.

Please feel free to share your opinion about it. Let me know if you find any bug.

@calfzhou
Copy link
Contributor Author

Thank you @talha131 , my page comments came back!

@talha131
Copy link
Member

I originally wanted to have a way to disable comments on per article and per page basis. Then I decided not to until a user demands for it. I mean why implement a feature if no one is gonna use it 😄

@azzamsa
Copy link
Contributor

azzamsa commented Jan 2, 2019

if comments_intro is defined in a post/page but it is empty then don't show comments. It is to help user disable comments on page/post on per post basis.

@talha131 I tried it, and it didn't work. I can use comments: true in Octopress, by the way.

I am still curious. As far I know Elegant is pelican "theme" not "framework", but why such this thing, handled by a "theme" ?. I searched "disable comment in certain page pelican", didn't find any answer in SO, and link to here.

@azzamsa
Copy link
Contributor

azzamsa commented Jan 4, 2019

Luckily I have add that ability. (Add ability to enable comments per page)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants