Since many themes were developed for years then their maintenance has stopped, so the plug-in google analytics & disqus code may invalidate. My theme overdose is a great example. I like its UI design but some parts of its code is obsolete. This post only shows how to modify the overdose theme, because for other themes the files are different. You have to find the correct files of your theme. Let’s assume the root directory is your theme directory.
Add Google Analytics
Modify the code in /layout/includes/head.pug, and find the snippet of code of google analytics, replace it to:
1 | if theme.google_analytics |
Then add your measurement id in _config.yml.
Add Disqus
Modify the code in /layout/includes/article.pug. The url should be different, you can find it on your disqus account. In my case, it is:
1 | if config.disqus_shortname |