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

Discourse comments #3689

Closed
Mte90 opened this issue May 22, 2023 · 4 comments
Closed

Discourse comments #3689

Mte90 opened this issue May 22, 2023 · 4 comments
Assignees

Comments

@Mte90
Copy link
Contributor

Mte90 commented May 22, 2023

There is a discourse plugin for jekyll https://github.com/oblakeerickson/jekyll_discourse_comments/blob/master/discourse_comments.rb as we can see just print a javascript code with the url of the discourse thread.
So a nikola plugin should have just a parameter in the article and the plugin installed.

@Kwpolska Kwpolska changed the title [plugin] Discourse comments Discourse comments May 23, 2023
@Kwpolska Kwpolska transferred this issue from getnikola/plugins May 23, 2023
@Kwpolska
Copy link
Member

(Moved from getnikola/plugins to getnikola/nikola, as comment systems cannot be plugins.)

@Mte90
Copy link
Contributor Author

Mte90 commented May 24, 2023

Note for myself to work on this:

My doubt is how to get in the template the new field that I have to add for the discourse thread link. The comment_link_script macro doesn't have the post object and the comment_form doesn't have the post object too.

@Kwpolska
Copy link
Member

Looking at the Jekyll plugin and at this Discourse forum thread, the discourseEmbedUrl is just the post URL, and the comment_form function gets the URL as a parameter. (comment_link_script is used on index pages, it is a script that shows the comment count in post headers — this is an optional feature.)

@Mte90
Copy link
Contributor Author

Mte90 commented May 26, 2023

You are right, a html snippet generate by the jekyll plugin:

<script type="text/javascript">
                            DiscourseEmbed = { discourseUrl: 'https://forum.linux.it/',
                            discourseEmbedUrl: 'https://www.ils.org/2023/05/10/mergeit-2023.html' };

                            (function() {
                                var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
                                d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
                                (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
                            })();
                        </script>

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

No branches or pull requests

2 participants