mirror of
https://github.com/wassname/talk.git
synced 2026-09-11 12:51:33 +08:00
[CORL-181] Add docs for comment count integration (#2598)
* docs: add docs for comment count integration * docs: update count docs * chore: improve integration docs
This commit is contained in:
@@ -3,25 +3,27 @@ title: Integrating on your site
|
||||
permalink: /v5/integrating/cms/
|
||||
---
|
||||
|
||||
With Coral setup and running locally you can test embeding the comment stream with this sample embed script:
|
||||
With Coral setup and running you can embed the comment stream with this sample embed script:
|
||||
|
||||
```
|
||||
<div id="coral_thread"></div>
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
var talk = document.createElement('script'); talk.type = 'text/javascript'; talk.async = true;
|
||||
var url = '{{ CORAL_DOMAIN_NAME }}';
|
||||
talk.src = '//' + url + '/assets/js/embed.js';
|
||||
talk.onload = function() {
|
||||
Coral.createStreamEmbed({
|
||||
id: "coral_thread",
|
||||
autoRender: true,
|
||||
rootURL: '//' + url,
|
||||
});
|
||||
};
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(talk);
|
||||
})();
|
||||
</script>
|
||||
(function() {
|
||||
var d = document, s = d.createElement('script');
|
||||
var url = '{{ CORAL_DOMAIN_NAME }}';
|
||||
s.src = '//' + url + '/assets/js/embed.js';
|
||||
s.async = false;
|
||||
s.defer = true;
|
||||
s.onload = function() {
|
||||
Coral.createStreamEmbed({
|
||||
id: "coral_thread",
|
||||
autoRender: true,
|
||||
rootURL: '//' + url,
|
||||
});
|
||||
};
|
||||
(d.head || d.body).appendChild(s);
|
||||
})();
|
||||
</script>`;
|
||||
```
|
||||
|
||||
> **NOTE:** Replace the value of `{% raw %}{{ CORAL_DOMAIN_NAME }}{% endraw %}` with the location of your running instance of Coral.
|
||||
|
||||
Reference in New Issue
Block a user