From 0f69dda567948e174ae5cb28c325853ba2703ddf Mon Sep 17 00:00:00 2001 From: pklauzinski Date: Tue, 10 Apr 2018 14:06:32 -0500 Subject: [PATCH] Documentation updates * Documentation style updates * Additional carbon ads integration --- docs/README.md | 4 +++- docs/_sidebar.md | 1 + docs/css/docs.css | 17 +++++++++++++++-- docs/js/docs.js | 35 +++++++++++++++++++++++++++-------- 4 files changed, 46 insertions(+), 11 deletions(-) diff --git a/docs/README.md b/docs/README.md index 4a2028a..1d70fc8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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. \ No newline at end of file diff --git a/docs/_sidebar.md b/docs/_sidebar.md index eb020be..310d122 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -1,3 +1,4 @@ +- [Home](/) - [Installation](installation.md) - [Usage](usage.md) - [Configuration](configuration.md) diff --git a/docs/css/docs.css b/docs/css/docs.css index 22ef4b6..c07bde2 100644 --- a/docs/css/docs.css +++ b/docs/css/docs.css @@ -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); @@ -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); } \ No newline at end of file diff --git a/docs/js/docs.js b/docs/js/docs.js index 7b6598a..3bb4008 100644 --- a/docs/js/docs.js +++ b/docs/js/docs.js @@ -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); + } } })(); \ No newline at end of file