Skip to content

Commit

Permalink
adding disqus demo
Browse files Browse the repository at this point in the history
  • Loading branch information
fellyph committed Feb 26, 2024
1 parent f01b1c7 commit 3b0f1f6
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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 3b0f1f6

Please sign in to comment.