SlideShare a Scribd company logo
1 of 11
Adding Disqus toGhost
After adding code high-lighting my next task is to add comments. For me there is only one
option, to use a comment hosting service, like Disqus. Which is used on numerous sites from
the Daily Telegraph to CNN and ABC News as well as 3.5 million other sites and blogs.
We gain many from using Discus like:
 Less Management
 Spamming Protection
 Social Logins
 No Database.
 Easy of migration to new platform/technology.
Which will goto reducing code and allow for greater scalability.
Registering for Disqus
The first step is to using Disqus is to sign up, this can be accomplished by a number of social
media logins like Facebook, twitter or google and alternatively via Email. Next we need
to register our website, this as simple as selecting a name and the category.
Updating Ghost
Disqus has installation guides that cover may multiple platforms. However for Ghost we will
need to select Universal Code
Which give use the following code, for us to drop on the blog entries.
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = 'csharpbrew';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type =
'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a
href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered
by Disqus.</a></noscript>
Firstly we can delete the comments then we need to add this code
between </article> and {{/posts}} int the post.hbs file, which can be found
here /content/themes/[your theme]/assets/CSS/ . I've chosen to add below
the <main> tag and also wrap it an aside <aside class="comments"> , click here for
more information on aside tag. This was done to ensure the content separation and is
especially useful for search engines.
It's important to understand that by changing the Casper theme we need to be careful with
future updates to ensure we don't lose these changes.
Restart Ghost
As i've made changes to a HandleBars file, *.hbs, i will also need to restart ghost. The
reason behind this is when starting up HandleBar are compiled into JavaScript. It is possible
to add a process to watch these files and recompile them when they've changes, however
this is beyond the scope of this article.
To restart blog you needed to login into the Azure portal, select the correct web app and the
click restart found on the bottom quick link bar.
Fixing the CSS
After restating ghost comments started working straight away, however there was an issue
with the comments streaking across the full width of the screen, which broke the design.
.
To fix this all i need to do was add some additional CSS to set the margin-leftand margin-
right properties to auto and target the disqus_thread id.
#disqus_thread {
background-color: #e8e8e8;
margin-left: auto;
margin-right: auto;
width: 80%;
max-width: 710px;
padding:20px;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
-o-border-radius: 8px;
-ms-border-radius: 8px;
-khtml-border-radius: 8px;
border-radius: 8px;
}
Not only did i fix the width issue, I also update the style to include a background color and
rounded corners. This was to make sure the comments could be visual distinguished from
main blog content.
Thanks to these simply CSS changes the comment section is now clearly separated.
Comment counts
Finial I decided to add a link to my comments at the top of the page with a count of comments.
The code to perform this is part of the installation instruction and just two requires two steps.
First you need to add the JavaScript code.
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = 'csharpbrew';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] ||
document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
Its possible to only use the content inside the function and just add this to the previous
JavaScript Block. Next we add a link to the disqus_thread anchor. This is best placed just
below the title in the post-meta section.
<section class="post-meta">
<time class="post-date" datetime="{{date format='YYYY-MM-
DD'}}">{{date format="DD MMMM YYYY"}}</time> {{tags prefix=" on "}}
<a href="#disqus_thread"></a>
</section>
Finial Comment
While I did have an initial with styling, I found it was to add Disqus to my blog, however I will
need be careful in the future with updates.

More Related Content

What's hot

How to - Embed Content in a Widget on Netvibes
How to - Embed Content in a Widget on NetvibesHow to - Embed Content in a Widget on Netvibes
How to - Embed Content in a Widget on Netvibes
mmoore17
 
Jolly_Justo_How To Automate Your Internet Using IFTTT.PDF
Jolly_Justo_How To Automate Your Internet Using IFTTT.PDFJolly_Justo_How To Automate Your Internet Using IFTTT.PDF
Jolly_Justo_How To Automate Your Internet Using IFTTT.PDF
Jolly Justo
 
Click tale wordpress integration_instructions
Click tale wordpress integration_instructionsClick tale wordpress integration_instructions
Click tale wordpress integration_instructions
Carlos Molina Guerrero
 
Jolly_Justo_How To Use Buffer To Manage Your Social Media Accounts.PDF
Jolly_Justo_How To Use Buffer To Manage Your Social Media Accounts.PDFJolly_Justo_How To Use Buffer To Manage Your Social Media Accounts.PDF
Jolly_Justo_How To Use Buffer To Manage Your Social Media Accounts.PDF
Jolly Justo
 
Isocentre Help Links
Isocentre Help   LinksIsocentre Help   Links
Isocentre Help Links
isocentre
 
e107 to WordPress Migration Plugin: How It Works
e107 to WordPress Migration Plugin: How It Workse107 to WordPress Migration Plugin: How It Works
e107 to WordPress Migration Plugin: How It Works
CMS2CMS
 

What's hot (20)

Alcim wp training 26 may
Alcim wp training 26 mayAlcim wp training 26 may
Alcim wp training 26 may
 
Html Server Anchor Control VB
Html Server Anchor Control VBHtml Server Anchor Control VB
Html Server Anchor Control VB
 
Self Hosting 3
Self Hosting 3Self Hosting 3
Self Hosting 3
 
How to Migrate from Blogger.com to Joomla: Instruction
How to Migrate from Blogger.com to Joomla: InstructionHow to Migrate from Blogger.com to Joomla: Instruction
How to Migrate from Blogger.com to Joomla: Instruction
 
How to display the total number of comments in word press
How to display the total number of comments in word pressHow to display the total number of comments in word press
How to display the total number of comments in word press
 
How to download and install vTiger 6.x
How to download and install vTiger 6.xHow to download and install vTiger 6.x
How to download and install vTiger 6.x
 
Start a BLog: Module 3
Start a BLog: Module 3Start a BLog: Module 3
Start a BLog: Module 3
 
wpblazer review
wpblazer reviewwpblazer review
wpblazer review
 
How to - Embed Content in a Widget on Netvibes
How to - Embed Content in a Widget on NetvibesHow to - Embed Content in a Widget on Netvibes
How to - Embed Content in a Widget on Netvibes
 
Jolly_Justo_How To Automate Your Internet Using IFTTT.PDF
Jolly_Justo_How To Automate Your Internet Using IFTTT.PDFJolly_Justo_How To Automate Your Internet Using IFTTT.PDF
Jolly_Justo_How To Automate Your Internet Using IFTTT.PDF
 
Click tale wordpress integration_instructions
Click tale wordpress integration_instructionsClick tale wordpress integration_instructions
Click tale wordpress integration_instructions
 
Hubspot to wordpress migration
Hubspot to wordpress migrationHubspot to wordpress migration
Hubspot to wordpress migration
 
Blogs use CMS
Blogs use CMSBlogs use CMS
Blogs use CMS
 
How To Get Started After Installing Wordpress ( Wordcamp, Delhi )
How To Get Started After Installing Wordpress ( Wordcamp, Delhi )How To Get Started After Installing Wordpress ( Wordcamp, Delhi )
How To Get Started After Installing Wordpress ( Wordcamp, Delhi )
 
How to begin with Amazon EC2?
How to begin with Amazon EC2?How to begin with Amazon EC2?
How to begin with Amazon EC2?
 
The Connected Blog
The Connected BlogThe Connected Blog
The Connected Blog
 
Jolly_Justo_How To Use Buffer To Manage Your Social Media Accounts.PDF
Jolly_Justo_How To Use Buffer To Manage Your Social Media Accounts.PDFJolly_Justo_How To Use Buffer To Manage Your Social Media Accounts.PDF
Jolly_Justo_How To Use Buffer To Manage Your Social Media Accounts.PDF
 
Isocentre Help Links
Isocentre Help   LinksIsocentre Help   Links
Isocentre Help Links
 
How to embed an editable document in a twinspace page
How to embed an editable document in a  twinspace pageHow to embed an editable document in a  twinspace page
How to embed an editable document in a twinspace page
 
e107 to WordPress Migration Plugin: How It Works
e107 to WordPress Migration Plugin: How It Workse107 to WordPress Migration Plugin: How It Works
e107 to WordPress Migration Plugin: How It Works
 

Viewers also liked

Actuadores hidraulicos
Actuadores hidraulicos Actuadores hidraulicos
Actuadores hidraulicos
viktorzape
 
Administración de cuentas por cobrar2
Administración de cuentas por cobrar2Administración de cuentas por cobrar2
Administración de cuentas por cobrar2
enoc2050
 

Viewers also liked (20)

Mapas El Conocimiento
Mapas El ConocimientoMapas El Conocimiento
Mapas El Conocimiento
 
ERM - Certificate
ERM - CertificateERM - Certificate
ERM - Certificate
 
3. case study 1 ag
3. case study 1 ag3. case study 1 ag
3. case study 1 ag
 
Presentatie1
Presentatie1Presentatie1
Presentatie1
 
Actuadores hidraulicos
Actuadores hidraulicos Actuadores hidraulicos
Actuadores hidraulicos
 
Ccleaner
CcleanerCcleaner
Ccleaner
 
Prezi
PreziPrezi
Prezi
 
Historia tic paviattovalazza
Historia tic paviattovalazzaHistoria tic paviattovalazza
Historia tic paviattovalazza
 
Home Automation System
Home Automation SystemHome Automation System
Home Automation System
 
World of Watson 2016 - For your Boss - Panel discussions
World of Watson 2016 - For your Boss - Panel discussionsWorld of Watson 2016 - For your Boss - Panel discussions
World of Watson 2016 - For your Boss - Panel discussions
 
InfoZoom Tipps & Tricks – Teil 2 Reporterstellung mittels InfoZoom Anfragen
InfoZoom Tipps & Tricks – Teil 2 Reporterstellung mittels InfoZoom AnfragenInfoZoom Tipps & Tricks – Teil 2 Reporterstellung mittels InfoZoom Anfragen
InfoZoom Tipps & Tricks – Teil 2 Reporterstellung mittels InfoZoom Anfragen
 
The New Auto Insurance Ecosystem: Telematics, Mobility and the Connected Car
The New Auto Insurance Ecosystem: Telematics, Mobility and the Connected CarThe New Auto Insurance Ecosystem: Telematics, Mobility and the Connected Car
The New Auto Insurance Ecosystem: Telematics, Mobility and the Connected Car
 
Understanding Atrial Fibrillation
Understanding Atrial Fibrillation Understanding Atrial Fibrillation
Understanding Atrial Fibrillation
 
Presentación navidad
Presentación navidadPresentación navidad
Presentación navidad
 
Introduction to Realm Mobile Platform
Introduction to Realm Mobile PlatformIntroduction to Realm Mobile Platform
Introduction to Realm Mobile Platform
 
Chương 4 Lý thuyết hành vi của người sản xuất
Chương 4 Lý thuyết hành vi của người sản xuấtChương 4 Lý thuyết hành vi của người sản xuất
Chương 4 Lý thuyết hành vi của người sản xuất
 
Anatomía dental y oclusión / Práctica: Instrumentales y Materiales
Anatomía dental y oclusión / Práctica: Instrumentales y MaterialesAnatomía dental y oclusión / Práctica: Instrumentales y Materiales
Anatomía dental y oclusión / Práctica: Instrumentales y Materiales
 
Administración de cuentas por cobrar2
Administración de cuentas por cobrar2Administración de cuentas por cobrar2
Administración de cuentas por cobrar2
 
Historia dl computador
Historia dl computadorHistoria dl computador
Historia dl computador
 
Einladung+Rückantwort_SpotonRuhr.pdf
Einladung+Rückantwort_SpotonRuhr.pdfEinladung+Rückantwort_SpotonRuhr.pdf
Einladung+Rückantwort_SpotonRuhr.pdf
 

Similar to Adding disqus to ghost blog

Adding a view
Adding a viewAdding a view
Adding a view
Nhan Do
 

Similar to Adding disqus to ghost blog (20)

Code syntax highlighting in ghost
Code syntax highlighting in ghostCode syntax highlighting in ghost
Code syntax highlighting in ghost
 
BP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
BP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateBP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
BP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
 
Top 8 hidden handy features of word press
Top 8 hidden handy features of word pressTop 8 hidden handy features of word press
Top 8 hidden handy features of word press
 
Intro to CSS Presentation
Intro to CSS PresentationIntro to CSS Presentation
Intro to CSS Presentation
 
Philip Arthur Moore: Best Practices — On Breaking and Fixing WordPress Themes
Philip Arthur Moore: Best Practices — On Breaking and Fixing WordPress ThemesPhilip Arthur Moore: Best Practices — On Breaking and Fixing WordPress Themes
Philip Arthur Moore: Best Practices — On Breaking and Fixing WordPress Themes
 
ARTICULOENINGLES
ARTICULOENINGLESARTICULOENINGLES
ARTICULOENINGLES
 
How to Build ToDo App with Vue 3 + TypeScript
How to Build ToDo App with Vue 3 + TypeScriptHow to Build ToDo App with Vue 3 + TypeScript
How to Build ToDo App with Vue 3 + TypeScript
 
An Analysis Of Practical wordpress Programs
An Analysis Of Practical wordpress ProgramsAn Analysis Of Practical wordpress Programs
An Analysis Of Practical wordpress Programs
 
Fewd week7 slides
Fewd week7 slidesFewd week7 slides
Fewd week7 slides
 
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateBlog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
 
Introduction to-concrete-5
Introduction to-concrete-5Introduction to-concrete-5
Introduction to-concrete-5
 
Introduction to-concrete-5
Introduction to-concrete-5Introduction to-concrete-5
Introduction to-concrete-5
 
Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web
 
INTRODUCTIONS OF CSS
INTRODUCTIONS OF CSSINTRODUCTIONS OF CSS
INTRODUCTIONS OF CSS
 
Adding a view
Adding a viewAdding a view
Adding a view
 
Master page
Master pageMaster page
Master page
 
Adding Schema Markup (Structured Data) to WordPress – Free & Premium Plugins
Adding Schema Markup (Structured Data) to WordPress – Free & Premium PluginsAdding Schema Markup (Structured Data) to WordPress – Free & Premium Plugins
Adding Schema Markup (Structured Data) to WordPress – Free & Premium Plugins
 
TopicHero Descriptions Tutorial
TopicHero Descriptions TutorialTopicHero Descriptions Tutorial
TopicHero Descriptions Tutorial
 
SEO Audit Report | Analyze Website Free 2023
SEO Audit Report | Analyze Website Free 2023SEO Audit Report | Analyze Website Free 2023
SEO Audit Report | Analyze Website Free 2023
 
ViA Bootstrap 4
ViA Bootstrap 4ViA Bootstrap 4
ViA Bootstrap 4
 

More from Paul Graham (7)

Publising a nuget package
Publising a nuget packagePublising a nuget package
Publising a nuget package
 
EPiServer report generation
EPiServer report generationEPiServer report generation
EPiServer report generation
 
A guide to EPiServer CMS Scheduled Job
A guide to EPiServer CMS Scheduled JobA guide to EPiServer CMS Scheduled Job
A guide to EPiServer CMS Scheduled Job
 
Creating an nuget package for EPiServer
Creating an nuget package for EPiServerCreating an nuget package for EPiServer
Creating an nuget package for EPiServer
 
Creating EPiServer Usage Reports
Creating EPiServer Usage ReportsCreating EPiServer Usage Reports
Creating EPiServer Usage Reports
 
C# 6.0
C# 6.0C# 6.0
C# 6.0
 
Entity framework (EF) 7
Entity framework (EF) 7Entity framework (EF) 7
Entity framework (EF) 7
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

Adding disqus to ghost blog

  • 1. Adding Disqus toGhost After adding code high-lighting my next task is to add comments. For me there is only one option, to use a comment hosting service, like Disqus. Which is used on numerous sites from the Daily Telegraph to CNN and ABC News as well as 3.5 million other sites and blogs. We gain many from using Discus like:  Less Management  Spamming Protection  Social Logins  No Database.  Easy of migration to new platform/technology. Which will goto reducing code and allow for greater scalability.
  • 2. Registering for Disqus The first step is to using Disqus is to sign up, this can be accomplished by a number of social media logins like Facebook, twitter or google and alternatively via Email. Next we need to register our website, this as simple as selecting a name and the category.
  • 3. Updating Ghost Disqus has installation guides that cover may multiple platforms. However for Ghost we will need to select Universal Code
  • 4. Which give use the following code, for us to drop on the blog entries. <div id="disqus_thread"></div> <script type="text/javascript"> /* * * CONFIGURATION VARIABLES * * */ var disqus_shortname = 'csharpbrew'; /* * * DON'T EDIT BELOW THIS LINE * * */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
  • 5. Firstly we can delete the comments then we need to add this code between </article> and {{/posts}} int the post.hbs file, which can be found here /content/themes/[your theme]/assets/CSS/ . I've chosen to add below the <main> tag and also wrap it an aside <aside class="comments"> , click here for more information on aside tag. This was done to ensure the content separation and is especially useful for search engines. It's important to understand that by changing the Casper theme we need to be careful with future updates to ensure we don't lose these changes.
  • 6. Restart Ghost As i've made changes to a HandleBars file, *.hbs, i will also need to restart ghost. The reason behind this is when starting up HandleBar are compiled into JavaScript. It is possible to add a process to watch these files and recompile them when they've changes, however this is beyond the scope of this article. To restart blog you needed to login into the Azure portal, select the correct web app and the click restart found on the bottom quick link bar.
  • 7. Fixing the CSS After restating ghost comments started working straight away, however there was an issue with the comments streaking across the full width of the screen, which broke the design. . To fix this all i need to do was add some additional CSS to set the margin-leftand margin- right properties to auto and target the disqus_thread id.
  • 8. #disqus_thread { background-color: #e8e8e8; margin-left: auto; margin-right: auto; width: 80%; max-width: 710px; padding:20px; -moz-border-radius: 8px; -webkit-border-radius: 8px; -o-border-radius: 8px; -ms-border-radius: 8px; -khtml-border-radius: 8px; border-radius: 8px; } Not only did i fix the width issue, I also update the style to include a background color and rounded corners. This was to make sure the comments could be visual distinguished from main blog content.
  • 9. Thanks to these simply CSS changes the comment section is now clearly separated.
  • 10. Comment counts Finial I decided to add a link to my comments at the top of the page with a count of comments. The code to perform this is part of the installation instruction and just two requires two steps. First you need to add the JavaScript code. <script type="text/javascript"> /* * * CONFIGURATION VARIABLES * * */ var disqus_shortname = 'csharpbrew'; /* * * DON'T EDIT BELOW THIS LINE * * */ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); </script>
  • 11. Its possible to only use the content inside the function and just add this to the previous JavaScript Block. Next we add a link to the disqus_thread anchor. This is best placed just below the title in the post-meta section. <section class="post-meta"> <time class="post-date" datetime="{{date format='YYYY-MM- DD'}}">{{date format="DD MMMM YYYY"}}</time> {{tags prefix=" on "}} <a href="#disqus_thread"></a> </section> Finial Comment While I did have an initial with styling, I found it was to add Disqus to my blog, however I will need be careful in the future with updates.