link-checker 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +81 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +56 -0
- data/LICENSE.txt +20 -0
- data/README.md +15 -0
- data/Rakefile +29 -0
- data/VERSION +1 -0
- data/bin/check-links +8 -0
- data/lib/link_checker.rb +80 -0
- data/link-checker.gemspec +404 -0
- data/spec/link-checker_spec.rb +92 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/test-site/.gitignore +12 -0
- data/spec/test-site/.powrc +5 -0
- data/spec/test-site/.rbenv-version +1 -0
- data/spec/test-site/.rvmrc +1 -0
- data/spec/test-site/.slugignore +3 -0
- data/spec/test-site/.themes/classic/sass/_base.scss +5 -0
- data/spec/test-site/.themes/classic/sass/_partials.scss +8 -0
- data/spec/test-site/.themes/classic/sass/base/_layout.scss +192 -0
- data/spec/test-site/.themes/classic/sass/base/_solarized.scss +46 -0
- data/spec/test-site/.themes/classic/sass/base/_theme.scss +86 -0
- data/spec/test-site/.themes/classic/sass/base/_typography.scss +161 -0
- data/spec/test-site/.themes/classic/sass/base/_utilities.scss +28 -0
- data/spec/test-site/.themes/classic/sass/custom/_colors.scss +43 -0
- data/spec/test-site/.themes/classic/sass/custom/_fonts.scss +10 -0
- data/spec/test-site/.themes/classic/sass/custom/_layout.scss +21 -0
- data/spec/test-site/.themes/classic/sass/custom/_styles.scss +2 -0
- data/spec/test-site/.themes/classic/sass/partials/_archive.scss +72 -0
- data/spec/test-site/.themes/classic/sass/partials/_blog.scss +141 -0
- data/spec/test-site/.themes/classic/sass/partials/_footer.scss +19 -0
- data/spec/test-site/.themes/classic/sass/partials/_header.scss +18 -0
- data/spec/test-site/.themes/classic/sass/partials/_navigation.scss +137 -0
- data/spec/test-site/.themes/classic/sass/partials/_sharing.scss +8 -0
- data/spec/test-site/.themes/classic/sass/partials/_sidebar.scss +5 -0
- data/spec/test-site/.themes/classic/sass/partials/_syntax.scss +253 -0
- data/spec/test-site/.themes/classic/sass/partials/sidebar/_base.scss +106 -0
- data/spec/test-site/.themes/classic/sass/partials/sidebar/_delicious.scss +4 -0
- data/spec/test-site/.themes/classic/sass/partials/sidebar/_googleplus.scss +26 -0
- data/spec/test-site/.themes/classic/sass/partials/sidebar/_pinboard.scss +12 -0
- data/spec/test-site/.themes/classic/sass/partials/sidebar/_twitter.scss +34 -0
- data/spec/test-site/.themes/classic/sass/screen.scss +10 -0
- data/spec/test-site/.themes/classic/source/_includes/after_footer.html +5 -0
- data/spec/test-site/.themes/classic/source/_includes/archive_post.html +8 -0
- data/spec/test-site/.themes/classic/source/_includes/article.html +28 -0
- data/spec/test-site/.themes/classic/source/_includes/asides/delicious.html +8 -0
- data/spec/test-site/.themes/classic/source/_includes/asides/github.html +30 -0
- data/spec/test-site/.themes/classic/source/_includes/asides/googleplus.html +11 -0
- data/spec/test-site/.themes/classic/source/_includes/asides/pinboard.html +19 -0
- data/spec/test-site/.themes/classic/source/_includes/asides/recent_posts.html +10 -0
- data/spec/test-site/.themes/classic/source/_includes/asides/twitter.html +19 -0
- data/spec/test-site/.themes/classic/source/_includes/custom/after_footer.html +3 -0
- data/spec/test-site/.themes/classic/source/_includes/custom/asides/about.html +4 -0
- data/spec/test-site/.themes/classic/source/_includes/custom/category_feed.xml +27 -0
- data/spec/test-site/.themes/classic/source/_includes/custom/footer.html +4 -0
- data/spec/test-site/.themes/classic/source/_includes/custom/head.html +3 -0
- data/spec/test-site/.themes/classic/source/_includes/custom/header.html +6 -0
- data/spec/test-site/.themes/classic/source/_includes/custom/navigation.html +4 -0
- data/spec/test-site/.themes/classic/source/_includes/disqus.html +21 -0
- data/spec/test-site/.themes/classic/source/_includes/facebook_like.html +10 -0
- data/spec/test-site/.themes/classic/source/_includes/footer.html +1 -0
- data/spec/test-site/.themes/classic/source/_includes/google_analytics.html +13 -0
- data/spec/test-site/.themes/classic/source/_includes/google_plus_one.html +9 -0
- data/spec/test-site/.themes/classic/source/_includes/head.html +29 -0
- data/spec/test-site/.themes/classic/source/_includes/header.html +1 -0
- data/spec/test-site/.themes/classic/source/_includes/navigation.html +15 -0
- data/spec/test-site/.themes/classic/source/_includes/post/author.html +8 -0
- data/spec/test-site/.themes/classic/source/_includes/post/categories.html +10 -0
- data/spec/test-site/.themes/classic/source/_includes/post/date.html +15 -0
- data/spec/test-site/.themes/classic/source/_includes/post/disqus_thread.html +1 -0
- data/spec/test-site/.themes/classic/source/_includes/post/sharing.html +11 -0
- data/spec/test-site/.themes/classic/source/_includes/twitter_sharing.html +11 -0
- data/spec/test-site/.themes/classic/source/_layouts/category_index.html +17 -0
- data/spec/test-site/.themes/classic/source/_layouts/default.html +14 -0
- data/spec/test-site/.themes/classic/source/_layouts/page.html +42 -0
- data/spec/test-site/.themes/classic/source/_layouts/post.html +43 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/background.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/blankButton.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/divider.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/fullscreenButton.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/fullscreenButtonOver.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/muteButton.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/muteButtonOver.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/normalscreenButton.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/normalscreenButtonOver.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/pauseButton.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/pauseButtonOver.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/playButton.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/playButtonOver.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/timeSliderBuffer.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/timeSliderCapLeft.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/timeSliderCapRight.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/timeSliderProgress.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/timeSliderRail.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/unmuteButton.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/controlbar/unmuteButtonOver.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/display/background.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/display/bufferIcon.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/display/muteIcon.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/display/playIcon.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/dock/button.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/glow.xml +115 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/playlist/item.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/playlist/itemOver.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/playlist/sliderCapBottom.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/playlist/sliderCapTop.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/playlist/sliderRail.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/playlist/sliderThumb.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/sharing/embedIcon.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/sharing/embedScreen.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/sharing/shareIcon.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/glow/sharing/shareScreen.png +0 -0
- data/spec/test-site/.themes/classic/source/assets/jwplayer/player.swf +0 -0
- data/spec/test-site/.themes/classic/source/atom.xml +27 -0
- data/spec/test-site/.themes/classic/source/blog/archives/index.html +18 -0
- data/spec/test-site/.themes/classic/source/favicon.png +0 -0
- data/spec/test-site/.themes/classic/source/images/bird_32_gray.png +0 -0
- data/spec/test-site/.themes/classic/source/images/bird_32_gray_fail.png +0 -0
- data/spec/test-site/.themes/classic/source/images/code_bg.png +0 -0
- data/spec/test-site/.themes/classic/source/images/dotted-border.png +0 -0
- data/spec/test-site/.themes/classic/source/images/email.png +0 -0
- data/spec/test-site/.themes/classic/source/images/line-tile.png +0 -0
- data/spec/test-site/.themes/classic/source/images/noise.png +0 -0
- data/spec/test-site/.themes/classic/source/images/rss.png +0 -0
- data/spec/test-site/.themes/classic/source/images/search.png +0 -0
- data/spec/test-site/.themes/classic/source/index.html +29 -0
- data/spec/test-site/.themes/classic/source/javascripts/ender.js +45 -0
- data/spec/test-site/.themes/classic/source/javascripts/github.js +37 -0
- data/spec/test-site/.themes/classic/source/javascripts/libs/ender.js +1497 -0
- data/spec/test-site/.themes/classic/source/javascripts/libs/jXHR.js +85 -0
- data/spec/test-site/.themes/classic/source/javascripts/libs/swfobject-dynamic.js +298 -0
- data/spec/test-site/.themes/classic/source/javascripts/modernizr-2.0.js +5 -0
- data/spec/test-site/.themes/classic/source/javascripts/octopress.js +161 -0
- data/spec/test-site/.themes/classic/source/javascripts/pinboard.js +56 -0
- data/spec/test-site/.themes/classic/source/javascripts/twitter.js +78 -0
- data/spec/test-site/CHANGELOG.markdown +29 -0
- data/spec/test-site/Gemfile +18 -0
- data/spec/test-site/Gemfile.lock +69 -0
- data/spec/test-site/README.markdown +36 -0
- data/spec/test-site/Rakefile +379 -0
- data/spec/test-site/_config.yml +99 -0
- data/spec/test-site/config.rb +16 -0
- data/spec/test-site/config.ru +25 -0
- data/spec/test-site/plugins/backtick_code_block.rb +43 -0
- data/spec/test-site/plugins/blockquote.rb +83 -0
- data/spec/test-site/plugins/category_generator.rb +174 -0
- data/spec/test-site/plugins/code_block.rb +98 -0
- data/spec/test-site/plugins/date.rb +98 -0
- data/spec/test-site/plugins/gist_tag.rb +100 -0
- data/spec/test-site/plugins/haml.rb +24 -0
- data/spec/test-site/plugins/image_tag.rb +50 -0
- data/spec/test-site/plugins/include_array.rb +58 -0
- data/spec/test-site/plugins/include_code.rb +73 -0
- data/spec/test-site/plugins/jsfiddle.rb +40 -0
- data/spec/test-site/plugins/octopress_filters.rb +135 -0
- data/spec/test-site/plugins/pagination.rb +121 -0
- data/spec/test-site/plugins/post_filters.rb +176 -0
- data/spec/test-site/plugins/preview_unpublished.rb +48 -0
- data/spec/test-site/plugins/pullquote.rb +45 -0
- data/spec/test-site/plugins/pygments_code.rb +41 -0
- data/spec/test-site/plugins/raw.rb +40 -0
- data/spec/test-site/plugins/render_partial.rb +69 -0
- data/spec/test-site/plugins/rubypants.rb +489 -0
- data/spec/test-site/plugins/sitemap_generator.rb +312 -0
- data/spec/test-site/plugins/titlecase.rb +36 -0
- data/spec/test-site/plugins/video_tag.rb +47 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/background.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/blankButton.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/divider.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/fullscreenButton.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/fullscreenButtonOver.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/muteButton.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/muteButtonOver.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/normalscreenButton.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/normalscreenButtonOver.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/pauseButton.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/pauseButtonOver.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/playButton.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/playButtonOver.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/timeSliderBuffer.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/timeSliderCapLeft.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/timeSliderCapRight.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/timeSliderProgress.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/timeSliderRail.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/unmuteButton.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/controlbar/unmuteButtonOver.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/display/background.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/display/bufferIcon.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/display/muteIcon.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/display/playIcon.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/dock/button.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/glow.xml +115 -0
- data/spec/test-site/public/assets/jwplayer/glow/playlist/item.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/playlist/itemOver.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/playlist/sliderCapBottom.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/playlist/sliderCapTop.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/playlist/sliderRail.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/playlist/sliderThumb.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/sharing/embedIcon.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/sharing/embedScreen.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/sharing/shareIcon.png +0 -0
- data/spec/test-site/public/assets/jwplayer/glow/sharing/shareScreen.png +0 -0
- data/spec/test-site/public/assets/jwplayer/player.swf +0 -0
- data/spec/test-site/public/atom.xml +27 -0
- data/spec/test-site/public/blog/2012/10/02/a-list-of-links/index.html +196 -0
- data/spec/test-site/public/blog/archives/index.html +149 -0
- data/spec/test-site/public/favicon.png +0 -0
- data/spec/test-site/public/images/bird_32_gray.png +0 -0
- data/spec/test-site/public/images/bird_32_gray_fail.png +0 -0
- data/spec/test-site/public/images/code_bg.png +0 -0
- data/spec/test-site/public/images/dotted-border.png +0 -0
- data/spec/test-site/public/images/email.png +0 -0
- data/spec/test-site/public/images/line-tile.png +0 -0
- data/spec/test-site/public/images/noise.png +0 -0
- data/spec/test-site/public/images/rss.png +0 -0
- data/spec/test-site/public/images/search.png +0 -0
- data/spec/test-site/public/index.html +165 -0
- data/spec/test-site/public/javascripts/ender.js +45 -0
- data/spec/test-site/public/javascripts/github.js +37 -0
- data/spec/test-site/public/javascripts/libs/ender.js +1497 -0
- data/spec/test-site/public/javascripts/libs/jXHR.js +85 -0
- data/spec/test-site/public/javascripts/libs/swfobject-dynamic.js +298 -0
- data/spec/test-site/public/javascripts/modernizr-2.0.js +5 -0
- data/spec/test-site/public/javascripts/octopress.js +161 -0
- data/spec/test-site/public/javascripts/pinboard.js +56 -0
- data/spec/test-site/public/javascripts/twitter.js +78 -0
- data/spec/test-site/public/sitemap.xml +15 -0
- data/spec/test-site/public/stylesheets/screen.css +1 -0
- data/spec/test-site/sass/_base.scss +5 -0
- data/spec/test-site/sass/_partials.scss +8 -0
- data/spec/test-site/sass/base/_layout.scss +192 -0
- data/spec/test-site/sass/base/_solarized.scss +46 -0
- data/spec/test-site/sass/base/_theme.scss +86 -0
- data/spec/test-site/sass/base/_typography.scss +161 -0
- data/spec/test-site/sass/base/_utilities.scss +28 -0
- data/spec/test-site/sass/custom/_colors.scss +43 -0
- data/spec/test-site/sass/custom/_fonts.scss +10 -0
- data/spec/test-site/sass/custom/_layout.scss +21 -0
- data/spec/test-site/sass/custom/_styles.scss +2 -0
- data/spec/test-site/sass/partials/_archive.scss +72 -0
- data/spec/test-site/sass/partials/_blog.scss +141 -0
- data/spec/test-site/sass/partials/_footer.scss +19 -0
- data/spec/test-site/sass/partials/_header.scss +18 -0
- data/spec/test-site/sass/partials/_navigation.scss +137 -0
- data/spec/test-site/sass/partials/_sharing.scss +8 -0
- data/spec/test-site/sass/partials/_sidebar.scss +5 -0
- data/spec/test-site/sass/partials/_syntax.scss +253 -0
- data/spec/test-site/sass/partials/sidebar/_base.scss +106 -0
- data/spec/test-site/sass/partials/sidebar/_delicious.scss +4 -0
- data/spec/test-site/sass/partials/sidebar/_googleplus.scss +26 -0
- data/spec/test-site/sass/partials/sidebar/_pinboard.scss +12 -0
- data/spec/test-site/sass/partials/sidebar/_twitter.scss +34 -0
- data/spec/test-site/sass/screen.scss +10 -0
- data/spec/test-site/source/_includes/after_footer.html +5 -0
- data/spec/test-site/source/_includes/archive_post.html +8 -0
- data/spec/test-site/source/_includes/article.html +28 -0
- data/spec/test-site/source/_includes/asides/delicious.html +8 -0
- data/spec/test-site/source/_includes/asides/github.html +30 -0
- data/spec/test-site/source/_includes/asides/googleplus.html +11 -0
- data/spec/test-site/source/_includes/asides/pinboard.html +19 -0
- data/spec/test-site/source/_includes/asides/recent_posts.html +10 -0
- data/spec/test-site/source/_includes/asides/twitter.html +19 -0
- data/spec/test-site/source/_includes/custom/after_footer.html +3 -0
- data/spec/test-site/source/_includes/custom/asides/about.html +4 -0
- data/spec/test-site/source/_includes/custom/category_feed.xml +27 -0
- data/spec/test-site/source/_includes/custom/footer.html +4 -0
- data/spec/test-site/source/_includes/custom/head.html +3 -0
- data/spec/test-site/source/_includes/custom/header.html +6 -0
- data/spec/test-site/source/_includes/custom/navigation.html +4 -0
- data/spec/test-site/source/_includes/disqus.html +21 -0
- data/spec/test-site/source/_includes/facebook_like.html +10 -0
- data/spec/test-site/source/_includes/footer.html +1 -0
- data/spec/test-site/source/_includes/google_analytics.html +13 -0
- data/spec/test-site/source/_includes/google_plus_one.html +9 -0
- data/spec/test-site/source/_includes/head.html +29 -0
- data/spec/test-site/source/_includes/header.html +1 -0
- data/spec/test-site/source/_includes/navigation.html +15 -0
- data/spec/test-site/source/_includes/post/author.html +8 -0
- data/spec/test-site/source/_includes/post/categories.html +10 -0
- data/spec/test-site/source/_includes/post/date.html +15 -0
- data/spec/test-site/source/_includes/post/disqus_thread.html +1 -0
- data/spec/test-site/source/_includes/post/sharing.html +11 -0
- data/spec/test-site/source/_includes/twitter_sharing.html +11 -0
- data/spec/test-site/source/_layouts/category_index.html +17 -0
- data/spec/test-site/source/_layouts/default.html +14 -0
- data/spec/test-site/source/_layouts/page.html +42 -0
- data/spec/test-site/source/_layouts/post.html +43 -0
- data/spec/test-site/source/_posts/2012-10-02-a-list-of-links.markdown +11 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/background.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/blankButton.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/divider.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/fullscreenButton.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/fullscreenButtonOver.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/muteButton.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/muteButtonOver.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/normalscreenButton.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/normalscreenButtonOver.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/pauseButton.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/pauseButtonOver.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/playButton.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/playButtonOver.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/timeSliderBuffer.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/timeSliderCapLeft.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/timeSliderCapRight.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/timeSliderProgress.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/timeSliderRail.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/unmuteButton.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/controlbar/unmuteButtonOver.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/display/background.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/display/bufferIcon.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/display/muteIcon.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/display/playIcon.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/dock/button.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/glow.xml +115 -0
- data/spec/test-site/source/assets/jwplayer/glow/playlist/item.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/playlist/itemOver.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/playlist/sliderCapBottom.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/playlist/sliderCapTop.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/playlist/sliderRail.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/playlist/sliderThumb.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/sharing/embedIcon.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/sharing/embedScreen.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/sharing/shareIcon.png +0 -0
- data/spec/test-site/source/assets/jwplayer/glow/sharing/shareScreen.png +0 -0
- data/spec/test-site/source/assets/jwplayer/player.swf +0 -0
- data/spec/test-site/source/atom.xml +27 -0
- data/spec/test-site/source/blog/archives/index.html +18 -0
- data/spec/test-site/source/favicon.png +0 -0
- data/spec/test-site/source/images/bird_32_gray.png +0 -0
- data/spec/test-site/source/images/bird_32_gray_fail.png +0 -0
- data/spec/test-site/source/images/code_bg.png +0 -0
- data/spec/test-site/source/images/dotted-border.png +0 -0
- data/spec/test-site/source/images/email.png +0 -0
- data/spec/test-site/source/images/line-tile.png +0 -0
- data/spec/test-site/source/images/noise.png +0 -0
- data/spec/test-site/source/images/rss.png +0 -0
- data/spec/test-site/source/images/search.png +0 -0
- data/spec/test-site/source/index.html +29 -0
- data/spec/test-site/source/javascripts/ender.js +45 -0
- data/spec/test-site/source/javascripts/github.js +37 -0
- data/spec/test-site/source/javascripts/libs/ender.js +1497 -0
- data/spec/test-site/source/javascripts/libs/jXHR.js +85 -0
- data/spec/test-site/source/javascripts/libs/swfobject-dynamic.js +298 -0
- data/spec/test-site/source/javascripts/modernizr-2.0.js +5 -0
- data/spec/test-site/source/javascripts/octopress.js +161 -0
- data/spec/test-site/source/javascripts/pinboard.js +56 -0
- data/spec/test-site/source/javascripts/twitter.js +78 -0
- metadata +475 -0
@@ -0,0 +1,98 @@
|
|
1
|
+
module Octopress
|
2
|
+
module Date
|
3
|
+
|
4
|
+
# Returns a datetime if the input is a string
|
5
|
+
def datetime(date)
|
6
|
+
if date.class == String
|
7
|
+
date = Time.parse(date)
|
8
|
+
end
|
9
|
+
date
|
10
|
+
end
|
11
|
+
|
12
|
+
# Returns an ordidinal date eg July 22 2007 -> July 22nd 2007
|
13
|
+
def ordinalize(date)
|
14
|
+
date = datetime(date)
|
15
|
+
"#{date.strftime('%b')} #{ordinal(date.strftime('%e').to_i)}, #{date.strftime('%Y')}"
|
16
|
+
end
|
17
|
+
|
18
|
+
# Returns an ordinal number. 13 -> 13th, 21 -> 21st etc.
|
19
|
+
def ordinal(number)
|
20
|
+
if (11..13).include?(number.to_i % 100)
|
21
|
+
"#{number}<span>th</span>"
|
22
|
+
else
|
23
|
+
case number.to_i % 10
|
24
|
+
when 1; "#{number}<span>st</span>"
|
25
|
+
when 2; "#{number}<span>nd</span>"
|
26
|
+
when 3; "#{number}<span>rd</span>"
|
27
|
+
else "#{number}<span>th</span>"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# Formats date either as ordinal or by given date format
|
33
|
+
# Adds %o as ordinal representation of the day
|
34
|
+
def format_date(date, format)
|
35
|
+
date = datetime(date)
|
36
|
+
if format.nil? || format.empty? || format == "ordinal"
|
37
|
+
date_formatted = ordinalize(date)
|
38
|
+
else
|
39
|
+
date_formatted = date.strftime(format)
|
40
|
+
date_formatted.gsub!(/%o/, ordinal(date.strftime('%e').to_i))
|
41
|
+
end
|
42
|
+
date_formatted
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
module Jekyll
|
50
|
+
|
51
|
+
class Post
|
52
|
+
include Octopress::Date
|
53
|
+
|
54
|
+
# Convert this post into a Hash for use in Liquid templates.
|
55
|
+
#
|
56
|
+
# Returns <Hash>
|
57
|
+
def to_liquid
|
58
|
+
date_format = self.site.config['date_format']
|
59
|
+
self.data.deep_merge({
|
60
|
+
"title" => self.data['title'] || self.slug.split('-').select {|w| w.capitalize! || w }.join(' '),
|
61
|
+
"url" => self.url,
|
62
|
+
"date" => self.date,
|
63
|
+
# Monkey patch
|
64
|
+
"date_formatted" => format_date(self.date, date_format),
|
65
|
+
"updated_formatted" => self.data.has_key?('updated') ? format_date(self.data['updated'], date_format) : nil,
|
66
|
+
"id" => self.id,
|
67
|
+
"categories" => self.categories,
|
68
|
+
"next" => self.next,
|
69
|
+
"previous" => self.previous,
|
70
|
+
"tags" => self.tags,
|
71
|
+
"content" => self.content })
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
class Page
|
76
|
+
include Octopress::Date
|
77
|
+
|
78
|
+
# Initialize a new Page.
|
79
|
+
#
|
80
|
+
# site - The Site object.
|
81
|
+
# base - The String path to the source.
|
82
|
+
# dir - The String path between the source and the file.
|
83
|
+
# name - The String filename of the file.
|
84
|
+
def initialize(site, base, dir, name)
|
85
|
+
@site = site
|
86
|
+
@base = base
|
87
|
+
@dir = dir
|
88
|
+
@name = name
|
89
|
+
|
90
|
+
self.process(name)
|
91
|
+
self.read_yaml(File.join(base, dir), name)
|
92
|
+
# Monkey patch
|
93
|
+
date_format = self.site.config['date_format']
|
94
|
+
self.data['date_formatted'] = format_date(self.data['date'], date_format) if self.data.has_key?('date')
|
95
|
+
self.data['updated_formatted'] = format_date(self.data['updated'], date_format) if self.data.has_key?('updated')
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
# A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers.
|
2
|
+
# by: Brandon Tilly
|
3
|
+
# Source URL: https://gist.github.com/1027674
|
4
|
+
# Post http://brandontilley.com/2011/01/31/gist-tag-for-jekyll.html
|
5
|
+
#
|
6
|
+
# Example usage: {% gist 1027674 gist_tag.rb %} //embeds a gist for this plugin
|
7
|
+
|
8
|
+
require 'cgi'
|
9
|
+
require 'digest/md5'
|
10
|
+
require 'net/https'
|
11
|
+
require 'uri'
|
12
|
+
|
13
|
+
module Jekyll
|
14
|
+
class GistTag < Liquid::Tag
|
15
|
+
def initialize(tag_name, text, token)
|
16
|
+
super
|
17
|
+
@text = text
|
18
|
+
@cache_disabled = false
|
19
|
+
@cache_folder = File.expand_path "../.gist-cache", File.dirname(__FILE__)
|
20
|
+
FileUtils.mkdir_p @cache_folder
|
21
|
+
end
|
22
|
+
|
23
|
+
def render(context)
|
24
|
+
if parts = @text.match(/([\d]*) (.*)/)
|
25
|
+
gist, file = parts[1].strip, parts[2].strip
|
26
|
+
script_url = script_url_for gist, file
|
27
|
+
code = get_cached_gist(gist, file) || get_gist_from_web(gist, file)
|
28
|
+
html_output_for script_url, code
|
29
|
+
else
|
30
|
+
""
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def html_output_for(script_url, code)
|
35
|
+
code = CGI.escapeHTML code
|
36
|
+
<<-HTML
|
37
|
+
<div><script src='#{script_url}'></script>
|
38
|
+
<noscript><pre><code>#{code}</code></pre></noscript></div>
|
39
|
+
HTML
|
40
|
+
end
|
41
|
+
|
42
|
+
def script_url_for(gist_id, filename)
|
43
|
+
"https://gist.github.com/#{gist_id}.js?file=#{filename}"
|
44
|
+
end
|
45
|
+
|
46
|
+
def get_gist_url_for(gist, file)
|
47
|
+
"https://raw.github.com/gist/#{gist}/#{file}"
|
48
|
+
end
|
49
|
+
|
50
|
+
def cache(gist, file, data)
|
51
|
+
cache_file = get_cache_file_for gist, file
|
52
|
+
File.open(cache_file, "w") do |io|
|
53
|
+
io.write data
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def get_cached_gist(gist, file)
|
58
|
+
return nil if @cache_disabled
|
59
|
+
cache_file = get_cache_file_for gist, file
|
60
|
+
File.read cache_file if File.exist? cache_file
|
61
|
+
end
|
62
|
+
|
63
|
+
def get_cache_file_for(gist, file)
|
64
|
+
bad_chars = /[^a-zA-Z0-9\-_.]/
|
65
|
+
gist = gist.gsub bad_chars, ''
|
66
|
+
file = file.gsub bad_chars, ''
|
67
|
+
md5 = Digest::MD5.hexdigest "#{gist}-#{file}"
|
68
|
+
File.join @cache_folder, "#{gist}-#{file}-#{md5}.cache"
|
69
|
+
end
|
70
|
+
|
71
|
+
def get_gist_from_web(gist, file)
|
72
|
+
gist_url = get_gist_url_for gist, file
|
73
|
+
raw_uri = URI.parse gist_url
|
74
|
+
proxy = ENV['http_proxy']
|
75
|
+
if proxy
|
76
|
+
proxy_uri = URI.parse(proxy)
|
77
|
+
https = Net::HTTP::Proxy(proxy_uri.host, proxy_uri.port).new raw_uri.host, raw_uri.port
|
78
|
+
else
|
79
|
+
https = Net::HTTP.new raw_uri.host, raw_uri.port
|
80
|
+
end
|
81
|
+
https.use_ssl = true
|
82
|
+
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
83
|
+
request = Net::HTTP::Get.new raw_uri.request_uri
|
84
|
+
data = https.request request
|
85
|
+
data = data.body
|
86
|
+
cache gist, file, data unless @cache_disabled
|
87
|
+
data
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
class GistTagNoCache < GistTag
|
92
|
+
def initialize(tag_name, text, token)
|
93
|
+
super
|
94
|
+
@cache_disabled = true
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
Liquid::Template.register_tag('gist', Jekyll::GistTag)
|
100
|
+
Liquid::Template.register_tag('gistnocache', Jekyll::GistTagNoCache)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Jekyll
|
2
|
+
require 'haml'
|
3
|
+
class HamlConverter < Converter
|
4
|
+
safe true
|
5
|
+
priority :low
|
6
|
+
|
7
|
+
def matches(ext)
|
8
|
+
ext =~ /haml/i
|
9
|
+
end
|
10
|
+
|
11
|
+
def output_ext(ext)
|
12
|
+
".html"
|
13
|
+
end
|
14
|
+
|
15
|
+
def convert(content)
|
16
|
+
begin
|
17
|
+
engine = Haml::Engine.new(content)
|
18
|
+
engine.render
|
19
|
+
rescue StandardError => e
|
20
|
+
puts "!!! HAML Error: " + e.message
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# Title: Simple Image tag for Jekyll
|
2
|
+
# Authors: Brandon Mathis http://brandonmathis.com
|
3
|
+
# Felix Schäfer, Frederic Hemberger
|
4
|
+
# Description: Easily output images with optional class names, width, height, title and alt attributes
|
5
|
+
#
|
6
|
+
# Syntax {% img [class name(s)] [http[s]:/]/path/to/image [width [height]] [title text | "title text" ["alt text"]] %}
|
7
|
+
#
|
8
|
+
# Examples:
|
9
|
+
# {% img /images/ninja.png Ninja Attack! %}
|
10
|
+
# {% img left half http://site.com/images/ninja.png Ninja Attack! %}
|
11
|
+
# {% img left half http://site.com/images/ninja.png 150 150 "Ninja Attack!" "Ninja in attack posture" %}
|
12
|
+
#
|
13
|
+
# Output:
|
14
|
+
# <img src="/images/ninja.png">
|
15
|
+
# <img class="left half" src="http://site.com/images/ninja.png" title="Ninja Attack!" alt="Ninja Attack!">
|
16
|
+
# <img class="left half" src="http://site.com/images/ninja.png" width="150" height="150" title="Ninja Attack!" alt="Ninja in attack posture">
|
17
|
+
#
|
18
|
+
|
19
|
+
module Jekyll
|
20
|
+
|
21
|
+
class ImageTag < Liquid::Tag
|
22
|
+
@img = nil
|
23
|
+
|
24
|
+
def initialize(tag_name, markup, tokens)
|
25
|
+
attributes = ['class', 'src', 'width', 'height', 'title']
|
26
|
+
|
27
|
+
if markup =~ /(?<class>\S.*\s+)?(?<src>(?:https?:\/\/|\/|\S+\/)\S+)(?:\s+(?<width>\d+))?(?:\s+(?<height>\d+))?(?<title>\s+.+)?/i
|
28
|
+
@img = attributes.reduce({}) { |img, attr| img[attr] = $~[attr].strip if $~[attr]; img }
|
29
|
+
if /(?:"|')(?<title>[^"']+)?(?:"|')\s+(?:"|')(?<alt>[^"']+)?(?:"|')/ =~ @img['title']
|
30
|
+
@img['title'] = title
|
31
|
+
@img['alt'] = alt
|
32
|
+
else
|
33
|
+
@img['alt'] = @img['title'].gsub!(/"/, '"') if @img['title']
|
34
|
+
end
|
35
|
+
@img['class'].gsub!(/"/, '') if @img['class']
|
36
|
+
end
|
37
|
+
super
|
38
|
+
end
|
39
|
+
|
40
|
+
def render(context)
|
41
|
+
if @img
|
42
|
+
"<img #{@img.collect {|k,v| "#{k}=\"#{v}\"" if v}.join(" ")}>"
|
43
|
+
else
|
44
|
+
"Error processing input, expected syntax: {% img [class name(s)] [http[s]:/]/path/to/image [width [height]] [title text | \"title text\" [\"alt text\"]] %}"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
Liquid::Template.register_tag('img', Jekyll::ImageTag)
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# Title: Include Array Tag for Jekyll
|
2
|
+
# Author: Jason Woodward http://www.woodwardjd.com
|
3
|
+
# Description: Import files on your filesystem as specified in a configuration variable in _config.yml. Mostly cribbed from Jekyll's include tag.
|
4
|
+
# Syntax: {% include_array variable_name_from_config.yml %}
|
5
|
+
#
|
6
|
+
# Example 1:
|
7
|
+
# {% include_array asides %}
|
8
|
+
#
|
9
|
+
# _config.yml snippet:
|
10
|
+
# asides: [asides/twitter.html, asides/custom/my_picture.html]
|
11
|
+
#
|
12
|
+
module Jekyll
|
13
|
+
|
14
|
+
class IncludeArrayTag < Liquid::Tag
|
15
|
+
Syntax = /(#{Liquid::QuotedFragment}+)/
|
16
|
+
def initialize(tag_name, markup, tokens)
|
17
|
+
if markup =~ Syntax
|
18
|
+
@array_name = $1
|
19
|
+
else
|
20
|
+
raise SyntaxError.new("Error in tag 'include_array' - Valid syntax: include_array [array from _config.yml]")
|
21
|
+
end
|
22
|
+
|
23
|
+
super
|
24
|
+
end
|
25
|
+
|
26
|
+
def render(context)
|
27
|
+
includes_dir = File.join(context.registers[:site].source, '_includes')
|
28
|
+
|
29
|
+
if File.symlink?(includes_dir)
|
30
|
+
return "Includes directory '#{includes_dir}' cannot be a symlink"
|
31
|
+
end
|
32
|
+
|
33
|
+
rtn = ''
|
34
|
+
(context.environments.first['site'][@array_name] || []).each do |file|
|
35
|
+
if file !~ /^[a-zA-Z0-9_\/\.-]+$/ || file =~ /\.\// || file =~ /\/\./
|
36
|
+
rtn = rtn + "Include file '#{file}' contains invalid characters or sequences"
|
37
|
+
end
|
38
|
+
|
39
|
+
Dir.chdir(includes_dir) do
|
40
|
+
choices = Dir['**/*'].reject { |x| File.symlink?(x) }
|
41
|
+
if choices.include?(file)
|
42
|
+
source = File.read(file)
|
43
|
+
partial = Liquid::Template.parse(source)
|
44
|
+
context.stack do
|
45
|
+
rtn = rtn + partial.render(context)
|
46
|
+
end
|
47
|
+
else
|
48
|
+
rtn = rtn + "Included file '#{file}' not found in _includes directory"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
rtn
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
Liquid::Template.register_tag('include_array', Jekyll::IncludeArrayTag)
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# Title: Include Code Tag for Jekyll
|
2
|
+
# Author: Brandon Mathis http://brandonmathis.com
|
3
|
+
# Description: Import files on your filesystem into any blog post as embedded code snippets with syntax highlighting and a download link.
|
4
|
+
# Configuration: You can set default import path in _config.yml (defaults to code_dir: downloads/code)
|
5
|
+
#
|
6
|
+
# Syntax {% include_code path/to/file %}
|
7
|
+
#
|
8
|
+
# Example 1:
|
9
|
+
# {% include_code javascripts/test.js %}
|
10
|
+
#
|
11
|
+
# This will import test.js from source/downloads/code/javascripts/test.js
|
12
|
+
# and output the contents in a syntax highlighted code block inside a figure,
|
13
|
+
# with a figcaption listing the file name and download link
|
14
|
+
#
|
15
|
+
# Example 2:
|
16
|
+
# You can also include an optional title for the <figcaption>
|
17
|
+
#
|
18
|
+
# {% include_code Example 2 javascripts/test.js %}
|
19
|
+
#
|
20
|
+
# will output a figcaption with the title: Example 2 (test.js)
|
21
|
+
#
|
22
|
+
|
23
|
+
require './plugins/pygments_code'
|
24
|
+
require './plugins/raw'
|
25
|
+
require 'pathname'
|
26
|
+
|
27
|
+
module Jekyll
|
28
|
+
|
29
|
+
class IncludeCodeTag < Liquid::Tag
|
30
|
+
include HighlightCode
|
31
|
+
include TemplateWrapper
|
32
|
+
def initialize(tag_name, markup, tokens)
|
33
|
+
@title = nil
|
34
|
+
@file = nil
|
35
|
+
if markup.strip =~ /\s*lang:(\w+)/i
|
36
|
+
@filetype = $1
|
37
|
+
markup = markup.strip.sub(/lang:\w+/i,'')
|
38
|
+
end
|
39
|
+
if markup.strip =~ /(.*)?(\s+|^)(\/*\S+)/i
|
40
|
+
@title = $1 || nil
|
41
|
+
@file = $3
|
42
|
+
end
|
43
|
+
super
|
44
|
+
end
|
45
|
+
|
46
|
+
def render(context)
|
47
|
+
code_dir = (context.registers[:site].config['code_dir'].sub(/^\//,'') || 'downloads/code')
|
48
|
+
code_path = (Pathname.new(context.registers[:site].source) + code_dir).expand_path
|
49
|
+
file = code_path + @file
|
50
|
+
|
51
|
+
if File.symlink?(code_path)
|
52
|
+
return "Code directory '#{code_path}' cannot be a symlink"
|
53
|
+
end
|
54
|
+
|
55
|
+
unless file.file?
|
56
|
+
return "File #{file} could not be found"
|
57
|
+
end
|
58
|
+
|
59
|
+
Dir.chdir(code_path) do
|
60
|
+
code = file.read
|
61
|
+
@filetype = file.extname.sub('.','') if @filetype.nil?
|
62
|
+
title = @title ? "#{@title} (#{file.basename})" : file.basename
|
63
|
+
url = "/#{code_dir}/#{@file}"
|
64
|
+
source = "<figure class='code'><figcaption><span>#{title}</span> <a href='#{url}'>download</a></figcaption>\n"
|
65
|
+
source += " #{highlight(code, @filetype)}</figure>"
|
66
|
+
safe_wrap(source)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
Liquid::Template.register_tag('include_code', Jekyll::IncludeCodeTag)
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# Title: jsFiddle tag for Jekyll
|
2
|
+
# Author: Brian Arnold (@brianarn)
|
3
|
+
# Description:
|
4
|
+
# Given a jsFiddle shortcode, outputs the jsFiddle iframe code.
|
5
|
+
# Using 'default' will preserve defaults as specified by jsFiddle.
|
6
|
+
#
|
7
|
+
# Syntax: {% jsfiddle shorttag [tabs] [skin] [height] [width] %}
|
8
|
+
#
|
9
|
+
# Examples:
|
10
|
+
#
|
11
|
+
# Input: {% jsfiddle ccWP7 %}
|
12
|
+
# Output: <iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/ccWP7/embedded/js,resources,html,css,result/light/"></iframe>
|
13
|
+
#
|
14
|
+
# Input: {% jsfiddle ccWP7 js,html,result %}
|
15
|
+
# Output: <iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/ccWP7/embedded/js,html,result/light/"></iframe>
|
16
|
+
#
|
17
|
+
|
18
|
+
module Jekyll
|
19
|
+
class JsFiddle < Liquid::Tag
|
20
|
+
def initialize(tag_name, markup, tokens)
|
21
|
+
if /(?<fiddle>\w+)(?:\s+(?<sequence>[\w,]+))?(?:\s+(?<skin>\w+))?(?:\s+(?<height>\w+))?(?:\s+(?<width>\w+))?/ =~ markup
|
22
|
+
@fiddle = fiddle
|
23
|
+
@sequence = (sequence unless sequence == 'default') || 'js,resources,html,css,result'
|
24
|
+
@skin = (skin unless skin == 'default') || 'light'
|
25
|
+
@width = width || '100%'
|
26
|
+
@height = height || '300px'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def render(context)
|
31
|
+
if @fiddle
|
32
|
+
"<iframe style=\"width: #{@width}; height: #{@height}\" src=\"http://jsfiddle.net/#{@fiddle}/embedded/#{@sequence}/#{@skin}/\"></iframe>"
|
33
|
+
else
|
34
|
+
"Error processing input, expected syntax: {% jsfiddle shorttag [tabs] [skin] [height] [width] %}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
Liquid::Template.register_tag('jsfiddle', Jekyll::JsFiddle)
|