diff --git a/README.md b/README.md new file mode 100644 index 000000000..da74cb114 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# Ghostwriter + +A simple AJAX driven theme for [Ghost](http://github.com/tryghost/ghost/). + +## Copyright & License + +Copyright (C) 2013 Rory Gibson - Released under the MIT Lincense. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/assets/css/normalize.css b/assets/css/normalize.css new file mode 100644 index 000000000..6adf56e79 --- /dev/null +++ b/assets/css/normalize.css @@ -0,0 +1,396 @@ +/*! normalize.css v2.1.2 | MIT License | git.io/normalize */ + +/* ========================================================================== + HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined in IE 8/9. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} + +/** + * Correct `inline-block` display not defined in IE 8/9. + */ + +audio, +canvas, +video { + display: inline-block; +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address styling not present in IE 8/9. + */ + +[hidden] { + display: none; +} + +/* ========================================================================== + Base + ========================================================================== */ + +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-family: sans-serif; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/** + * Remove default margin. + */ + +body { + margin: 0; +} + +/* ========================================================================== + Links + ========================================================================== */ + +/** + * Address `outline` inconsistency between Chrome and other browsers. + */ + +a:focus { + outline: thin dotted; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* ========================================================================== + Typography + ========================================================================== */ + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari 5, and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/** + * Address styling not present in IE 8/9, Safari 5, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +/** + * Address styling not present in Safari 5 and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address differences between Firefox and other browsers. + */ + +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Address styling not present in IE 8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +/** + * Correct font family set oddly in Safari 5 and Chrome. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, serif; + font-size: 1em; +} + +/** + * Improve readability of pre-formatted text in all browsers. + */ + +pre { + white-space: pre-wrap; +} + +/** + * Set consistent quote types. + */ + +q { + quotes: "\201C" "\201D" "\2018" "\2019"; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* ========================================================================== + Embedded content + ========================================================================== */ + +/** + * Remove border when inside `a` element in IE 8/9. + */ + +img { + border: 0; +} + +/** + * Correct overflow displayed oddly in IE 9. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* ========================================================================== + Figures + ========================================================================== */ + +/** + * Address margin not present in IE 8/9 and Safari 5. + */ + +figure { + margin: 0; +} + +/* ========================================================================== + Forms + ========================================================================== */ + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ + +legend { + border: 0; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * 1. Correct font family not being inherited in all browsers. + * 2. Correct font size not being inherited in all browsers. + * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome. + */ + +button, +input, +select, +textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 2 */ + margin: 0; /* 3 */ +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +button, +input { + line-height: normal; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+. + * Correct `select` style inheritance in Firefox 4+ and Opera. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * 1. Address box sizing set to `content-box` in IE 8/9. + * 2. Remove excess padding in IE 8/9. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari 5 and Chrome + * on OS X. + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * 1. Remove default vertical scrollbar in IE 8/9. + * 2. Improve readability and alignment in all browsers. + */ + +textarea { + overflow: auto; /* 1 */ + vertical-align: top; /* 2 */ +} + +/* ========================================================================== + Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/assets/css/nprogress.css b/assets/css/nprogress.css new file mode 100644 index 000000000..8b218ef46 --- /dev/null +++ b/assets/css/nprogress.css @@ -0,0 +1,81 @@ +/* Make clicks pass-through */ +#nprogress { + pointer-events: none; + -webkit-pointer-events: none; +} + +#nprogress .bar { + background: #29d; + + position: fixed; + z-index: 100; + top: 0; + left: 0; + + width: 100%; + height: 2px; +} + +/* Fancy blur effect */ +#nprogress .peg { + display: block; + position: absolute; + right: 0px; + width: 100px; + height: 100%; + box-shadow: 0 0 10px #29d, 0 0 5px #29d; + opacity: 1.0; + + -webkit-transform: rotate(3deg) translate(0px, -4px); + -moz-transform: rotate(3deg) translate(0px, -4px); + -ms-transform: rotate(3deg) translate(0px, -4px); + -o-transform: rotate(3deg) translate(0px, -4px); + transform: rotate(3deg) translate(0px, -4px); +} + +/* Remove these to get rid of the spinner */ +#nprogress .spinner { + display: block; + position: fixed; + z-index: 100; + top: 15px; + right: 15px; +} + +#nprogress .spinner-icon { + width: 14px; + height: 14px; + + border: solid 2px transparent; + border-top-color: #29d; + border-left-color: #29d; + border-radius: 10px; + + -webkit-animation: nprogress-spinner 400ms linear infinite; + -moz-animation: nprogress-spinner 400ms linear infinite; + -ms-animation: nprogress-spinner 400ms linear infinite; + -o-animation: nprogress-spinner 400ms linear infinite; + animation: nprogress-spinner 400ms linear infinite; +} + +@-webkit-keyframes nprogress-spinner { + 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } + 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } +} +@-moz-keyframes nprogress-spinner { + 0% { -moz-transform: rotate(0deg); transform: rotate(0deg); } + 100% { -moz-transform: rotate(360deg); transform: rotate(360deg); } +} +@-o-keyframes nprogress-spinner { + 0% { -o-transform: rotate(0deg); transform: rotate(0deg); } + 100% { -o-transform: rotate(360deg); transform: rotate(360deg); } +} +@-ms-keyframes nprogress-spinner { + 0% { -ms-transform: rotate(0deg); transform: rotate(0deg); } + 100% { -ms-transform: rotate(360deg); transform: rotate(360deg); } +} +@keyframes nprogress-spinner { + 0% { transform: rotate(0deg); transform: rotate(0deg); } + 100% { transform: rotate(360deg); transform: rotate(360deg); } +} + diff --git a/assets/css/style.css b/assets/css/style.css new file mode 100644 index 000000000..b1cce1095 --- /dev/null +++ b/assets/css/style.css @@ -0,0 +1,349 @@ + +/* ============================================================ */ +/* Base */ +/* ============================================================ */ + +body { + background: #FEFEFE; + color: #424242; + font-family: "Open Sans", arial, sans-serif; + font-size: 18px; +} + +h1, h2, h3, h4, h5, h6 { + margin-bottom: 33px; + text-transform: none; +} + +h1 { font-size: 26px; } +h2 { font-size: 24px; } +h3 { font-size: 20px; margin-bottom: 20px; } +h4 { font-size: 18px; margin-bottom: 18px; } +h5 { font-size: 16px; margin-bottom: 15px; } +h6 { font-size: 14px; margin-bottom: 12px; } + +p { + line-height: 1.8; + margin: 0 0 30px; +} + +a { + color: #F03838; + text-decoration: none; +} + +ul, ol { + list-style-position: inside; + line-height: 1.8; + margin: 0 0 40px; + padding: 0; +} + +ul li, ol li { margin: 0 0 10px; } + +blockquote { + border-left: 1px dotted #303030; + margin: 40px 0; + padding: 5px 30px; +} + +blockquote p { + color: #AEADAD; + display: block; + font-style: italic; + margin: 0; + width: 100%; +} + +img { + display: block; + margin: 40px 0; + max-width: 809px; +} + +pre { + background: #F1F0EA; + border: 1px solid #DDDBCC; + border-radius: 3px; + padding: 15px 20px; +} + +::selection { + background: #FFF5B8; + color: #000; + display: block; +} + +::-moz-selection { + background: #FFF5B8; + color: #000; + display: block; +} + +/* ============================================================ */ +/* General Appearance */ +/* ============================================================ */ + +.container { + margin: 0 auto; + position: relative; + width: 100%; + max-width: 889px; +} + +.button { + background: #303030; + border: none; + border-radius: 3px; + color: #FEFEFE; + font-size: 14px; + font-weight: 700; + padding: 10px 12px; + text-transform: uppercase; +} + +.button:hover { background: #F03838; } + +.button-square { + background: #F03838; + float: left; + padding: 8px; +} + +.button-square:hover { background: #303030; } + +/* ============================================================ */ +/* Site Header */ +/* ============================================================ */ + +.site-header { + margin: 100px 0 35px; + overflow: auto; + text-align: center; + text-transform: uppercase; +} + +.site-title-wrapper { + display: table; + margin: 0 auto; +} + +.site-title { + float: left; + font-size: 14px; + font-weight: 600; + margin: 0 10px 0 0; + text-transform: uppercase; +} + +.site-title a { + float: left; + background: #F03838; + color: #FEFEFE; + padding: 5px 10px 6px; +} + +.site-title a:hover { background: #303030; } + +/* ============================================================ */ +/* Post */ +/* ============================================================ */ + +#latest-post { display: none; } + +.post { margin: 0 40px; } + +.post-header { + border-bottom: 6px solid #303030; + margin: 0 0 50px; + padding: 0 0 80px; + text-align: center; + text-transform: uppercase; +} + +.post-title { + font-size: 52px; + font-weight: 700; + margin: 15px 0; + text-transform: uppercase; +} + +.post-date { + color: #AEADAD; + font-size: 14px; + font-weight: 600; + line-height: 1; + margin: 25px 0 0; +} + +.post-date:after { + border-bottom: 1px dotted #303030; + content: ""; + display: block; + margin: 40px auto 0; + width: 100px; +} + +.post-content { margin: 0 0 92px; } + +.post-content a:hover { + border-bottom: 1px dotted #F03838; + padding: 0 0 2px; +} + +.post-navigation { + display: table; + margin: 70px auto 100px; +} + +.newer-posts, +.older-posts { + float: left; + background: #F03838; + color: #FEFEFE; + font-size: 14px; + font-weight: 600; + margin: 0 5px; + padding: 5px 10px 6px; + text-transform: uppercase; +} + +.newer-posts:hover, +.older-posts:hover { + background: #303030; +} + +.page-number { display: none; } + +/* ============================================================ */ +/* Post Index */ +/* ============================================================ */ + +.post-list { + border-top: 6px solid #303030; + list-style: none; + margin: 80px 40px 0; + padding: 35px 0 0; +} + +.post-stub { + border-bottom: 1px dotted #303030; + margin: 0; +} + +.post-stub:first-child { padding-top: 0; } + +.post-stub a { + -webkit-transition: all 0.2s ease-in-out; + -moz-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + display: block; + color: #424242; + padding: 20px 5px; +} + +.post-stub a:hover { + background: #FCF5F5; + color: #F03838; + padding: 20px 12px; +} + +.post-stub-title { + display: inline-block; + margin: 0; + text-transform: none; +} + +.post-stub-date { display: inline-block; } + +.post-stub-date:before { content: "/ "; } + +.next-posts-link a, +.previous-posts-link a { + display: block; + padding: 8px 11px; +} + +/* ============================================================ */ +/* Icons */ +/* ============================================================ */ + +.icon { + background: url(../images/sprite.png); + display: block; +} + +.icon-menu { + background-position: 0 0; + height: 14px; + width: 14px; +} + +.icon-up { + background-position: 0 -15px; + height: 8px; + width: 14px; +} + +/* ============================================================ */ +/* Footer */ +/* ============================================================ */ + +.footer { + background: #303030; + color: #D3D3D3; + padding: 80px 0 95px; +} + +.footer .site-title-wrapper { margin-bottom: 35px; } + +.footer .site-title a:hover, +.footer .button-square:hover { + background: #121212; +} + +.button-jump-top { + padding-top: 11px; + padding-bottom: 11px; +} + +.footer-copyright { + color: #656565; + font-size: 14px; + margin: 0; + text-align: center; + text-transform: uppercase; +} + +.footer-copyright a { + color: #656565; + font-weight: 700; +} + +.footer-copyright a:hover { color: #FEFEFE; } + +/* ============================================================ */ +/* NProgress */ +/* ============================================================ */ + +#nprogress .bar { background: #F03838; } + +#nprogress .peg { box-shadow: 0 0 10px #F03838, 0 0 5px #F03838; } + +#nprogress .spinner-icon { + border-top-color: #F03838; + border-left-color: #F03838; +} + +/* ============================================================ */ +/* Media Queries */ +/* ============================================================ */ + +@media only screen and (max-width: 600px) { + .post-stub-title { display: block; } + + .post-stub-date:before { + content: ""; + display: block; + } +} \ No newline at end of file diff --git a/assets/images/sprite.png b/assets/images/sprite.png new file mode 100644 index 000000000..1258d0d2e Binary files /dev/null and b/assets/images/sprite.png differ diff --git a/assets/js/jquery.history.js b/assets/js/jquery.history.js new file mode 100644 index 000000000..20f8c9e08 --- /dev/null +++ b/assets/js/jquery.history.js @@ -0,0 +1 @@ +typeof JSON!="object"&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n")&&n[0]);return e>4?e:!1}();return e},h.isInternetExplorer=function(){var e=h.isInternetExplorer.cached=typeof h.isInternetExplorer.cached!="undefined"?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return e},h.options.html4Mode?h.emulated={pushState:!0,hashChange:!0}:h.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent)),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in r)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},h.cloneObject=function(e){var t,n;return e?(t=l.stringify(e),n=l.parse(t)):n={},n},h.getRootUrl=function(){var e=r.location.protocol+"//"+(r.location.hostname||r.location.host);if(r.location.port||!1)e+=":"+r.location.port;return e+="/",e},h.getBaseHref=function(){var e=r.getElementsByTagName("base"),t=null,n="";return e.length===1&&(t=e[0],n=t.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},h.getBaseUrl=function(){var e=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return e},h.getPageUrl=function(){var e=h.getState(!1,!1),t=(e||{}).url||h.getLocationHref(),n;return n=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,n){return/\./.test(e)?e:e+"/"}),n},h.getBasePageUrl=function(){var e=h.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,n){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},h.getFullUrl=function(e,t){var n=e,r=e.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(e)||(r==="/"?n=h.getRootUrl()+e.replace(/^\/+/,""):r==="#"?n=h.getPageUrl().replace(/#.*/,"")+e:r==="?"?n=h.getPageUrl().replace(/[\?#].*/,"")+e:t?n=h.getBaseUrl()+e.replace(/^(\.\/)+/,""):n=h.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),n.replace(/\#$/,"")},h.getShortUrl=function(e){var t=e,n=h.getBaseUrl(),r=h.getRootUrl();return h.emulated.pushState&&(t=t.replace(n,"")),t=t.replace(r,"/"),h.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},h.getLocationHref=function(e){return e=e||r,e.URL===e.location.href?e.location.href:e.location.href===decodeURIComponent(e.URL)?e.URL:e.location.hash&&decodeURIComponent(e.location.href.replace(/^[^#]+/,""))===e.location.hash?e.location.href:e.URL.indexOf("#")==-1&&e.location.href.indexOf("#")!=-1?e.location.href:e.URL||e.location.href},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(e,t){typeof e=="undefined"&&(e=!0),typeof t=="undefined"&&(t=!0);var n=h.getLastSavedState();return!n&&t&&(n=h.createStateObject()),e&&(n=h.cloneObject(n),n.url=n.cleanUrl||n.url),n},h.getIdByState=function(e){var t=h.extractId(e.url),n;if(!t){n=h.getStateString(e);if(typeof h.stateToId[n]!="undefined")t=h.stateToId[n];else if(typeof h.store.stateToId[n]!="undefined")t=h.store.stateToId[n];else{for(;;){t=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof h.idToState[t]=="undefined"&&typeof h.store.idToState[t]=="undefined")break}h.stateToId[n]=t,h.idToState[t]=e}}return t},h.normalizeState=function(e){var t,n;if(!e||typeof e!="object")e={};if(typeof e.normalized!="undefined")return e;if(!e.data||typeof e.data!="object")e.data={};return t={},t.normalized=!0,t.title=e.title||"",t.url=h.getFullUrl(e.url?e.url:h.getLocationHref()),t.hash=h.getShortUrl(t.url),t.data=h.cloneObject(e.data),t.id=h.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,n=!h.isEmptyObject(t.data),(t.title||n)&&h.options.disableSuid!==!0&&(t.hash=h.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=h.getFullUrl(t.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t},h.createStateObject=function(e,t,n){var r={data:e,title:t,url:n};return r=h.normalizeState(r),r},h.getStateById=function(e){e=String(e);var n=h.idToState[e]||h.store.idToState[e]||t;return n},h.getStateString=function(e){var t,n,r;return t=h.normalizeState(e),n={data:t.data,title:e.title,url:e.url},r=l.stringify(n),r},h.getStateId=function(e){var t,n;return t=h.normalizeState(e),n=t.id,n},h.getHashByState=function(e){var t,n;return t=h.normalizeState(e),n=t.hash,n},h.extractId=function(e){var t,n,r,i;return e.indexOf("#")!=-1?i=e.split("#")[0]:i=e,n=/(.*)\&_suid=([0-9]+)$/.exec(i),r=n?n[1]||e:e,t=n?String(n[2]||""):"",t||!1},h.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},h.extractState=function(e,t){var n=null,r,i;return t=t||!1,r=h.extractId(e),r&&(n=h.getStateById(r)),n||(i=h.getFullUrl(e),r=h.getIdByUrl(i)||!1,r&&(n=h.getStateById(r)),!n&&t&&!h.isTraditionalAnchor(e)&&(n=h.createStateObject(null,null,i))),n},h.getIdByUrl=function(e){var n=h.urlToId[e]||h.store.urlToId[e]||t;return n},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||t},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||t},h.hasUrlDuplicate=function(e){var t=!1,n;return n=h.extractState(e.url),t=n&&n.id!==e.id,t},h.storeState=function(e){return h.urlToId[e.url]=e.id,h.storedStates.push(h.cloneObject(e)),e},h.isLastSavedState=function(e){var t=!1,n,r,i;return h.savedStates.length&&(n=e.id,r=h.getLastSavedState(),i=r.id,t=n===i),t},h.saveState=function(e){return h.isLastSavedState(e)?!1:(h.savedStates.push(h.cloneObject(e)),!0)},h.getStateByIndex=function(e){var t=null;return typeof e=="undefined"?t=h.savedStates[h.savedStates.length-1]:e<0?t=h.savedStates[h.savedStates.length+e]:t=h.savedStates[e],t},h.getCurrentIndex=function(){var e=null;return h.savedStates.length<1?e=0:e=h.savedStates.length-1,e},h.getHash=function(e){var t=h.getLocationHref(e),n;return n=h.getHashByUrl(t),n},h.unescapeHash=function(e){var t=h.normalizeHash(e);return t=decodeURIComponent(t),t},h.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},h.setHash=function(e,t){var n,i;return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:t}),!1):(h.busy(!0),n=h.extractState(e,!0),n&&!h.emulated.pushState?h.pushState(n.data,n.title,n.url,!1):h.getHash()!==e&&(h.bugs.setHash?(i=h.getPageUrl(),h.pushState(null,null,i+"#"+e,!1)):r.location.hash=e),h)},h.escapeHash=function(t){var n=h.normalizeHash(t);return n=e.encodeURIComponent(n),h.bugs.hashEscape||(n=n.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),n},h.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=h.unescapeHash(t),t},h.setTitle=function(e){var t=e.title,n;t||(n=h.getStateByIndex(0),n&&n.url===e.url&&(t=n.title||h.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","<").replace(">",">").replace(" & "," & ")}catch(i){}return r.title=t,h},h.queues=[],h.busy=function(e){typeof e!="undefined"?h.busy.flag=e:typeof h.busy.flag=="undefined"&&(h.busy.flag=!1);if(!h.busy.flag){u(h.busy.timeout);var t=function(){var e,n,r;if(h.busy.flag)return;for(e=h.queues.length-1;e>=0;--e){n=h.queues[e];if(n.length===0)continue;r=n.shift(),h.fireQueueItem(r),h.busy.timeout=o(t,h.options.busyDelay)}};h.busy.timeout=o(t,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(e){return e.callback.apply(e.scope||h,e.args||[])},h.pushQueue=function(e){return h.queues[e.queue||0]=h.queues[e.queue||0]||[],h.queues[e.queue||0].push(e),h},h.queue=function(e,t){return typeof e=="function"&&(e={callback:e}),typeof t!="undefined"&&(e.queue=t),h.busy()?h.pushQueue(e):h.fireQueueItem(e),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(u(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(e){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=o(function(){return h.doubleCheckClear(),h.stateChanged||e(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var t=h.extractState(h.getLocationHref()),n;if(!h.isLastSavedState(t))return n=t,n||(n=h.createStateObject()),h.Adapter.trigger(e,"popstate"),h;return},h.back=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(e,t){var n;if(e>0)for(n=1;n<=e;++n)h.forward(t);else{if(!(e<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(n=-1;n>=e;--n)h.back(t)}return h};if(h.emulated.pushState){var v=function(){};h.pushState=h.pushState||v,h.replaceState=h.replaceState||v}else h.onPopState=function(t,n){var r=!1,i=!1,s,o;return h.doubleCheckComplete(),s=h.getHash(),s?(o=h.extractState(s||h.getLocationHref(),!0),o?h.replaceState(o.data,o.title,o.url,!1):(h.Adapter.trigger(e,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(r=h.Adapter.extractEventData("state",t,n)||!1,r?i=h.getStateById(r):h.expectedStateId?i=h.getStateById(h.expectedStateId):i=h.extractState(h.getLocationHref()),i||(i=h.createStateObject(null,null,h.getLocationHref())),h.expectedStateId=!1,h.isLastSavedState(i)?(h.busy(!1),!1):(h.storeState(i),h.saveState(i),h.setTitle(i),h.Adapter.trigger(e,"statechange"),h.busy(!1),!0))},h.Adapter.bind(e,"popstate",h.onPopState),h.pushState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.pushState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0},h.replaceState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.replaceState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0};if(s){try{h.store=l.parse(s.getItem("History.store"))||{}}catch(m){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(e,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(h.getLocationHref(),!0))),s&&(h.onUnload=function(){var e,t,n;try{e=l.parse(s.getItem("History.store"))||{}}catch(r){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in h.idToState){if(!h.idToState.hasOwnProperty(t))continue;e.idToState[t]=h.idToState[t]}for(t in h.urlToId){if(!h.urlToId.hasOwnProperty(t))continue;e.urlToId[t]=h.urlToId[t]}for(t in h.stateToId){if(!h.stateToId.hasOwnProperty(t))continue;e.stateToId[t]=h.stateToId[t]}h.store=e,h.normalizeStore(),n=l.stringify(e);try{s.setItem("History.store",n)}catch(i){if(i.code!==DOMException.QUOTA_EXCEEDED_ERR)throw i;s.length&&(s.removeItem("History.store"),s.setItem("History.store",n))}},h.intervalList.push(a(h.onUnload,h.options.storeInterval)),h.Adapter.bind(e,"beforeunload",h.onUnload),h.Adapter.bind(e,"unload",h.onUnload));if(!h.emulated.pushState){h.bugs.safariPoll&&h.intervalList.push(a(h.safariStatePoll,h.options.safariPollInterval));if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla")h.Adapter.bind(e,"hashchange",function(){h.Adapter.trigger(e,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(e,"hashchange")})}},(!h.options||!h.options.delayInit)&&h.init()}(window) \ No newline at end of file diff --git a/assets/js/nprogress.js b/assets/js/nprogress.js new file mode 100644 index 000000000..f8f0d687c --- /dev/null +++ b/assets/js/nprogress.js @@ -0,0 +1,275 @@ +/*! NProgress (c) 2013, Rico Sta. Cruz + * http://ricostacruz.com/nprogress */ + +;(function(factory) { + + if (typeof module === 'function') { + module.exports = factory(this.jQuery || require('jquery')); + } else { + this.NProgress = factory(this.jQuery); + } + +})(function($) { + var NProgress = {}; + + NProgress.version = '0.1.2'; + + var Settings = NProgress.settings = { + minimum: 0.08, + easing: 'ease', + positionUsing: '', + speed: 200, + trickle: true, + trickleRate: 0.02, + trickleSpeed: 800, + showSpinner: true, + template: '
' + }; + + /** + * Updates configuration. + * + * NProgress.configure({ + * minimum: 0.1 + * }); + */ + NProgress.configure = function(options) { + $.extend(Settings, options); + return this; + }; + + /** + * Last number. + */ + + NProgress.status = null; + + /** + * Sets the progress bar status, where `n` is a number from `0.0` to `1.0`. + * + * NProgress.set(0.4); + * NProgress.set(1.0); + */ + + NProgress.set = function(n) { + var started = NProgress.isStarted(); + + n = clamp(n, Settings.minimum, 1); + NProgress.status = (n === 1 ? null : n); + + var $progress = NProgress.render(!started), + $bar = $progress.find('[role="bar"]'), + speed = Settings.speed, + ease = Settings.easing; + + $progress[0].offsetWidth; /* Repaint */ + + $progress.queue(function(next) { + // Set positionUsing if it hasn't already been set + if (Settings.positionUsing === '') Settings.positionUsing = NProgress.getPositioningCSS(); + + // Add transition + $bar.css(barPositionCSS(n, speed, ease)); + + if (n === 1) { + // Fade out + $progress.css({ transition: 'none', opacity: 1 }); + $progress[0].offsetWidth; /* Repaint */ + + setTimeout(function() { + $progress.css({ transition: 'all '+speed+'ms linear', opacity: 0 }); + setTimeout(function() { + NProgress.remove(); + next(); + }, speed); + }, speed); + } else { + setTimeout(next, speed); + } + }); + + return this; + }; + + NProgress.isStarted = function() { + return typeof NProgress.status === 'number'; + }; + + /** + * Shows the progress bar. + * This is the same as setting the status to 0%, except that it doesn't go backwards. + * + * NProgress.start(); + * + */ + NProgress.start = function() { + if (!NProgress.status) NProgress.set(0); + + var work = function() { + setTimeout(function() { + if (!NProgress.status) return; + NProgress.trickle(); + work(); + }, Settings.trickleSpeed); + }; + + if (Settings.trickle) work(); + + return this; + }; + + /** + * Hides the progress bar. + * This is the *sort of* the same as setting the status to 100%, with the + * difference being `done()` makes some placebo effect of some realistic motion. + * + * NProgress.done(); + * + * If `true` is passed, it will show the progress bar even if its hidden. + * + * NProgress.done(true); + */ + + NProgress.done = function(force) { + if (!force && !NProgress.status) return this; + + return NProgress.inc(0.3 + 0.5 * Math.random()).set(1); + }; + + /** + * Increments by a random amount. + */ + + NProgress.inc = function(amount) { + var n = NProgress.status; + + if (!n) { + return NProgress.start(); + } else { + if (typeof amount !== 'number') { + amount = (1 - n) * clamp(Math.random() * n, 0.1, 0.95); + } + + n = clamp(n + amount, 0, 0.994); + return NProgress.set(n); + } + }; + + NProgress.trickle = function() { + return NProgress.inc(Math.random() * Settings.trickleRate); + }; + + /** + * (Internal) renders the progress bar markup based on the `template` + * setting. + */ + + NProgress.render = function(fromStart) { + if (NProgress.isRendered()) return $("#nprogress"); + $('html').addClass('nprogress-busy'); + + var $el = $("
") + .html(Settings.template); + + var perc = fromStart ? '-100' : toBarPerc(NProgress.status || 0); + + $el.find('[role="bar"]').css({ + transition: 'all 0 linear', + transform: 'translate3d('+perc+'%,0,0)' + }); + + if (!Settings.showSpinner) + $el.find('[role="spinner"]').remove(); + + $el.appendTo(document.body); + + return $el; + }; + + /** + * Removes the element. Opposite of render(). + */ + + NProgress.remove = function() { + $('html').removeClass('nprogress-busy'); + $('#nprogress').remove(); + }; + + /** + * Checks if the progress bar is rendered. + */ + + NProgress.isRendered = function() { + return ($("#nprogress").length > 0); + }; + + /** + * Determine which positioning CSS rule to use. + */ + + NProgress.getPositioningCSS = function() { + // Sniff on document.body.style + var bodyStyle = document.body.style; + + // Sniff prefixes + var vendorPrefix = ('WebkitTransform' in bodyStyle) ? 'Webkit' : + ('MozTransform' in bodyStyle) ? 'Moz' : + ('msTransform' in bodyStyle) ? 'ms' : + ('OTransform' in bodyStyle) ? 'O' : ''; + + if (vendorPrefix + 'Perspective' in bodyStyle) { + // Modern browsers with 3D support, e.g. Webkit, IE10 + return 'translate3d'; + } else if (vendorPrefix + 'Transform' in bodyStyle) { + // Browsers without 3D support, e.g. IE9 + return 'translate'; + } else { + // Browsers without translate() support, e.g. IE7-8 + return 'margin'; + } + }; + + /** + * Helpers + */ + + function clamp(n, min, max) { + if (n < min) return min; + if (n > max) return max; + return n; + } + + /** + * (Internal) converts a percentage (`0..1`) to a bar translateX + * percentage (`-100%..0%`). + */ + + function toBarPerc(n) { + return (-1 + n) * 100; + } + + + /** + * (Internal) returns the correct CSS for changing the bar's + * position given an n percentage, and speed and ease from Settings + */ + + function barPositionCSS(n, speed, ease) { + var barCSS; + + if (Settings.positionUsing === 'translate3d') { + barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' }; + } else if (Settings.positionUsing === 'translate') { + barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' }; + } else { + barCSS = { 'margin-left': toBarPerc(n)+'%' }; + } + + barCSS.transition = 'all '+speed+'ms '+ease; + + return barCSS; + } + + return NProgress; +}); + diff --git a/assets/js/scripts.js b/assets/js/scripts.js new file mode 100644 index 000000000..44f07c271 --- /dev/null +++ b/assets/js/scripts.js @@ -0,0 +1,120 @@ +jQuery(function($) { + + /* ============================================================ */ + /* Scroll To Top */ + /* ============================================================ */ + + $('.js-jump-top').on('click', function(e) { + e.preventDefault(); + + $('body').animate({'scrollTop': 0}); + }); + + /* ============================================================ */ + /* Ajax Loading */ + /* ============================================================ */ + + var History = window.History; + var loading = false; + var showIndex = false; + var $ajaxContainer = $('#ajax-container'); + var $latestPost = $('#latest-post'); + var $postIndex = $('#post-index'); + + // Initially hide the index and show the latest post + $latestPost.show(); + $postIndex.hide(); + + // Show the index if the url has "page" in it (a simple + // way of checking if we're on a paginated page.) + if (window.location.pathname.indexOf('page') === 1) { + $latestPost.hide(); + $postIndex.show(); + } + + // Check if history is enabled for the browser + if ( ! History.enabled) { + return false; + } + + History.Adapter.bind(window, 'statechange', function() { + var State = History.getState(); + + // Get the requested url and replace the current content + // with the loaded content + $.get(State.url, function(result) { + var $html = $(result); + var $newContent = $('#ajax-container', $html); + + $('body').animate({'scrollTop': 0}, function() { + $ajaxContainer.fadeOut(500, function() { + $latestPost = $('#latest-post', $newContent); + $postIndex = $('#post-index', $newContent); + + if (showIndex === true) { + $latestPost.hide(); + } else { + $latestPost.show(); + $postIndex.hide(); + } + + $ajaxContainer.html($newContent); + $ajaxContainer.fadeIn(500); + + NProgress.done(); + + loading = false; + showIndex = false; + }); + }); + }); + }); + + $('body').on('click', '.js-ajax-link, .pagination a', function(e) { + e.preventDefault(); + + if (loading === false) { + var currentState = History.getState(); + var url = $(this).attr('href'); + var title = $(this).attr('title') || null; + + // If the requested url is not the current states url push + // the new state and make the ajax call. + if (url !== currentState.url.replace(/\/$/, "")) { + loading = true; + + // Check if we need to show the post index after we've + // loaded the new content + if ($(this).hasClass('js-show-index') || $(this).parent('.pagination').length > 0) { + showIndex = true; + } + + NProgress.start(); + + History.pushState({}, title, url); + } else { + // Swap in the latest post or post index as needed + if ($(this).hasClass('js-show-index')) { + $('body').animate({'scrollTop': 0}, function() { + NProgress.start(); + + $latestPost.fadeOut(300, function() { + $postIndex.fadeIn(300); + NProgress.done(); + }); + }); + } else { + $('body').animate({'scrollTop': 0}, function() { + NProgress.start(); + + $postIndex.fadeOut(300, function() { + $latestPost.fadeIn(300); + NProgress.done(); + }); + }); + } + } + } + }); + +}); \ No newline at end of file diff --git a/default.hbs b/default.hbs new file mode 100644 index 000000000..a7ecdd404 --- /dev/null +++ b/default.hbs @@ -0,0 +1,63 @@ + + + + {{! Document Settings }} + + + + {{! Page Meta }} + {{@blog.title}} + + + + + + + {{! Styles }} + + + + + + {{! Ghost outputs important style and meta data with this tag }} + {{ghost_head}} + + + + + +
+
+ {{{body}}} +
+
+ + + + {{! Ghost outputs important scripts and data with this tag }} + {{ghost_foot}} + + + + + + + \ No newline at end of file diff --git a/index.hbs b/index.hbs new file mode 100644 index 000000000..491a379ad --- /dev/null +++ b/index.hbs @@ -0,0 +1,33 @@ +{{!< default}} + +
+
+
+

{{posts.0.title}}

+ + +
+ +
+ {{{posts.0.content}}} +
+
+
+ +
+
    + {{#foreach posts}} +
  1. + +

    {{title}}

    + + +
    +
  2. + {{/foreach}} +
+ +
+ {{pagination}} +
+
\ No newline at end of file diff --git a/post.hbs b/post.hbs new file mode 100644 index 000000000..4a849b98c --- /dev/null +++ b/post.hbs @@ -0,0 +1,17 @@ +{{!< default}} + +
+ {{#post}} +
+
+

{{title}}

+ + +
+ +
+ {{{content}}} +
+
+ {{/post}} +
\ No newline at end of file