Skip to content
This repository has been archived by the owner on May 12, 2019. It is now read-only.

Commit

Permalink
Make Google Analytics and Disqus use variables from admin panel.
Browse files Browse the repository at this point in the history
  • Loading branch information
RReverser committed Aug 14, 2015
1 parent 4d9bfb3 commit 2aebfbe
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
22 changes: 13 additions & 9 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,25 +112,29 @@ As the screenshot, you need to use for the proxying the same port as your Ghost

### Google Analytics

Edit `partials/google-analytics.hbs` put your [Google Analytics](http://www.google.com/analytics) domain ID in the line 6 like:
Go to Ghost admin panel -> `Code Injection` -> `Blog Header` and add:

```
ga('create', 'UA-YOURIDHERE', 'auto');
```html
<script>
var ga_id = 'UA-YOUR_ID_HERE';
</script>
```

### Comments

Edit `partials/comments.hbs` and put your [Disqus](https://disqus.com) shorcut in the line 5 like:
Go to Ghost admin panel -> `Code Injection` -> `Blog Header` and add:

```
var disqus_shortname = 'myShorcut';
```html
<script>
var disqus_shortname = 'YOUR_DISQUS_SHORTCUT_HERE';
</script>
```

### Sidebar Name

Edit the file `partials/aside.hbs` and change the name to show modifying the `h1` header.
By default name is automatically taken from blog title, subtitle is set to author's name but hidden and description is obtained from the description of the blog.

The description is automatically obtained from the description of the blog.
To change this behavior, edit the file `partials/aside.hbs` and change the title to show modifying the `h1` header or subtitle modifying the `h3` header.

### Colors

Expand All @@ -142,7 +146,7 @@ Edit the file `partials/social.hbs`.

### Links

Edit the file `partials/links.hbs`
Go to Ghost admin panel -> `Navigation` and add/edit items.

### Favicon

Expand Down
5 changes: 1 addition & 4 deletions partials/comments.hbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<footer class="post comments">
<div id="disqus_thread"></div>
<script type="text/javascript">
// required: replace example with your forum shortname
var disqus_shortname = 'kikobeats';
/* * * 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';
dsq.src = '//' + window.disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
Expand Down
16 changes: 9 additions & 7 deletions partials/google-analytics.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-34372837-2', 'auto');
ga('require', 'linkid', 'linkid.js');
ga('send', 'pageview');
if (window.ga_id) {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', window.ga_id, 'auto');
ga('require', 'linkid', 'linkid.js');
ga('send', 'pageview');
}
</script>

0 comments on commit 2aebfbe

Please sign in to comment.