jekyll 0.12.1 → 1.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of jekyll might be problematic. Click here for more details.

Files changed (124) hide show
  1. data/CONTRIBUTING.md +67 -0
  2. data/Gemfile +1 -1
  3. data/History.txt +50 -6
  4. data/README.textile +10 -6
  5. data/Rakefile +74 -36
  6. data/bin/jekyll +78 -276
  7. data/cucumber.yml +3 -1
  8. data/features/create_sites.feature +1 -1
  9. data/features/drafts.feature +25 -0
  10. data/features/site_configuration.feature +1 -1
  11. data/features/step_definitions/jekyll_steps.rb +13 -3
  12. data/features/support/env.rb +3 -1
  13. data/jekyll.gemspec +73 -17
  14. data/lib/jekyll.rb +31 -21
  15. data/lib/jekyll/command.rb +12 -0
  16. data/lib/jekyll/commands/build.rb +81 -0
  17. data/lib/jekyll/commands/serve.rb +28 -0
  18. data/lib/jekyll/converter.rb +1 -3
  19. data/lib/jekyll/converters/identity.rb +13 -14
  20. data/lib/jekyll/converters/markdown.rb +128 -128
  21. data/lib/jekyll/converters/textile.rb +37 -37
  22. data/lib/jekyll/convertible.rb +6 -4
  23. data/lib/jekyll/core_ext.rb +9 -1
  24. data/lib/jekyll/draft.rb +35 -0
  25. data/lib/jekyll/errors.rb +1 -3
  26. data/lib/jekyll/filters.rb +13 -4
  27. data/lib/jekyll/generator.rb +1 -4
  28. data/lib/jekyll/generators/pagination.rb +46 -46
  29. data/lib/jekyll/layout.rb +0 -2
  30. data/lib/jekyll/mime.types +1588 -0
  31. data/lib/jekyll/page.rb +24 -8
  32. data/lib/jekyll/plugin.rb +0 -2
  33. data/lib/jekyll/post.rb +66 -40
  34. data/lib/jekyll/site.rb +96 -20
  35. data/lib/jekyll/static_file.rb +0 -2
  36. data/lib/jekyll/tags/gist.rb +19 -0
  37. data/lib/jekyll/tags/highlight.rb +63 -62
  38. data/lib/jekyll/tags/include.rb +25 -25
  39. data/lib/jekyll/tags/post_url.rb +30 -25
  40. data/script/bootstrap +2 -0
  41. data/site/.gitignore +4 -0
  42. data/site/CNAME +1 -0
  43. data/site/README +1 -0
  44. data/site/_config.yml +5 -0
  45. data/site/_includes/analytics.html +32 -0
  46. data/site/_includes/docs_contents.html +82 -0
  47. data/site/_includes/footer.html +15 -0
  48. data/site/_includes/header.html +26 -0
  49. data/site/_includes/section_nav.html +22 -0
  50. data/site/_includes/top.html +14 -0
  51. data/site/_layouts/default.html +12 -0
  52. data/site/_layouts/docs.html +21 -0
  53. data/site/_posts/2012-07-01-configuration.md +277 -0
  54. data/site/_posts/2012-07-01-contributing.md +66 -0
  55. data/site/_posts/2012-07-01-deployment-methods.md +108 -0
  56. data/site/_posts/2012-07-01-extras.md +103 -0
  57. data/site/_posts/2012-07-01-frontmatter.md +120 -0
  58. data/site/_posts/2012-07-01-github-pages.md +34 -0
  59. data/site/_posts/2012-07-01-heroku.md +8 -0
  60. data/site/_posts/2012-07-01-home.md +47 -0
  61. data/site/_posts/2012-07-01-installation.md +43 -0
  62. data/site/_posts/2012-07-01-migrations.md +180 -0
  63. data/site/_posts/2012-07-01-pages.md +62 -0
  64. data/site/_posts/2012-07-01-pagination.md +116 -0
  65. data/site/_posts/2012-07-01-permalinks.md +163 -0
  66. data/site/_posts/2012-07-01-plugins.md +384 -0
  67. data/site/_posts/2012-07-01-posts.md +106 -0
  68. data/site/_posts/2012-07-01-resources.md +49 -0
  69. data/site/_posts/2012-07-01-sites.md +28 -0
  70. data/site/_posts/2012-07-01-structure.md +95 -0
  71. data/site/_posts/2012-07-01-templates.md +217 -0
  72. data/site/_posts/2012-07-01-troubleshooting.md +108 -0
  73. data/site/_posts/2012-07-01-usage.md +38 -0
  74. data/site/_posts/2012-07-01-variables.md +166 -0
  75. data/site/css/grid.css +62 -0
  76. data/site/css/normalize.css +504 -0
  77. data/site/css/pygments.css +70 -0
  78. data/site/css/style.css +697 -0
  79. data/site/docs/index.html +11 -0
  80. data/site/favicon.png +0 -0
  81. data/site/img/article-footer.png +0 -0
  82. data/site/img/footer-arrow.png +0 -0
  83. data/site/img/footer-logo.png +0 -0
  84. data/site/img/logo-2x.png +0 -0
  85. data/site/img/octojekyll.png +0 -0
  86. data/site/img/tube.png +0 -0
  87. data/site/img/tube1x.png +0 -0
  88. data/site/index.html +77 -0
  89. data/site/js/modernizr-2.5.3.min.js +4 -0
  90. data/test/fixtures/broken_front_matter2.erb +4 -0
  91. data/test/fixtures/broken_front_matter3.erb +7 -0
  92. data/test/fixtures/exploit_front_matter.erb +4 -0
  93. data/test/helper.rb +16 -0
  94. data/test/source/_posts/2013-01-12-nil-layout.textile +6 -0
  95. data/test/source/_posts/2013-01-12-no-layout.textile +5 -0
  96. data/test/source/contacts/bar.html +5 -0
  97. data/test/source/contacts/index.html +5 -0
  98. data/test/test_configuration.rb +7 -8
  99. data/test/test_convertible.rb +29 -0
  100. data/test/test_core_ext.rb +22 -0
  101. data/test/test_generated_site.rb +1 -1
  102. data/test/test_kramdown.rb +3 -3
  103. data/test/test_page.rb +88 -2
  104. data/test/test_post.rb +42 -6
  105. data/test/test_rdiscount.rb +1 -1
  106. data/test/test_redcarpet.rb +1 -1
  107. data/test/test_redcloth.rb +6 -6
  108. data/test/test_site.rb +73 -8
  109. data/test/test_tags.rb +36 -13
  110. metadata +150 -19
  111. data/lib/jekyll/migrators/csv.rb +0 -26
  112. data/lib/jekyll/migrators/drupal.rb +0 -103
  113. data/lib/jekyll/migrators/enki.rb +0 -49
  114. data/lib/jekyll/migrators/joomla.rb +0 -53
  115. data/lib/jekyll/migrators/marley.rb +0 -52
  116. data/lib/jekyll/migrators/mephisto.rb +0 -84
  117. data/lib/jekyll/migrators/mt.rb +0 -86
  118. data/lib/jekyll/migrators/posterous.rb +0 -67
  119. data/lib/jekyll/migrators/rss.rb +0 -47
  120. data/lib/jekyll/migrators/textpattern.rb +0 -58
  121. data/lib/jekyll/migrators/tumblr.rb +0 -195
  122. data/lib/jekyll/migrators/typo.rb +0 -51
  123. data/lib/jekyll/migrators/wordpress.rb +0 -294
  124. data/lib/jekyll/migrators/wordpressdotcom.rb +0 -70
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE HTML>
2
+ <html lang="en-US">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta http-equiv="refresh" content="0;url=home">
6
+ <title>Jekyll</title>
7
+ </head>
8
+ <body style="background: #333;">
9
+
10
+ </body>
11
+ </html>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,77 @@
1
+ ---
2
+ layout: default
3
+ title: Jekyll • Simple, blog-aware, static sites
4
+ overview: true
5
+ ---
6
+
7
+ <section class="intro">
8
+ <div class="content">
9
+ <p class="first">Transform your plain text into static websites and blogs. <br />So easy, <strong>it&rsquo;s scary</strong>.</p>
10
+ </div>
11
+ </section>
12
+ <section class="features">
13
+ <div class="content">
14
+ <div class="grid4 first">
15
+ <h2>Simple</h2>
16
+ <p>
17
+ No more databases, comment moderation, or pesky updates to install—just <em>your content</em>.
18
+ </p>
19
+ <a href="{% post_url 2012-07-01-usage %}" class="">How Jekyll works &rarr;</a>
20
+ </div>
21
+ <div class="grid4">
22
+ <h2>Static</h2>
23
+ <p><a href="http://daringfireball.net/projects/markdown/">Markdown</a> (or <a href="http://textile.sitemonks.com/">Textile</a>), <a href="http://liquidmarkup.org/">Liquid</a>, HTML <span class="amp">&amp;</span> CSS go in. Static sites come out ready for deployment.</p>
24
+ <a href="{% post_url 2012-07-01-templates %}" class="">Jekyll template guide &rarr;</a>
25
+ </div>
26
+ <div class="grid4">
27
+ <h2>Blog-aware</h2>
28
+ <p>
29
+ Permalinks, categories, pages, posts, and custom layouts are all first-class citizens here.
30
+ </p>
31
+ <a href="{% post_url 2012-07-01-migrations %}" class="">Migrate your blog &rarr;</a>
32
+ </div>
33
+ <div class="clear"></div>
34
+ </div>
35
+ </section>
36
+ <section class="quickstart">
37
+ <div class="content">
38
+ <div class="grid5 first">
39
+ <h4>Get up and running <em>in seconds</em>.</h4>
40
+ </div>
41
+ <div class="code">
42
+ <p class="title">Quick-start Instructions</p>
43
+ <div class="shell">
44
+ <p class="line">
45
+ <span class="path">~</span>
46
+ <span class="prompt">$</span>
47
+ <span class="command">gem install jekyll</span>
48
+ </p>
49
+ <p class="line">
50
+ <span class="path">~</span>
51
+ <span class="prompt">$</span>
52
+ <span class="command">cd my/awesome/site</span>
53
+ </p>
54
+ <p class="line">
55
+ <span class="path">~/my/awesome/site</span>
56
+ <span class="prompt">$</span>
57
+ <span class="command">jekyll serve</span>
58
+ </p>
59
+ <p class="line">
60
+ <span class="output"># => Now browse to http://localhost:4000</span>
61
+ </p>
62
+ </div>
63
+ </div>
64
+ <div class="clear"></div>
65
+ </div>
66
+ </section>
67
+ <section class="free-hosting">
68
+ <div class="content">
69
+ <img src="img/octojekyll.png" alt="Free Jekyll hosting on GitHub Pages">
70
+ <div class="pane">
71
+ <h2><strong>Free hosting</strong> with GitHub Pages</h2>
72
+ <p>Sick of dealing with hosting companies? <a href="http://pages.github.com/">GitHub Pages</a> are <em>powered by Jekyll</em>, so you can easily deploy your site using GitHub for free&mdash;<a href="https://help.github.com/articles/setting-up-a-custom-domain-with-pages">custom domain name</a> and all.</p>
73
+ <a href="http://pages.github.com/" class="">Learn more about GitHub Pages &rarr;</a>
74
+ <div class="clear"></div>
75
+ </div>
76
+ </div>
77
+ </section>
@@ -0,0 +1,4 @@
1
+ /* Modernizr 2.5.3 (Custom Build) | MIT & BSD
2
+ * Build: http://www.modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
3
+ */
4
+ ;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a)if(j[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"function")?f.bind(d||b):f}return!1}function J(a,b,c){var d=a.charAt(0).toUpperCase()+a.substr(1),e=(a+" "+p.join(d+" ")+d).split(" ");return F(b,"string")||F(b,"undefined")?H(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),I(e,b,c))}function L(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)u[c[d]]=c[d]in k;return u.list&&(u.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),u}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:/^color$/.test(f)?(g.appendChild(k),g.offsetWidth,e=k.value!=l,g.removeChild(k)):e=k.value!=l)),t[a[d]]=!!e;return t}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.5.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={svg:"http://www.w3.org/2000/svg"},s={},t={},u={},v=[],w=v.slice,x,y=function(a,c,d,e){var f,i,j,k=b.createElement("div"),l=b.body,m=l?l:b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),k.appendChild(j);return f=["&#173;","<style>",a,"</style>"].join(""),k.id=h,m.innerHTML+=f,m.appendChild(k),l||(m.style.background="",g.appendChild(m)),i=c(k,a),l?k.parentNode.removeChild(k):m.parentNode.removeChild(m),!!i},z=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return y("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},A=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=F(e[d],"function"),F(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),B={}.hasOwnProperty,C;!F(B,"undefined")&&!F(B.call,"undefined")?C=function(a,b){return B.call(a,b)}:C=function(a,b){return b in a&&F(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e});var K=function(c,d){var f=c.join(""),g=d.length;y(f,function(c,d){var f=b.styleSheets[b.styleSheets.length-1],h=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"",i=c.childNodes,j={};while(g--)j[i[g].id]=i[g];e.touch="ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch||(j.touch&&j.touch.offsetTop)===9,e.csstransforms3d=(j.csstransforms3d&&j.csstransforms3d.offsetLeft)===9&&j.csstransforms3d.offsetHeight===3,e.generatedcontent=(j.generatedcontent&&j.generatedcontent.offsetHeight)>=1,e.fontface=/src/i.test(h)&&h.indexOf(d.split(" ")[0])===0},g,d)}(['@font-face {font-family:"font";src:url("https://")}',["@media (",n.join("touch-enabled),("),h,")","{#touch{top:9px;position:absolute}}"].join(""),["@media (",n.join("transform-3d),("),h,")","{#csstransforms3d{left:9px;position:absolute;height:3px;}}"].join(""),['#generatedcontent:after{content:"',l,'";visibility:hidden}'].join("")],["fontface","touch","csstransforms3d","generatedcontent"]);s.flexbox=function(){return J("flexOrder")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!F(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){try{var d=b.createElement("canvas"),e;e=!(!a.WebGLRenderingContext||!d.getContext("experimental-webgl")&&!d.getContext("webgl")),d=c}catch(f){e=!1}return e},s.touch=function(){return e.touch},s.geolocation=function(){return!!navigator.geolocation},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!J("indexedDB",a)},s.hashchange=function(){return A("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){for(var b=-1,c=p.length;++b<c;)if(a[p[b]+"WebSocket"])return!0;return"WebSocket"in a},s.rgba=function(){return D("background-color:rgba(150,255,150,.5)"),G(j.backgroundColor,"rgba")},s.hsla=function(){return D("background-color:hsla(120,40%,100%,.5)"),G(j.backgroundColor,"rgba")||G(j.backgroundColor,"hsla")},s.multiplebgs=function(){return D("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return J("backgroundSize")},s.borderimage=function(){return J("borderImage")},s.borderradius=function(){return J("borderRadius")},s.boxshadow=function(){return J("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return E("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return J("animationName")},s.csscolumns=function(){return J("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return D((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),G(j.backgroundImage,"gradient")},s.cssreflections=function(){return J("boxReflect")},s.csstransforms=function(){return!!J("transform")},s.csstransforms3d=function(){var a=!!J("perspective");return a&&"webkitPerspective"in g.style&&(a=e.csstransforms3d),a},s.csstransitions=function(){return J("transition")},s.fontface=function(){return e.fontface},s.generatedcontent=function(){return e.generatedcontent},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var M in s)C(s,M)&&(x=M.toLowerCase(),e[x]=s[M](),v.push((e[x]?"":"no-")+x));return e.input||L(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)C(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,g.className+=" "+(b?"":"no-")+a,e[a]=b}return e},D(""),i=k=null,function(a,b){function g(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function h(){var a=k.elements;return typeof a=="string"?a.split(" "):a}function i(a){var b={},c=a.createElement,e=a.createDocumentFragment,f=e();a.createElement=function(a){var e=(b[a]||(b[a]=c(a))).cloneNode();return k.shivMethods&&e.canHaveChildren&&!d.test(a)?f.appendChild(e):e},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+h().join().replace(/\w+/g,function(a){return b[a]=c(a),f.createElement(a),'c("'+a+'")'})+");return n}")(k,f)}function j(a){var b;return a.documentShived?a:(k.shivCSS&&!e&&(b=!!g(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),f||(b=!i(a)),b&&(a.documentShived=b),a)}var c=a.html5||{},d=/^<|^(?:button|form|map|select|textarea)$/i,e,f;(function(){var a=b.createElement("a");a.innerHTML="<xyz></xyz>",e="hidden"in a,f=a.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var k={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:j};a.html5=k,j(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=z,e.hasEvent=A,e.testProp=function(a){return H([a])},e.testAllProps=J,e.testStyles=y,e.prefixed=function(a,b,c){return b?J(a,b,c):J(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return o.call(a)=="[object Function]"}function e(a){return typeof a=="string"}function f(){}function g(a){return!a||a=="loaded"||a=="complete"||a=="uninitialized"}function h(){var a=p.shift();q=1,a?a.t?m(function(){(a.t=="c"?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){a!="img"&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l={},o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};y[c]===1&&(r=1,y[c]=[],l=b.createElement(a)),a=="object"?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),a!="img"&&(r||y[c]===2?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i(b=="c"?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),p.length==1&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&o.call(a.opera)=="[object Opera]",l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return o.call(a)=="[object Array]"},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,i){var j=b(a),l=j.autoCallback;j.url.split(".").pop().split("?").shift(),j.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]||h),j.instead?j.instead(a,e,f,g,i):(y[j.url]?j.noexec=!0:y[j.url]=1,f.load(j.url,j.forceCSS||!j.forceJS&&"css"==j.url.split(".").pop().split("?").shift()?"c":c,j.noexec,j.attrs,j.timeout),(d(e)||d(l))&&f.load(function(){k(),e&&e(j.origUrl,i,g),l&&l(j.origUrl,i,g),y[j.url]=2})))}function i(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var j,l,m=this.yepnope.loader;if(e(a))g(a,0,m,0);else if(w(a))for(j=0;j<a.length;j++)l=a[j],e(l)?g(l,0,m,0):w(l)?B(l):Object(l)===l&&i(l,m);else Object(a)===a&&i(a,m)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
@@ -0,0 +1,4 @@
1
+ ---
2
+ bad yaml: [
3
+ ---
4
+ Real content starts here
@@ -0,0 +1,7 @@
1
+ ---
2
+ test: good
3
+ ---
4
+ Real content starts here
5
+
6
+ ������� �����
7
+
@@ -0,0 +1,4 @@
1
+ ---
2
+ test: !ruby/hash:DoesNotExist {}
3
+ ---
4
+ Real content starts here
@@ -1,3 +1,9 @@
1
+ if RUBY_VERSION > '1.9' && ENV["COVERAGE"] == "true"
2
+ require 'simplecov'
3
+ require 'simplecov-gem-adapter'
4
+ SimpleCov.start('gem')
5
+ end
6
+
1
7
  require 'rubygems'
2
8
  require 'test/unit'
3
9
  gem 'RedCloth', '>= 4.2.1'
@@ -32,4 +38,14 @@ class Test::Unit::TestCase
32
38
  def clear_dest
33
39
  FileUtils.rm_rf(dest_dir)
34
40
  end
41
+
42
+ def capture_stdout
43
+ $old_stdout = $stdout
44
+ $stdout = StringIO.new
45
+ yield
46
+ $stdout.rewind
47
+ return $stdout.string
48
+ ensure
49
+ $stdout = $old_stdout
50
+ end
35
51
  end
@@ -0,0 +1,6 @@
1
+ ---
2
+ layout: nil
3
+ title: No layout
4
+ ---
5
+
6
+ This post has no layout.
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: I have no layout
3
+ ---
4
+
5
+ This post will be rendered with the "post" layout.
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: Contact Information
3
+ ---
4
+
5
+ Contact Information
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: Contact Information
3
+ ---
4
+
5
+ Contact Information
@@ -7,22 +7,21 @@ class TestConfiguration < Test::Unit::TestCase
7
7
  end
8
8
 
9
9
  should "fire warning with no _config.yml" do
10
- mock(YAML).load_file(@path) { raise "No such file or directory - #{@path}" }
11
- mock($stderr).puts("WARNING: Could not read configuration. Using defaults (and options).")
12
- mock($stderr).puts("\tNo such file or directory - #{@path}")
10
+ mock(YAML).safe_load_file(@path) { raise SystemCallError, "No such file or directory - #{@path}" }
11
+ mock($stderr).puts("Configuration file: none")
13
12
  assert_equal Jekyll::DEFAULTS, Jekyll.configuration({})
14
13
  end
15
14
 
16
15
  should "load configuration as hash" do
17
- mock(YAML).load_file(@path) { Hash.new }
18
- mock($stdout).puts("Configuration from #{@path}")
16
+ mock(YAML).safe_load_file(@path) { Hash.new }
17
+ mock($stdout).puts("Configuration file: #{@path}")
19
18
  assert_equal Jekyll::DEFAULTS, Jekyll.configuration({})
20
19
  end
21
20
 
22
21
  should "fire warning with bad config" do
23
- mock(YAML).load_file(@path) { Array.new }
24
- mock($stderr).puts("WARNING: Could not read configuration. Using defaults (and options).")
25
- mock($stderr).puts("\tInvalid configuration - #{@path}")
22
+ mock(YAML).safe_load_file(@path) { Array.new }
23
+ mock($stderr).puts(" WARNING: Error reading configuration. Using defaults (and options).")
24
+ mock($stderr).puts("Configuration file: (INVALID) #{@path}")
26
25
  assert_equal Jekyll::DEFAULTS, Jekyll.configuration({})
27
26
  end
28
27
  end
@@ -18,5 +18,34 @@ class TestConvertible < Test::Unit::TestCase
18
18
  ret = @convertible.read_yaml(@base, 'broken_front_matter1.erb')
19
19
  assert_equal({}, ret)
20
20
  end
21
+
22
+ should "not parse if there is syntax error in front-matter" do
23
+ name = 'broken_front_matter2.erb'
24
+ out = capture_stdout do
25
+ ret = @convertible.read_yaml(@base, name)
26
+ assert_equal({}, ret)
27
+ end
28
+ assert_match(/YAML Exception|syntax error/, out)
29
+ assert_match(/#{File.join(@base, name)}/, out)
30
+ end
31
+
32
+ should "not allow ruby objects in yaml" do
33
+ out = capture_stdout do
34
+ @convertible.read_yaml(@base, 'exploit_front_matter.erb')
35
+ end
36
+ assert_no_match /undefined class\/module DoesNotExist/, out
37
+ end
38
+
39
+ if RUBY_VERSION >= '1.9.2'
40
+ should "not parse if there is encoding error in file" do
41
+ name = 'broken_front_matter3.erb'
42
+ out = capture_stdout do
43
+ ret = @convertible.read_yaml(@base, name)
44
+ assert_equal({}, ret)
45
+ end
46
+ assert_match(/invalid byte sequence in UTF-8/, out)
47
+ assert_match(/#{File.join(@base, name)}/, out)
48
+ end
49
+ end
21
50
  end
22
51
  end
@@ -63,4 +63,26 @@ class TestCoreExt < Test::Unit::TestCase
63
63
  end
64
64
 
65
65
  end
66
+
67
+ context "enumerable" do
68
+ context "glob_include?" do
69
+ should "return false with no glob patterns" do
70
+ assert ![].glob_include?("a.txt")
71
+ end
72
+
73
+ should "return false with all not match path" do
74
+ data = ["a*", "b?"]
75
+ assert !data.glob_include?("ca.txt")
76
+ assert !data.glob_include?("ba.txt")
77
+ end
78
+
79
+ should "return true with match path" do
80
+ data = ["a*", "b?", "**/a*"]
81
+ assert data.glob_include?("a.txt")
82
+ assert data.glob_include?("ba")
83
+ assert data.glob_include?("c/a/a.txt")
84
+ assert data.glob_include?("c/a/b/a.txt")
85
+ end
86
+ end
87
+ end
66
88
  end
@@ -14,7 +14,7 @@ class TestGeneratedSite < Test::Unit::TestCase
14
14
  end
15
15
 
16
16
  should "ensure post count is as expected" do
17
- assert_equal 28, @site.posts.size
17
+ assert_equal 30, @site.posts.size
18
18
  end
19
19
 
20
20
  should "insert site.posts into the index" do
@@ -17,16 +17,16 @@ class TestKramdown < Test::Unit::TestCase
17
17
 
18
18
  # http://kramdown.rubyforge.org/converter/html.html#options
19
19
  should "pass kramdown options" do
20
- markdown = MarkdownConverter.new(@config)
20
+ markdown = Converters::Markdown.new(@config)
21
21
  assert_equal "<h1>Some Header</h1>", markdown.convert('# Some Header #').strip
22
22
  end
23
23
 
24
24
  should "convert quotes to smart quotes" do
25
- markdown = MarkdownConverter.new(@config)
25
+ markdown = Converters::Markdown.new(@config)
26
26
  assert_equal "<p>&#8220;Pit&#8217;hy&#8221;</p>", markdown.convert(%{"Pit'hy"}).strip
27
27
 
28
28
  override = { 'kramdown' => { 'smart_quotes' => 'lsaquo,rsaquo,laquo,raquo' } }
29
- markdown = MarkdownConverter.new(@config.deep_merge(override))
29
+ markdown = Converters::Markdown.new(@config.deep_merge(override))
30
30
  assert_equal "<p>&#171;Pit&#8250;hy&#187;</p>", markdown.convert(%{"Pit'hy"}).strip
31
31
  end
32
32
  end
@@ -1,8 +1,10 @@
1
1
  require 'helper'
2
2
 
3
3
  class TestPage < Test::Unit::TestCase
4
- def setup_page(file)
5
- @page = Page.new(@site, source_dir, '', file)
4
+ def setup_page(*args)
5
+ dir, file = args
6
+ dir, file = ['', dir] if file.nil?
7
+ @page = Page.new(@site, source_dir, dir, file)
6
8
  end
7
9
 
8
10
  def do_render(page)
@@ -23,6 +25,18 @@ class TestPage < Test::Unit::TestCase
23
25
  assert_equal "/contacts.html", @page.url
24
26
  end
25
27
 
28
+ context "in a directory hierarchy" do
29
+ should "create url based on filename" do
30
+ @page = setup_page('/contacts', 'bar.html')
31
+ assert_equal "/contacts/bar.html", @page.url
32
+ end
33
+
34
+ should "create index url based on filename" do
35
+ @page = setup_page('/contacts', 'index.html')
36
+ assert_equal "/contacts/index.html", @page.url
37
+ end
38
+ end
39
+
26
40
  should "deal properly with extensions" do
27
41
  @page = setup_page('deal.with.dots.html')
28
42
  assert_equal ".html", @page.ext
@@ -47,6 +61,28 @@ class TestPage < Test::Unit::TestCase
47
61
  @page = setup_page('index.html')
48
62
  assert_equal '/', @page.dir
49
63
  end
64
+
65
+ context "in a directory hierarchy" do
66
+ should "create url based on filename" do
67
+ @page = setup_page('/contacts', 'bar.html')
68
+ assert_equal "/contacts/bar/", @page.url
69
+ end
70
+
71
+ should "create index url based on filename" do
72
+ @page = setup_page('/contacts', 'index.html')
73
+ assert_equal "/contacts/", @page.url
74
+ end
75
+
76
+ should "return dir correctly" do
77
+ @page = setup_page('/contacts', 'bar.html')
78
+ assert_equal '/contacts/bar/', @page.dir
79
+ end
80
+
81
+ should "return dir correctly for index page" do
82
+ @page = setup_page('/contacts', 'index.html')
83
+ assert_equal '/contacts/', @page.dir
84
+ end
85
+ end
50
86
  end
51
87
 
52
88
  context "with any other url style" do
@@ -66,6 +102,26 @@ class TestPage < Test::Unit::TestCase
66
102
  assert_equal "/about/", @page.dir
67
103
  end
68
104
  end
105
+
106
+ context "with unspecified layout" do
107
+ setup do
108
+ @page = setup_page('contacts.html')
109
+ end
110
+
111
+ should "default to 'post' layout" do
112
+ assert_equal "page", @page.data["layout"]
113
+ end
114
+ end
115
+
116
+ context "with specified layout of nil" do
117
+ setup do
118
+ @page = setup_page('sitemap.xml')
119
+ end
120
+
121
+ should "layout of nil is respected" do
122
+ assert_equal "nil", @page.data["layout"]
123
+ end
124
+ end
69
125
 
70
126
  context "rendering" do
71
127
  setup do
@@ -111,6 +167,36 @@ class TestPage < Test::Unit::TestCase
111
167
  assert File.directory?(dest_dir)
112
168
  assert File.exists?(File.join(dest_dir, '.htaccess'))
113
169
  end
170
+
171
+ context "in a directory hierarchy" do
172
+ should "write properly the index" do
173
+ page = setup_page('/contacts', 'index.html')
174
+ do_render(page)
175
+ page.write(dest_dir)
176
+
177
+ assert File.directory?(dest_dir)
178
+ assert File.exists?(File.join(dest_dir, 'contacts', 'index.html'))
179
+ end
180
+
181
+ should "write properly" do
182
+ page = setup_page('/contacts', 'bar.html')
183
+ do_render(page)
184
+ page.write(dest_dir)
185
+
186
+ assert File.directory?(dest_dir)
187
+ assert File.exists?(File.join(dest_dir, 'contacts', 'bar.html'))
188
+ end
189
+
190
+ should "write properly without html extension" do
191
+ page = setup_page('/contacts', 'bar.html')
192
+ page.site.permalink_style = :pretty
193
+ do_render(page)
194
+ page.write(dest_dir)
195
+
196
+ assert File.directory?(dest_dir)
197
+ assert File.exists?(File.join(dest_dir, 'contacts', 'bar', 'index.html'))
198
+ end
199
+ end
114
200
  end
115
201
 
116
202
  end
@@ -95,7 +95,7 @@ class TestPost < Test::Unit::TestCase
95
95
  should "consume the embedded dashes" do
96
96
  @post.read_yaml(@source, @real_file)
97
97
 
98
- assert_equal({"title" => "Foo --- Bar"}, @post.data)
98
+ assert_equal({"title" => "Foo --- Bar", "layout" => "post"}, @post.data)
99
99
  assert_equal "Triple the fun!", @post.content
100
100
  end
101
101
  end
@@ -128,6 +128,42 @@ class TestPost < Test::Unit::TestCase
128
128
  end
129
129
  end
130
130
 
131
+ context "with unspecified (date) style and a numeric category" do
132
+ setup do
133
+ @post.categories << 2013
134
+ @post.process(@fake_file)
135
+ end
136
+
137
+ should "process the url correctly" do
138
+ assert_equal "/:categories/:year/:month/:day/:title.html", @post.template
139
+ assert_equal "/2013/2008/09/09/foo-bar.html", @post.url
140
+ end
141
+ end
142
+
143
+ context "with unspecified layout" do
144
+ setup do
145
+ file = '2013-01-12-no-layout.textile'
146
+ @post = setup_post(file)
147
+ @post.process(file)
148
+ end
149
+
150
+ should "default to 'post' layout" do
151
+ assert_equal "post", @post.data["layout"]
152
+ end
153
+ end
154
+
155
+ context "with specified layout of nil" do
156
+ setup do
157
+ file = '2013-01-12-nil-layout.textile'
158
+ @post = setup_post(file)
159
+ @post.process(file)
160
+ end
161
+
162
+ should "layout of nil is respected" do
163
+ assert_equal "nil", @post.data["layout"]
164
+ end
165
+ end
166
+
131
167
  context "with unspecified (date) style and categories" do
132
168
  setup do
133
169
  @post.categories << "food"
@@ -421,34 +457,34 @@ class TestPost < Test::Unit::TestCase
421
457
  should "process .md as markdown under default configuration" do
422
458
  post = setup_post '2011-04-12-md-extension.md'
423
459
  conv = post.converter
424
- assert conv.kind_of? Jekyll::MarkdownConverter
460
+ assert conv.kind_of? Jekyll::Converters::Markdown
425
461
  end
426
462
 
427
463
  should "process .text as indentity under default configuration" do
428
464
  post = setup_post '2011-04-12-text-extension.text'
429
465
  conv = post.converter
430
- assert conv.kind_of? Jekyll::IdentityConverter
466
+ assert conv.kind_of? Jekyll::Converters::Identity
431
467
  end
432
468
 
433
469
  should "process .text as markdown under alternate configuration" do
434
470
  @site.config['markdown_ext'] = 'markdown,mdw,mdwn,md,text'
435
471
  post = setup_post '2011-04-12-text-extension.text'
436
472
  conv = post.converter
437
- assert conv.kind_of? Jekyll::MarkdownConverter
473
+ assert conv.kind_of? Jekyll::Converters::Markdown
438
474
  end
439
475
 
440
476
  should "process .md as markdown under alternate configuration" do
441
477
  @site.config['markdown_ext'] = 'markdown,mkd,mkdn,md,text'
442
478
  post = setup_post '2011-04-12-text-extension.text'
443
479
  conv = post.converter
444
- assert conv.kind_of? Jekyll::MarkdownConverter
480
+ assert conv.kind_of? Jekyll::Converters::Markdown
445
481
  end
446
482
 
447
483
  should "process .text as textile under alternate configuration" do
448
484
  @site.config['textile_ext'] = 'textile,text'
449
485
  post = setup_post '2011-04-12-text-extension.text'
450
486
  conv = post.converter
451
- assert conv.kind_of? Jekyll::TextileConverter
487
+ assert conv.kind_of? Jekyll::Converters::Textile
452
488
  end
453
489
 
454
490
  end