Skip to content

Commit

Permalink
Merge pull request #57 from rtCamp/feature/disqus-comment-box
Browse files Browse the repository at this point in the history
Adding disqus demo
  • Loading branch information
fellyph committed Mar 8, 2024
2 parents a851f03 + 3b0f1f6 commit e2d7a7d
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app.js
Expand Up @@ -72,7 +72,8 @@ const scenarios = [
'personalization-localstorage',
'gsi',
'social-media',
'social-media-comments'
'social-media-comments',
'disqus-comments',
];
scenarios.forEach(scenario => {
const scenarioRoutes = require(`./src/scenarios/${scenario}/routes`);
Expand Down
1 change: 1 addition & 0 deletions src/common/index.ejs
Expand Up @@ -20,6 +20,7 @@
<%= renderCard('Legacy GSI', '🔐', '/gsi') %>
<%= renderCard('Facebook Like', '👍', '/social-media') %>
<%= renderCard('Facebook Comments', '💬', '/social-media-comments') %>
<%= renderCard('Disqus Comments', '✉️', '/disqus-comments') %>
<%= renderCard('CHIPS', '🍪', '/chips') %>
<%= renderCard('Storage Access API', '🗃️', '/storage-access-api') %>
</div>
Expand Down
24 changes: 24 additions & 0 deletions src/scenarios/disqus-comments/index.ejs
@@ -0,0 +1,24 @@
<%- include(commonPath + '/header.ejs') %>

<%- include(commonPath + '/internal-page/header.ejs', {containerType: 'sm'}) %>
<div id="disqus_thread"></div>
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables */
/*
var disqus_config = function () {
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://psat-demo.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<%- include(commonPath + '/internal-page/footer.ejs') %>
<%- include(commonPath + '/footer.ejs') %>
13 changes: 13 additions & 0 deletions src/scenarios/disqus-comments/routes.js
@@ -0,0 +1,13 @@
const express = require('express');
const path = require('path');
const router = express.Router();

router.get('/', (req, res) => {
// Send the default page
const currentDomain = req.get('host');
res.render(path.join(__dirname,'index'), {
title: 'Disqus Comments'
});
});

module.exports = router;

0 comments on commit e2d7a7d

Please sign in to comment.