Skip to content

Commit

Permalink
Documentation updates
Browse files Browse the repository at this point in the history
* Documentation style updates
* Additional carbon ads integration
  • Loading branch information
pklauzinski committed Apr 10, 2018
1 parent 81e9c5a commit 0f69dda
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 11 deletions.
4 changes: 3 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

An example of infinite scrolling is your Facebook "News Feed" page. You may notice that when you scroll to the bottom of this page, new content will often load automatically, or you will be given a link to "Older Posts" which will load more content when clicked.

## Facebook Page
[Continue to Installation →](installation.md)

## jScroll Facebook Page

?> [Follow jScroll on Facebook](https://www.facebook.com/jScroll.Infinite.Scrolling) for version updates and other announcements.
1 change: 1 addition & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- [Home](/)
- [Installation](installation.md)
- [Usage](usage.md)
- [Configuration](configuration.md)
Expand Down
17 changes: 15 additions & 2 deletions docs/css/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
}
@media (min-height: 600px) {
.cover img {
max-width: 150px;
max-width: 200px;
}
}
#carbon {
#carbon, .markdown-section p.warn:first-child {
max-width: 400px;
}
#carbon {
margin: 1em auto;
padding: 1em;
background: rgba(0, 0, 0, 0.05);
Expand Down Expand Up @@ -49,4 +51,15 @@
font-size: 11px;
line-height: 1;
font-style: italic;
}
.sidebar h1 a {
display: block;
}
.sidebar h1 a img {
max-width:100px;
display: block;
margin: 0 auto;
}
.sidebar-nav {
border-top: 1px solid rgba(0,0,0,.07);
}
35 changes: 27 additions & 8 deletions docs/js/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,43 @@
repo: 'https://github.com/pklauzinski/jscroll',
executeScript: true,
search: 'auto',
coverpage: true,
//coverpage: true,
loadSidebar: true,
maxLevel: 4,
subMaxLevel: 2,
auto2top: true,
ga: 'UA-23834740-2',
plugins: [
function(hook) {
function(hook, vm) {
hook.ready(function() {
var carbon = document.getElementById('carbon'),
script = document.createElement(('script'));
var title = document.querySelector('.sidebar h1 a'),
logo = document.createElement('img');

script.id = '_carbonads_js';
script.async = true;
script.src = '//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=jscrollcom';
carbon.appendChild(script);
logo.src = 'img/jscroll.png';
title.insertBefore(logo, title.firstChild);
});
hook.doneEach(function() {
var p = document.createElement('p'),
content = document.querySelector('.markdown-section');

p.id = 'carbon-top';
p.className = 'warn';
content.insertBefore(p, content.firstChild);
adCarbon('carbon-top');
});
}
]
};

function adCarbon(id) {
var carbon = document.getElementById(id),
script = document.createElement(('script'));

if (carbon) {
script.id = '_carbonads_js';
script.async = true;
script.src = '//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=jscrollcom';
carbon.appendChild(script);
}
}
})();

0 comments on commit 0f69dda

Please sign in to comment.