Permalink
Browse files

Added javascript asset management and improved Rakefiles and configur…

…ation for themes and plugins.

- Added Guard for file watching
- Configs can be automatically reloaded
- Static asset changes do not trigger Jekyll build
- CommonJS modular js support proved by stich-rb
- Javascript is concatenated and uglified
- Environment variables toggle uglify and fingerprinting
- New Jekyll plugin config_tag
- New Jekyll plugin javascript_assets_tag
- Added theme specific configurations
- Custome Jekyll Guard to the rescue
- Install, Generate, Watch, and Preview work with Guard now.
- Now configs are no longer tracked by Octopress, only theme defauts are.
- Console messages can be colorized.
- misc config reorganization and improvements
  • Loading branch information...
1 parent 4972fb6 commit 7bdab0e65c86d8bd9fe3b46a4bf1ca92b1e1a54e @imathis committed Feb 10, 2013
Showing with 1,725 additions and 591 deletions.
  1. +10 −0 .themes/classic/_config/adn-timeline.yml
  2. +4 −0 .themes/classic/_config/delicious-feed.yml
  3. +0 −3 {_config/defaults → .themes/classic/_config}/deploy/gh_pages.yml
  4. +14 −0 .themes/classic/_config/deploy/rsync.yml
  5. 0 {_config/defaults → .themes/classic/_config}/disqus.yml
  6. +2 −0 .themes/classic/_config/facebook-like.yml
  7. 0 _config/defaults/gauges_analytics.yml → .themes/classic/_config/gauges-analytics.yml
  8. +24 −0 .themes/classic/_config/github-repos.yml
  9. 0 _config/defaults/google_analytics.yml → .themes/classic/_config/google-analytics.yml
  10. +7 −3 _config/defaults/google_plus.yml → .themes/classic/_config/google-plus.yml
  11. +6 −5 {_config/defaults → .themes/classic/_config}/jekyll.yml
  12. +4 −0 .themes/classic/_config/pinboard-feed.yml
  13. +17 −0 .themes/classic/_config/require-js.yml
  14. +12 −4 _config/defaults/classic.yml → .themes/classic/_config/theme.yml
  15. +19 −0 .themes/classic/_config/twitter-timeline.yml
  16. +68 −0 .themes/classic/assets/javascripts/adn-timeline.coffee
  17. +38 −0 .themes/classic/assets/javascripts/delicious-feed.coffee
  18. +60 −0 .themes/classic/assets/javascripts/github-repos.coffee
  19. +60 −0 .themes/classic/assets/javascripts/github.coffee
  20. +96 −0 .themes/classic/assets/javascripts/helpers.coffee
  21. +18 −0 .themes/classic/assets/javascripts/lib/ios-rotate-scaling-fix.js
  22. +92 −0 .themes/classic/assets/javascripts/lib/jquery.cookie.js
  23. +464 −0 .themes/classic/assets/javascripts/lib/modernizr.js
  24. +107 −0 .themes/classic/assets/javascripts/lib/octopress.js
  25. +0 −1 .themes/classic/{source → assets}/javascripts/lib/swfobject-dynamic.js
  26. +42 −0 .themes/classic/assets/javascripts/pinboard-feed.coffee
  27. +12 −0 .themes/classic/assets/javascripts/site.coffee
  28. +74 −0 .themes/classic/assets/javascripts/twitter-timeline.coffee
  29. 0 .themes/classic/{sass → assets/stylesheets}/_base.scss
  30. 0 .themes/classic/{sass → assets/stylesheets}/_partials.scss
  31. 0 .themes/classic/{sass → assets/stylesheets}/base/_layout.scss
  32. 0 .themes/classic/{sass → assets/stylesheets}/base/_solarized.scss
  33. 0 .themes/classic/{sass → assets/stylesheets}/base/_theme.scss
  34. 0 .themes/classic/{sass → assets/stylesheets}/base/_typography.scss
  35. 0 .themes/classic/{sass → assets/stylesheets}/base/_utilities.scss
  36. 0 .themes/classic/{sass → assets/stylesheets}/custom/_colors.scss
  37. 0 .themes/classic/{sass → assets/stylesheets}/custom/_fonts.scss
  38. 0 .themes/classic/{sass → assets/stylesheets}/custom/_layout.scss
  39. 0 .themes/classic/{sass → assets/stylesheets}/custom/_styles.scss
  40. 0 .themes/classic/{sass → assets/stylesheets}/partials/_archive.scss
  41. 0 .themes/classic/{sass → assets/stylesheets}/partials/_blog.scss
  42. 0 .themes/classic/{sass → assets/stylesheets}/partials/_footer.scss
  43. 0 .themes/classic/{sass → assets/stylesheets}/partials/_header.scss
  44. 0 .themes/classic/{sass → assets/stylesheets}/partials/_navigation.scss
  45. 0 .themes/classic/{sass → assets/stylesheets}/partials/_sharing.scss
  46. 0 .themes/classic/{sass → assets/stylesheets}/partials/_sidebar.scss
  47. 0 .themes/classic/{sass → assets/stylesheets}/partials/_syntax.scss
  48. 0 .themes/classic/{sass → assets/stylesheets}/partials/sidebar/_base.scss
  49. 0 .themes/classic/{sass → assets/stylesheets}/partials/sidebar/_delicious.scss
  50. 0 .themes/classic/{sass → assets/stylesheets}/partials/sidebar/_googleplus.scss
  51. 0 .themes/classic/{sass → assets/stylesheets}/partials/sidebar/_pinboard.scss
  52. 0 .themes/classic/{sass → assets/stylesheets}/partials/sidebar/_twitter.scss
  53. 0 .themes/classic/{sass → assets/stylesheets}/screen.scss
  54. +3 −1 .themes/classic/source/_includes/head.html
  55. +1 −3 .themes/classic/source/_includes/sidebars/sections/github.html
  56. +0 −4 .themes/classic/source/javascripts/group/jquery.min.js
  57. +0 −4 .themes/classic/source/javascripts/group/modernizr-2.0.min.js
  58. +0 −305 .themes/classic/source/javascripts/group/octopress.js
  59. +0 −62 .themes/classic/source/javascripts/group/pinboard.js
  60. +0 −12 .themes/classic/source/javascripts/group/swfobject-dynamic.min.js
  61. +5 −0 .themes/classic/source/javascripts/jquery.min.js
  62. +11 −3 Gemfile
  63. +51 −9 Gemfile.lock
  64. +38 −0 Guardfile
  65. +130 −81 Rakefile
  66. +0 −3 _config/defaults/delicious_stream.yml
  67. +0 −16 _config/defaults/deploy/rsync.yml
  68. +0 −10 _config/defaults/github_repos_sidebar.yml
  69. +0 −3 _config/defaults/pinboard_stream.yml
  70. +0 −18 _config/defaults/sharing_buttons.yml
  71. +0 −10 _config/defaults/twitter_stream.yml
  72. +0 −6 _config/deploy.yml
  73. +0 −5 _config/site.yml
  74. +14 −12 config.rb
  75. +42 −0 lib/colors.rb
  76. +35 −0 lib/guard/jekyll.rb
  77. +4 −2 lib/octopress.rb
  78. +18 −0 lib/octopress/configuration.rb
  79. +16 −2 lib/octopress/core_ext.rb
  80. +61 −0 lib/octopress/js_asset_manager.rb
  81. +29 −0 plugins/config_tag.rb
  82. +16 −0 plugins/js_assets.rb
  83. +1 −4 plugins/octopress_filters.rb
@@ -0,0 +1,10 @@
+---
+# -------------------------------- #
+# App.net Sidebar Plugin Configs #
+# -------------------------------- #
+
+adn:
+ user:
+ post-count: 4
+ show-replies: false
+ show-reposts: false
@@ -0,0 +1,4 @@
+# Delicious link stream
+delicious:
+ user:
+ count: 4
@@ -7,6 +7,3 @@
# This will be configured for you when you run config_deploy
deploy_branch: "gh-pages"
deploy_dir: "_deploy"
-
-# Hidden "dot" files that should be included with the deployed site (see task copydot)
-copy_dot_files: []
@@ -0,0 +1,14 @@
+---
+# ------------------------ #
+# RSync Config #
+# deploy_default: rsync #
+# ------------------------ #
+
+# Be sure your public key is listed in your server's ~/.ssh/authorized_keys file
+ssh_user: "user@domain.com"
+ssh_port: "22"
+document_root: "~/website.com/"
+rsync_delete: false
+rsync_args: "" # Any extra arguments to pass to rsync
+rsync_checksum: true # Attempts to only upload changed files
+deploy_dir: "_deploy"
File renamed without changes.
@@ -0,0 +1,2 @@
+# Facebook Like button on posts/pages
+facebook_like: false
@@ -0,0 +1,24 @@
+---
+# --------------------------------------- #
+# Github Sidebar Repos Listing Plugin #
+# --------------------------------------- #
+
+# Github repositories
+github_repos:
+ user:
+
+ # Automatically select repositories based on:
+ count: 4
+ skip_forks: true # Don't show repos you've forked from others
+ sort_by_watchers: true # Show your top watched projects, set to false to sort by last update
+
+
+ # Instead of fetching automatically, specify a list of repositories to include
+ # Setting repos will ignore the automatic settings above
+ repos:
+
+ # Example:
+ # user: imathis
+ # repos:
+ # - octopress
+ # - hsl-color-picker
@@ -4,6 +4,10 @@
# --------------------------------- #
# Hidden: No visible button, just add author information to search results
-googleplus_user:
-googleplus_hidden: false
-google_plus_image_size: 32
+googleplus:
+ user:
+ hidden: false
+ image_size: 32
+
+ # Google+ Sharing
+ plus_one: false
@@ -10,7 +10,7 @@ source: source # source file directory
destination: public # compiled site directory
plugins: plugins
code_dir: downloads/code
-category_dir: blog/categories
+category_dir: categories
include:
- .htaccess
markdown: redcarpet
@@ -22,14 +22,15 @@ redcarpet:
- superscript
- smart
pygments: false # Jekyll's default Python Pygments have been replaced by pygments.rb.
- # Set to true to use Albino + Python Pygments
+include:
+ - .htaccess
-env: production
-blog_index_dir: source # directory for your blog's index page (if you put your index in source/blog/index.html, set this to 'source/blog')
+env: production # affects asset compilation
+post_index_dir: source # directory for your posts index page (if you put your index in source/blog/index.html, set this to 'source/blog')
stash_dir: _stash # directory to stash posts for speedy generation
posts_dir: _posts # directory for blog files
-themes_dir: .themes # directory for blog files
new_post_ext: markdown # default new post file extension when using the new_post task
new_page_ext: markdown # default new page file extension when using the new_page task
server_host: 0.0.0.0 # host ip address for preview server
server_port: 4000 # port for preview server eg. localhost:4000
+timezone: local # default time and date used to local timezone. Vew supported timezones (under TZ column): http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
@@ -0,0 +1,4 @@
+# Pinboard link stream
+pinboard:
+ user:
+ count: 4
@@ -0,0 +1,17 @@
+---
+# Asset configuration
+
+# Javascript assets stored in assets/javascripts and assets/javascripts/lib
+# Are wrapped with CommonJS functions, combined, uglified and fingerprinted
+# Supported files: .js, .coffee, .mustache, .eco, .tmpl
+
+require_js:
+ # Dependiences are added first as globals
+ dependencies:
+ - lib/modernizr.js
+ - lib/swfobject-dynamic.js
+ - lib/*.*
+
+ # files from the javascripts root path are wrapped with CommonJS functions
+ modules:
+ - '*.*'
@@ -3,6 +3,14 @@
# Classic Theme Configuration #
# ------------------------------- #
+theme:
+ name: classic
+ # path to theme stylesheets directory
+ stylesheets_dir: assets/stylesheets
+ # path to theme javascripts directory
+ javascripts_dir: assets/javascripts
+
+
url: http://yoursite.com
title: My Octopress Blog
subtitle: A blogging framework for hackers.
@@ -32,13 +40,13 @@ page_sidebar: page_default.html
post_sidebar: post_default.html
paginate: 10 # Posts per page on the blog index
-pagination_dir: blog # Directory base for pagination URLs eg. /blog/page/2/
+pagination_dir: # Directory base for pagination URLs eg. /page/2/
recent_posts: 5 # Posts in the sidebar Recent Posts section
-excerpt_link: "Read on →" # "Continue reading" link text at the bottom of excerpted articles
+excerpt_link: "Read on " # "Continue reading" link text at the bottom of excerpted articles
excerpt_in_feed: false # Truncate excerpted articles in the atom feed
permalink_label: "Permalink"
-permalink_label_feed: "⚓ Permalink"
-linklog_marker: "→"
+permalink_label_feed: " Permalink"
+linklog_marker: ""
linklog_marker_position: after
linklog_marker_position_feed: after
standard_post_marker:
@@ -0,0 +1,19 @@
+---
+# -------------------------------- #
+# Tweet Sidebar Plugin Configs #
+# -------------------------------- #
+
+twitter:
+ user:
+
+ timeline:
+ tweet-count: 4
+ show-replies: false
+ show-rts: false
+
+ follow-button:
+ show: true
+ follower-count: false
+
+ # Sharing button on posts
+ tweet-button: true
@@ -0,0 +1,68 @@
+# App.net fetcher for Octopress (c) Brandon Mathis // MIT License
+helpers = require('helpers')
+
+Adn =
+ timeline: []
+ cookie: 'adn-feed'
+ classname: 'adn-feed'
+
+ template: ->
+ helpers.statusFeed @timeline, @classname
+
+ errorTemplate: ->
+ helpers.errorTemplate "Failed to load posts.", @classname
+
+ parseHtml: (post)->
+ text = helpers.trimDisplayUrls post.html
+ text = text.replace "@#{mention.name}", "<a href='https://alpha.app.net/#{mention.name}'>@#{mention.name}</a>" for mention in post.entities.mentions
+ text = text.replace "##{hashtag.name}", "<a href='https://alpha.app.net/hashtags/#{hashtag.name}'>##{hashtag.name}</a>" for hashtag in post.entities.hashtags
+ text
+
+ getPost: (post) ->
+ type = if post.repost_of then 'repost' else 'post'
+ post = if type is 'repost' then post.repost_of else post
+ {
+ type: type
+ url: post.canonical_url
+ date: post.created_at
+ author: { user: post.user.username, name: post.user.name, url: post.user.canonical_url } if type is 'repost'
+ text: @parseHtml post
+ }
+
+ format: (posts, user, options) ->
+ postList = []
+ for post in posts
+ postList.push @getPost(post) unless post.repost_of and !options.reposts
+ postList
+
+ init: (user, options, callback) ->
+ posts = $.cookie @cookie
+ if posts
+ @timeline = JSON.parse(posts)
+ if @timeline.length isnt options.count
+ $.removeCookie @cookie
+ @timeline = []
+ init user, options, callback
+ else
+ callback @template()
+ else
+ url = "https://alpha-api.app.net/stream/0/users/@#{user}/posts?"
+ url += "&max_id=#{options.max_id}" if options.max_id
+ url += "&include_directed_posts=0" unless options.replies
+ url += "&callback=?"
+
+ $.ajax
+ url: url
+ dataType: 'jsonp'
+ error: (err) => callback @errorTemplate
+ success: (response) =>
+ @timeline = @timeline.concat response.data
+ if @timeline.length < options.count
+ options.max_id = response.meta.max_id
+ init user, options, callback
+ else
+ @timeline = @format @timeline.slice(0, options.count), user, options
+ $.cookie @cookie, JSON.stringify @timeline, { path: '/' }
+ callback @template()
+
+module.exports = Adn
@@ -0,0 +1,38 @@
+# Delicious fetcher for Octopress (c) Brandon Mathis // MIT License
+helpers = require('helpers')
+
+Delicious =
+ cookie: 'delicious-feed'
+ classname: 'delicious-feed'
+
+ template: (data) ->
+ helpers.linkFeed data, @classname
+
+ errorTemplate: ->
+ helpers.errorTemplate "Failed to load bookmarks.", @classname
+
+ format: (feed) ->
+ for item in feed
+ {
+ url: item.u
+ date: item.dt
+ title: item.d
+ text: item.n
+ meta: "Tagged: " + ("<a title='view items #{item.a} tagged #{tag}' href='http://delicious.com/#{item.a}/#{tag}'>#{tag}</a>" for tag in item.t).join ' '
+ }
+
+ init: (user, options, callback) ->
+ feed = $.cookie @cookie
+ if feed
+ callback @template JSON.parse(feed)
+ else
+ $.ajax
+ url: "http://feeds.delicious.com/v2/json/#{user}?&count=#{options.count}&callback=?"
+ dataType: 'jsonp'
+ error: (err) => callback @errorTemplate
+ success: (data) =>
+ data = @format data
+ $.cookie @cookie, JSON.stringify data, { path: '/' }
+ callback @template data
+
+module.exports = Delicious
@@ -0,0 +1,60 @@
+# Github fetcher for Octopress (c) Brandon Mathis // MIT License
+helpers = require('helpers')
+
+GitHub =
+ cookie: 'github-feed'
+ classname: 'github-feed'
+
+ template: (data)->
+ helpers.linkFeed data, @classname
+
+ errorTemplate: ->
+ helpers.errorTemplate "Failed to load repo list.", @classname
+
+ addRepo: (repo)->
+ title: repo.name
+ url: repo.url
+ text: repo.description
+ meta: repo.meta
+
+ format: (repos, options) ->
+ repoList = []
+
+ if options.repos
+ filter = []
+ filter.push i.trim().toLowerCase() for i in options.repos.split ','
+
+ for repo in repos
+ unless repoList.length is options.count
+ if options.forks or options.watchers
+ repo.meta = ''
+ if options.watchers
+ repo.meta += "Watchers: #{repo.watchers}"
+ if options.forks
+ repo.meta += ' ,' if repo.meta.length > 0
+ repo.meta += "Forks: #{repo.forks}"
+
+ if filter and filter.indexOf repo.name.toLowerCase() > -1
+ # repo order should match list
+ repoList[filter.indexOf repo.name] = @addRepo repo, options
+ else if !filter
+ repoList.push @addRepo repo, options unless options.skipForks and repo.fork
+
+ repoList
+
+ init: (user, options, callback) ->
+ if options.count or options.repos
+ feed = $.cookie @cookie
+ if feed
+ callback @template JSON.parse(feed)
+ else
+ $.ajax
+ url: "https://api.github.com/users/#{user}/repos?callback=?"
+ dataType: 'jsonp'
+ error: (err) => callback @errorTemplate
+ success: (data) =>
+ data = @format(data.data, options)
+ $.cookie @cookie, JSON.stringify data, { path: '/' }
+ callback @template data
+
+module.exports = GitHub
Oops, something went wrong.

0 comments on commit 7bdab0e

Please sign in to comment.