link-checker 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,99 @@
|
|
|
1
|
+
# ----------------------- #
|
|
2
|
+
# Main Configs #
|
|
3
|
+
# ----------------------- #
|
|
4
|
+
|
|
5
|
+
url: http://yoursite.com
|
|
6
|
+
title: My Octopress Blog
|
|
7
|
+
subtitle: A blogging framework for hackers.
|
|
8
|
+
author: Your Name
|
|
9
|
+
simple_search: http://google.com/search
|
|
10
|
+
description:
|
|
11
|
+
|
|
12
|
+
# Default date format is "ordinal" (resulting in "July 22nd 2007")
|
|
13
|
+
# You can customize the format as defined in
|
|
14
|
+
# http://www.ruby-doc.org/core-1.9.2/Time.html#method-i-strftime
|
|
15
|
+
# Additionally, %o will give you the ordinal representation of the day
|
|
16
|
+
date_format: "ordinal"
|
|
17
|
+
|
|
18
|
+
# RSS / Email (optional) subscription links (change if using something like Feedburner)
|
|
19
|
+
subscribe_rss: /atom.xml
|
|
20
|
+
subscribe_email:
|
|
21
|
+
# RSS feeds can list your email address if you like
|
|
22
|
+
email:
|
|
23
|
+
|
|
24
|
+
# ----------------------- #
|
|
25
|
+
# Jekyll & Plugins #
|
|
26
|
+
# ----------------------- #
|
|
27
|
+
|
|
28
|
+
# If publishing to a subdirectory as in http://site.com/project set 'root: /project'
|
|
29
|
+
root: /
|
|
30
|
+
permalink: /blog/:year/:month/:day/:title/
|
|
31
|
+
source: source
|
|
32
|
+
destination: public
|
|
33
|
+
plugins: plugins
|
|
34
|
+
code_dir: downloads/code
|
|
35
|
+
category_dir: blog/categories
|
|
36
|
+
markdown: rdiscount
|
|
37
|
+
pygments: false # default python pygments have been replaced by pygments.rb
|
|
38
|
+
|
|
39
|
+
paginate: 10 # Posts per page on the blog index
|
|
40
|
+
pagination_dir: blog # Directory base for pagination URLs eg. /blog/page/2/
|
|
41
|
+
recent_posts: 5 # Posts in the sidebar Recent Posts section
|
|
42
|
+
excerpt_link: "Read on →" # "Continue reading" link text at the bottom of excerpted articles
|
|
43
|
+
|
|
44
|
+
titlecase: true # Converts page and post titles to titlecase
|
|
45
|
+
|
|
46
|
+
# list each of the sidebar modules you want to include, in the order you want them to appear.
|
|
47
|
+
# To add custom asides, create files in /source/_includes/custom/asides/ and add them to the list like 'custom/asides/custom_aside_name.html'
|
|
48
|
+
default_asides: [asides/recent_posts.html, asides/github.html, asides/twitter.html, asides/delicious.html, asides/pinboard.html, asides/googleplus.html]
|
|
49
|
+
|
|
50
|
+
# Each layout uses the default asides, but they can have their own asides instead. Simply uncomment the lines below
|
|
51
|
+
# and add an array with the asides you want to use.
|
|
52
|
+
# blog_index_asides:
|
|
53
|
+
# post_asides:
|
|
54
|
+
# page_asides:
|
|
55
|
+
|
|
56
|
+
# ----------------------- #
|
|
57
|
+
# 3rd Party Settings #
|
|
58
|
+
# ----------------------- #
|
|
59
|
+
|
|
60
|
+
# Github repositories
|
|
61
|
+
github_user:
|
|
62
|
+
github_repo_count: 0
|
|
63
|
+
github_show_profile_link: true
|
|
64
|
+
github_skip_forks: true
|
|
65
|
+
|
|
66
|
+
# Twitter
|
|
67
|
+
twitter_user:
|
|
68
|
+
twitter_tweet_count: 4
|
|
69
|
+
twitter_show_replies: false
|
|
70
|
+
twitter_follow_button: true
|
|
71
|
+
twitter_show_follower_count: false
|
|
72
|
+
twitter_tweet_button: true
|
|
73
|
+
|
|
74
|
+
# Google +1
|
|
75
|
+
google_plus_one: false
|
|
76
|
+
google_plus_one_size: medium
|
|
77
|
+
|
|
78
|
+
# Google Plus Profile
|
|
79
|
+
# Hidden: No visible button, just add author information to search results
|
|
80
|
+
googleplus_user:
|
|
81
|
+
googleplus_hidden: false
|
|
82
|
+
|
|
83
|
+
# Pinboard
|
|
84
|
+
pinboard_user:
|
|
85
|
+
pinboard_count: 3
|
|
86
|
+
|
|
87
|
+
# Delicious
|
|
88
|
+
delicious_user:
|
|
89
|
+
delicious_count: 3
|
|
90
|
+
|
|
91
|
+
# Disqus Comments
|
|
92
|
+
disqus_short_name:
|
|
93
|
+
disqus_show_comment_count: false
|
|
94
|
+
|
|
95
|
+
# Google Analytics
|
|
96
|
+
google_analytics_tracking_id:
|
|
97
|
+
|
|
98
|
+
# Facebook Like
|
|
99
|
+
facebook_like: false
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Require any additional compass plugins here.
|
|
2
|
+
project_type = :stand_alone
|
|
3
|
+
|
|
4
|
+
# Publishing paths
|
|
5
|
+
http_path = "/"
|
|
6
|
+
http_images_path = "/images"
|
|
7
|
+
http_fonts_path = "/fonts"
|
|
8
|
+
css_dir = "public/stylesheets"
|
|
9
|
+
|
|
10
|
+
# Local development paths
|
|
11
|
+
sass_dir = "sass"
|
|
12
|
+
images_dir = "source/images"
|
|
13
|
+
fonts_dir = "source/fonts"
|
|
14
|
+
|
|
15
|
+
line_comments = false
|
|
16
|
+
output_style = :compressed
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
require 'bundler/setup'
|
|
2
|
+
require 'sinatra/base'
|
|
3
|
+
|
|
4
|
+
# The project root directory
|
|
5
|
+
$root = ::File.dirname(__FILE__)
|
|
6
|
+
|
|
7
|
+
class SinatraStaticServer < Sinatra::Base
|
|
8
|
+
|
|
9
|
+
get(/.+/) do
|
|
10
|
+
send_sinatra_file(request.path) {404}
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
not_found do
|
|
14
|
+
send_sinatra_file('404.html') {"Sorry, I cannot find #{request.path}"}
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def send_sinatra_file(path, &missing_file_block)
|
|
18
|
+
file_path = File.join(File.dirname(__FILE__), 'public', path)
|
|
19
|
+
file_path = File.join(file_path, 'index.html') unless file_path =~ /\.[a-z]+$/i
|
|
20
|
+
File.exist?(file_path) ? send_file(file_path) : missing_file_block.call
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
run SinatraStaticServer
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
require './plugins/pygments_code'
|
|
2
|
+
|
|
3
|
+
module BacktickCodeBlock
|
|
4
|
+
include HighlightCode
|
|
5
|
+
AllOptions = /([^\s]+)\s+(.+?)(https?:\/\/\S+)\s*(.+)?/i
|
|
6
|
+
LangCaption = /([^\s]+)\s*(.+)?/i
|
|
7
|
+
def render_code_block(input)
|
|
8
|
+
@options = nil
|
|
9
|
+
@caption = nil
|
|
10
|
+
@lang = nil
|
|
11
|
+
@url = nil
|
|
12
|
+
@title = nil
|
|
13
|
+
input.gsub(/^`{3} *([^\n]+)?\n(.+?)\n`{3}/m) do
|
|
14
|
+
@options = $1 || ''
|
|
15
|
+
str = $2
|
|
16
|
+
|
|
17
|
+
if @options =~ AllOptions
|
|
18
|
+
@lang = $1
|
|
19
|
+
@caption = "<figcaption><span>#{$2}</span><a href='#{$3}'>#{$4 || 'link'}</a></figcaption>"
|
|
20
|
+
elsif @options =~ LangCaption
|
|
21
|
+
@lang = $1
|
|
22
|
+
@caption = "<figcaption><span>#{$2}</span></figcaption>"
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
if str.match(/\A( {4}|\t)/)
|
|
26
|
+
str = str.gsub(/^( {4}|\t)/, '')
|
|
27
|
+
end
|
|
28
|
+
if @lang.nil? || @lang == 'plain'
|
|
29
|
+
code = tableize_code(str.gsub('<','<').gsub('>','>'))
|
|
30
|
+
"<figure class='code'>#{@caption}#{code}</figure>"
|
|
31
|
+
else
|
|
32
|
+
if @lang.include? "-raw"
|
|
33
|
+
raw = "``` #{@options.sub('-raw', '')}\n"
|
|
34
|
+
raw += str
|
|
35
|
+
raw += "\n```\n"
|
|
36
|
+
else
|
|
37
|
+
code = highlight(str, @lang)
|
|
38
|
+
"<figure class='code'>#{@caption}#{code}</figure>"
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Author: Brandon Mathis
|
|
3
|
+
# A full rewrite based on the work of: Josediaz Gonzalez - https://github.com/josegonzalez/josediazgonzalez.com/blob/master/_plugins/blockquote.rb
|
|
4
|
+
#
|
|
5
|
+
# Outputs a string with a given attribution as a quote
|
|
6
|
+
#
|
|
7
|
+
# {% blockquote Bobby Willis http://google.com/search?q=pants the search for bobby's pants %}
|
|
8
|
+
# Wheeee!
|
|
9
|
+
# {% endblockquote %}
|
|
10
|
+
# ...
|
|
11
|
+
# <blockquote>
|
|
12
|
+
# <p>Wheeee!</p>
|
|
13
|
+
# <footer>
|
|
14
|
+
# <strong>Bobby Willis</strong><cite><a href="http://google.com/search?q=pants">The Search For Bobby's Pants</a>
|
|
15
|
+
# </blockquote>
|
|
16
|
+
#
|
|
17
|
+
require './plugins/titlecase.rb'
|
|
18
|
+
|
|
19
|
+
module Jekyll
|
|
20
|
+
|
|
21
|
+
class Blockquote < Liquid::Block
|
|
22
|
+
FullCiteWithTitle = /(\S.*)\s+(https?:\/\/)(\S+)\s+(.+)/i
|
|
23
|
+
FullCite = /(\S.*)\s+(https?:\/\/)(\S+)/i
|
|
24
|
+
Author = /(.+)/
|
|
25
|
+
|
|
26
|
+
def initialize(tag_name, markup, tokens)
|
|
27
|
+
@by = nil
|
|
28
|
+
@source = nil
|
|
29
|
+
@title = nil
|
|
30
|
+
if markup =~ FullCiteWithTitle
|
|
31
|
+
@by = $1
|
|
32
|
+
@source = $2 + $3
|
|
33
|
+
@title = $4.titlecase
|
|
34
|
+
elsif markup =~ FullCite
|
|
35
|
+
@by = $1
|
|
36
|
+
@source = $2 + $3
|
|
37
|
+
elsif markup =~ Author
|
|
38
|
+
if $1 =~ /([^,]+),([^,]+)/
|
|
39
|
+
@by = $1
|
|
40
|
+
@title = $2.titlecase
|
|
41
|
+
else
|
|
42
|
+
@by = $1
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
super
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def render(context)
|
|
49
|
+
quote = paragraphize(super)
|
|
50
|
+
author = "<strong>#{@by.strip}</strong>" if @by
|
|
51
|
+
if @source
|
|
52
|
+
url = @source.match(/https?:\/\/(.+)/)[1].split('/')
|
|
53
|
+
parts = []
|
|
54
|
+
url.each do |part|
|
|
55
|
+
if (parts + [part]).join('/').length < 32
|
|
56
|
+
parts << part
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
source = parts.join('/')
|
|
60
|
+
source << '/…' unless source == @source
|
|
61
|
+
end
|
|
62
|
+
if !@source.nil?
|
|
63
|
+
cite = " <cite><a href='#{@source}'>#{(@title || source)}</a></cite>"
|
|
64
|
+
elsif !@title.nil?
|
|
65
|
+
cite = " <cite>#{@title}</cite>"
|
|
66
|
+
end
|
|
67
|
+
blockquote = if @by.nil?
|
|
68
|
+
quote
|
|
69
|
+
elsif cite
|
|
70
|
+
"#{quote}<footer>#{author + cite}</footer>"
|
|
71
|
+
else
|
|
72
|
+
"#{quote}<footer>#{author}</footer>"
|
|
73
|
+
end
|
|
74
|
+
"<blockquote>#{blockquote}</blockquote>"
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def paragraphize(input)
|
|
78
|
+
"<p>#{input.lstrip.rstrip.gsub(/\n\n/, '</p><p>').gsub(/\n/, '<br/>')}</p>"
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
Liquid::Template.register_tag('blockquote', Jekyll::Blockquote)
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
#
|
|
3
|
+
# Jekyll category page generator.
|
|
4
|
+
# http://recursive-design.com/projects/jekyll-plugins/
|
|
5
|
+
#
|
|
6
|
+
# Version: 0.1.4 (201101061053)
|
|
7
|
+
#
|
|
8
|
+
# Copyright (c) 2010 Dave Perrett, http://recursive-design.com/
|
|
9
|
+
# Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
10
|
+
#
|
|
11
|
+
# A generator that creates category pages for jekyll sites.
|
|
12
|
+
#
|
|
13
|
+
# Included filters :
|
|
14
|
+
# - category_links: Outputs the list of categories as comma-separated <a> links.
|
|
15
|
+
# - date_to_html_string: Outputs the post.date as formatted html, with hooks for CSS styling.
|
|
16
|
+
#
|
|
17
|
+
# Available _config.yml settings :
|
|
18
|
+
# - category_dir: The subfolder to build category pages in (default is 'categories').
|
|
19
|
+
# - category_title_prefix: The string used before the category name in the page title (default is
|
|
20
|
+
# 'Category: ').
|
|
21
|
+
|
|
22
|
+
module Jekyll
|
|
23
|
+
|
|
24
|
+
# The CategoryIndex class creates a single category page for the specified category.
|
|
25
|
+
class CategoryIndex < Page
|
|
26
|
+
|
|
27
|
+
# Initializes a new CategoryIndex.
|
|
28
|
+
#
|
|
29
|
+
# +base+ is the String path to the <source>.
|
|
30
|
+
# +category_dir+ is the String path between <source> and the category folder.
|
|
31
|
+
# +category+ is the category currently being processed.
|
|
32
|
+
def initialize(site, base, category_dir, category)
|
|
33
|
+
@site = site
|
|
34
|
+
@base = base
|
|
35
|
+
@dir = category_dir
|
|
36
|
+
@name = 'index.html'
|
|
37
|
+
self.process(@name)
|
|
38
|
+
# Read the YAML data from the layout page.
|
|
39
|
+
self.read_yaml(File.join(base, '_layouts'), 'category_index.html')
|
|
40
|
+
self.data['category'] = category
|
|
41
|
+
# Set the title for this page.
|
|
42
|
+
title_prefix = site.config['category_title_prefix'] || 'Category: '
|
|
43
|
+
self.data['title'] = "#{title_prefix}#{category}"
|
|
44
|
+
# Set the meta-description for this page.
|
|
45
|
+
meta_description_prefix = site.config['category_meta_description_prefix'] || 'Category: '
|
|
46
|
+
self.data['description'] = "#{meta_description_prefix}#{category}"
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# The CategoryFeed class creates an Atom feed for the specified category.
|
|
52
|
+
class CategoryFeed < Page
|
|
53
|
+
|
|
54
|
+
# Initializes a new CategoryFeed.
|
|
55
|
+
#
|
|
56
|
+
# +base+ is the String path to the <source>.
|
|
57
|
+
# +category_dir+ is the String path between <source> and the category folder.
|
|
58
|
+
# +category+ is the category currently being processed.
|
|
59
|
+
def initialize(site, base, category_dir, category)
|
|
60
|
+
@site = site
|
|
61
|
+
@base = base
|
|
62
|
+
@dir = category_dir
|
|
63
|
+
@name = 'atom.xml'
|
|
64
|
+
self.process(@name)
|
|
65
|
+
# Read the YAML data from the layout page.
|
|
66
|
+
self.read_yaml(File.join(base, '_includes/custom'), 'category_feed.xml')
|
|
67
|
+
self.data['category'] = category
|
|
68
|
+
# Set the title for this page.
|
|
69
|
+
title_prefix = site.config['category_title_prefix'] || 'Category: '
|
|
70
|
+
self.data['title'] = "#{title_prefix}#{category}"
|
|
71
|
+
# Set the meta-description for this page.
|
|
72
|
+
meta_description_prefix = site.config['category_meta_description_prefix'] || 'Category: '
|
|
73
|
+
self.data['description'] = "#{meta_description_prefix}#{category}"
|
|
74
|
+
|
|
75
|
+
# Set the correct feed URL.
|
|
76
|
+
self.data['feed_url'] = "#{category_dir}/#{name}"
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# The Site class is a built-in Jekyll class with access to global site config information.
|
|
82
|
+
class Site
|
|
83
|
+
|
|
84
|
+
# Creates an instance of CategoryIndex for each category page, renders it, and
|
|
85
|
+
# writes the output to a file.
|
|
86
|
+
#
|
|
87
|
+
# +category_dir+ is the String path to the category folder.
|
|
88
|
+
# +category+ is the category currently being processed.
|
|
89
|
+
def write_category_index(category_dir, category)
|
|
90
|
+
index = CategoryIndex.new(self, self.source, category_dir, category)
|
|
91
|
+
index.render(self.layouts, site_payload)
|
|
92
|
+
index.write(self.dest)
|
|
93
|
+
# Record the fact that this page has been added, otherwise Site::cleanup will remove it.
|
|
94
|
+
self.pages << index
|
|
95
|
+
|
|
96
|
+
# Create an Atom-feed for each index.
|
|
97
|
+
feed = CategoryFeed.new(self, self.source, category_dir, category)
|
|
98
|
+
feed.render(self.layouts, site_payload)
|
|
99
|
+
feed.write(self.dest)
|
|
100
|
+
# Record the fact that this page has been added, otherwise Site::cleanup will remove it.
|
|
101
|
+
self.pages << feed
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Loops through the list of category pages and processes each one.
|
|
105
|
+
def write_category_indexes
|
|
106
|
+
if self.layouts.key? 'category_index'
|
|
107
|
+
dir = self.config['category_dir'] || 'categories'
|
|
108
|
+
self.categories.keys.each do |category|
|
|
109
|
+
self.write_category_index(File.join(dir, category.gsub(/_|\P{Word}/, '-').gsub(/-{2,}/, '-').downcase), category)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Throw an exception if the layout couldn't be found.
|
|
113
|
+
else
|
|
114
|
+
throw "No 'category_index' layout found."
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
# Jekyll hook - the generate method is called by jekyll, and generates all of the category pages.
|
|
122
|
+
class GenerateCategories < Generator
|
|
123
|
+
safe true
|
|
124
|
+
priority :low
|
|
125
|
+
|
|
126
|
+
def generate(site)
|
|
127
|
+
site.write_category_indexes
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
# Adds some extra filters used during the category creation process.
|
|
134
|
+
module Filters
|
|
135
|
+
|
|
136
|
+
# Outputs a list of categories as comma-separated <a> links. This is used
|
|
137
|
+
# to output the category list for each post on a category page.
|
|
138
|
+
#
|
|
139
|
+
# +categories+ is the list of categories to format.
|
|
140
|
+
#
|
|
141
|
+
# Returns string
|
|
142
|
+
#
|
|
143
|
+
def category_links(categories)
|
|
144
|
+
dir = @context.registers[:site].config['category_dir']
|
|
145
|
+
categories = categories.sort!.map do |item|
|
|
146
|
+
"<a class='category' href='/#{dir}/#{item.gsub(/_|\P{Word}/, '-').gsub(/-{2,}/, '-').downcase}/'>#{item}</a>"
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
case categories.length
|
|
150
|
+
when 0
|
|
151
|
+
""
|
|
152
|
+
when 1
|
|
153
|
+
categories[0].to_s
|
|
154
|
+
else
|
|
155
|
+
"#{categories[0...-1].join(', ')}, #{categories[-1]}"
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Outputs the post.date as formatted html, with hooks for CSS styling.
|
|
160
|
+
#
|
|
161
|
+
# +date+ is the date object to format as HTML.
|
|
162
|
+
#
|
|
163
|
+
# Returns string
|
|
164
|
+
def date_to_html_string(date)
|
|
165
|
+
result = '<span class="month">' + date.strftime('%b').upcase + '</span> '
|
|
166
|
+
result += date.strftime('<span class="day">%d</span> ')
|
|
167
|
+
result += date.strftime('<span class="year">%Y</span> ')
|
|
168
|
+
result
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
end
|
|
174
|
+
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Title: Simple Code Blocks for Jekyll
|
|
2
|
+
# Author: Brandon Mathis http://brandonmathis.com
|
|
3
|
+
# Description: Write codeblocks with semantic HTML5 <figure> and <figcaption> elements and optional syntax highlighting — all with a simple, intuitive interface.
|
|
4
|
+
#
|
|
5
|
+
# Syntax:
|
|
6
|
+
# {% codeblock [title] [url] [link text] %}
|
|
7
|
+
# code snippet
|
|
8
|
+
# {% endcodeblock %}
|
|
9
|
+
#
|
|
10
|
+
# For syntax highlighting, put a file extension somewhere in the title. examples:
|
|
11
|
+
# {% codeblock file.sh %}
|
|
12
|
+
# code snippet
|
|
13
|
+
# {% endcodeblock %}
|
|
14
|
+
#
|
|
15
|
+
# {% codeblock Time to be Awesome! (awesome.rb) %}
|
|
16
|
+
# code snippet
|
|
17
|
+
# {% endcodeblock %}
|
|
18
|
+
#
|
|
19
|
+
# Example:
|
|
20
|
+
#
|
|
21
|
+
# {% codeblock Got pain? painreleif.sh http://site.com/painreleief.sh Download it! %}
|
|
22
|
+
# $ rm -rf ~/PAIN
|
|
23
|
+
# {% endcodeblock %}
|
|
24
|
+
#
|
|
25
|
+
# Output:
|
|
26
|
+
#
|
|
27
|
+
# <figure class='code'>
|
|
28
|
+
# <figcaption><span>Got pain? painrelief.sh</span> <a href="http://site.com/painrelief.sh">Download it!</a>
|
|
29
|
+
# <div class="highlight"><pre><code class="sh">
|
|
30
|
+
# -- nicely escaped highlighted code --
|
|
31
|
+
# </code></pre></div>
|
|
32
|
+
# </figure>
|
|
33
|
+
#
|
|
34
|
+
# Example 2 (no syntax highlighting):
|
|
35
|
+
#
|
|
36
|
+
# {% codeblock %}
|
|
37
|
+
# <sarcasm>Ooooh, sarcasm... How original!</sarcasm>
|
|
38
|
+
# {% endcodeblock %}
|
|
39
|
+
#
|
|
40
|
+
# <figure class='code'>
|
|
41
|
+
# <pre><code><sarcasm> Ooooh, sarcasm... How original!</sarcasm></code></pre>
|
|
42
|
+
# </figure>
|
|
43
|
+
#
|
|
44
|
+
require './plugins/pygments_code'
|
|
45
|
+
require './plugins/raw'
|
|
46
|
+
|
|
47
|
+
module Jekyll
|
|
48
|
+
|
|
49
|
+
class CodeBlock < Liquid::Block
|
|
50
|
+
include HighlightCode
|
|
51
|
+
include TemplateWrapper
|
|
52
|
+
CaptionUrlTitle = /(\S[\S\s]*)\s+(https?:\/\/)(\S+)\s+(.+)/i
|
|
53
|
+
CaptionUrl = /(\S[\S\s]*)\s+(https?:\/\/)(\S+)/i
|
|
54
|
+
Caption = /(\S[\S\s]*)/
|
|
55
|
+
def initialize(tag_name, markup, tokens)
|
|
56
|
+
@title = nil
|
|
57
|
+
@caption = nil
|
|
58
|
+
@filetype = nil
|
|
59
|
+
@highlight = true
|
|
60
|
+
if markup =~ /\s*lang:(\w+)/i
|
|
61
|
+
@filetype = $1
|
|
62
|
+
markup = markup.sub(/lang:\w+/i,'')
|
|
63
|
+
end
|
|
64
|
+
if markup =~ CaptionUrlTitle
|
|
65
|
+
@file = $1
|
|
66
|
+
@caption = "<figcaption><span>#{$1}</span><a href='#{$2 + $3}'>#{$4}</a></figcaption>"
|
|
67
|
+
elsif markup =~ CaptionUrl
|
|
68
|
+
@file = $1
|
|
69
|
+
@caption = "<figcaption><span>#{$1}</span><a href='#{$2 + $3}'>link</a></figcaption>"
|
|
70
|
+
elsif markup =~ Caption
|
|
71
|
+
@file = $1
|
|
72
|
+
@caption = "<figcaption><span>#{$1}</span></figcaption>\n"
|
|
73
|
+
end
|
|
74
|
+
if @file =~ /\S[\S\s]*\w+\.(\w+)/ && @filetype.nil?
|
|
75
|
+
@filetype = $1
|
|
76
|
+
end
|
|
77
|
+
super
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def render(context)
|
|
81
|
+
output = super
|
|
82
|
+
code = super
|
|
83
|
+
source = "<figure class='code'>"
|
|
84
|
+
source += @caption if @caption
|
|
85
|
+
if @filetype
|
|
86
|
+
source += " #{highlight(code, @filetype)}</figure>"
|
|
87
|
+
else
|
|
88
|
+
source += "#{tableize_code(code.lstrip.rstrip.gsub(/</,'<'))}</figure>"
|
|
89
|
+
end
|
|
90
|
+
source = safe_wrap(source)
|
|
91
|
+
source = context['pygments_prefix'] + source if context['pygments_prefix']
|
|
92
|
+
source = source + context['pygments_suffix'] if context['pygments_suffix']
|
|
93
|
+
source
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
Liquid::Template.register_tag('codeblock', Jekyll::CodeBlock)
|