Skip to content
This repository has been archived by the owner on Mar 4, 2019. It is now read-only.

B-Translator/discourse-embedded-comments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Discourse Embedded Comments Plugin

This plugin embedds a discourse topic inside a page as comments.

How to install the plugin on the Discourse server

There's already a template in the app.yml file for installing plugins due to the docker_manager plugin, so just add this plugin on the end!

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-spoiler-alert.git
          - https://github.com/B-Translator/discourse-embedded-comments

Now you have to rebuild the container for the changes to be applied:

./launcher rebuild app

References:

How to embed a discourse topic inside a page

Insert on the page code like this:

<div id="discourse-comments"></div>

<script src="lib/iframeResizer.min.js"></script>

<script type="text/javascript">

var discourseUrl = "http://discuss.btranslator.org/";

function showDiscourseTopic(topic) {
  var comments = document.getElementById('discourse-comments');
  var iframe = document.getElementById('discourse-embed-frame');
  if (iframe) { iframe.remove(); }
  iframe = document.createElement('iframe');
  iframe.src = discourseUrl + '/t/' + topic + '/';
  iframe.id = 'discourse-embed-frame';
  iframe.width = '100%';
  iframe.frameBorder = '0';
  iframe.scrolling = 'yes';
  comments.appendChild(iframe);
  iFrameResize({}, iframe);
};

showDiscourseTopic('topic-to-be-embedded');

</script>

About

Plugin for embedding discourse inside a page as seamless comments. (Moved to: https://gitlab.com/b-translator/discourse-embedded-comments)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages