Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi! I cleaned up your code for you! #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc

# Logs and databases #
######################
*.log

# OS generated files #
######################
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
30 changes: 15 additions & 15 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# Cache control is set only if mod_headers is enabled, so that's unncessary to declare
</IfModule>

# Serve cross-domain ajax requests, disabled.
# Serve cross-domain ajax requests, disabled.
# enable-cors.org
# code.google.com/p/html5security/wiki/CrossOriginRequestSecurity
# <IfModule mod_headers.c>
Expand Down Expand Up @@ -57,16 +57,16 @@ AddType video/webm webm

# Proper svg serving. Required for svg webfonts on iPad
# twitter.com/FontSquirrel/status/14855840545
AddType image/svg+xml svg svgz
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
# webfonts

# webfonts
AddType application/vnd.ms-fontobject eot
AddType font/truetype ttf
AddType font/opentype otf
AddType font/woff woff

# assorted types
# assorted types
AddType image/vnd.microsoft.icon ico
AddType image/webp webp
AddType text/cache-manifest manifest
Expand All @@ -77,7 +77,7 @@ AddType application/octet-stream safariextz



# allow concatenation from within specific js and css files
# allow concatenation from within specific js and css files

# e.g. Inside of script.combined.js you could have
# <!--#include file="jquery-1.4.4.js" -->
Expand Down Expand Up @@ -113,7 +113,7 @@ AddType application/octet-stream safariextz
<IfModule !mod_filter.c>
# Legacy versions of Apache
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
</IfModule>

Expand All @@ -128,7 +128,7 @@ AddType application/octet-stream safariextz
# these are pretty far-future expires headers
# they assume you control versioning with cachebusting query params like
# <script src="application.js?20100608">
# additionally, consider that outdated proxies may miscache
# additionally, consider that outdated proxies may miscache
# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/

# if you don't use filenames to version, lower the css and js to something like
Expand All @@ -143,9 +143,9 @@ AddType application/octet-stream safariextz
# cache.manifest needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"

# your document html
# your document html
ExpiresByType text/html "access plus 0 seconds"

# data
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
Expand All @@ -156,7 +156,7 @@ AddType application/octet-stream safariextz
ExpiresByType application/rss+xml "access plus 1 hour"

# favicon (cannot be renamed)
ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
ExpiresByType image/vnd.microsoft.icon "access plus 1 week"

# media: images, video, audio
ExpiresByType image/gif "access plus 1 month"
Expand All @@ -167,14 +167,14 @@ AddType application/octet-stream safariextz
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"

# webfonts
ExpiresByType font/truetype "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType font/woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"

# css and javascript
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
Expand Down Expand Up @@ -213,9 +213,9 @@ FileETag None
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
</IfModule>

# without -MultiViews, Apache will give a 404 for a rewrite if a folder of the same name does not exist
# without -MultiViews, Apache will give a 404 for a rewrite if a folder of the same name does not exist
# e.g. /blog/hello : webmasterworld.com/apache/3808792.htm
Options -MultiViews
Options -MultiViews
# -Indexes will have Apache block users from browsing folders without a default document
# Options -Indexes

Expand Down
8 changes: 4 additions & 4 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
* Using Responsive web design which means design adapts screen size
* Main stylesheet(style.less) is written with LESS(**You need less installed**)
* Rakefile to minify css (rake juicer:css).
If you need to optimize change master.css to master.min at \_includes/system\_head.html

If you need to optimize change master.css to master.min at \_includes/system\_head.html
If you ever change anything, **you have to type** command rake juicer:css to
rebuild minified css.
rebuild minified css.
I'm trying to figure out how to regex strings in html via rake so that you
don't have to do this manually, if you know how please help me. Thanks.

Expand Down Expand Up @@ -43,7 +43,7 @@
* [less\_converter.rb](https://github.com/tatey/jekyll_plugins/blob/master/less_converter.rb): MIT License
* [jekyll-postfiles](https://github.com/indirect/jekyll-postfiles): ???(Some
kind of open source since it's in github)

### HTML, CSS, JavaScript

* [Modernizr](http://www.modernizr.com/): MIT/BSD license
Expand Down
2 changes: 1 addition & 1 deletion _includes/ga.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- You may want to stats with your blog if not you should erase this file and remove inculude link from
<!-- You may want to stats with your blog if not you should erase this file and remove inculude link from
You don't need to edit this file, you can set your ID at _config.yml -->
<script>
var _gaq = [['_setAccount', '{{ site.ga }}'], ['_trackPageview']];
Expand Down
58 changes: 29 additions & 29 deletions _plugins/generate_categories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
# Copyright (c) 2010 Dave Perrett, http://recursive-design.com/
# Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
#
# A generator that creates category pages for jekyll sites.
# A generator that creates category pages for jekyll sites.
#
# To use it, simply drop this script into the _plugins directory of your Jekyll site. You should
# also create a file called 'category_index.html' in the _layouts directory of your jekyll site
# To use it, simply drop this script into the _plugins directory of your Jekyll site. You should
# also create a file called 'category_index.html' in the _layouts directory of your jekyll site
# with the following contents (note: you should remove the leading '# ' characters):
#
# ================================== COPY BELOW THIS LINE ==================================
# ---
# layout: default
# ---
#
#
# <h1 class="category">{{ page.title }}</h1>
# <ul class="posts">
# {% for post in site.categories[page.category] %}
Expand All @@ -26,12 +26,12 @@
# {% endfor %}
# </ul>
# ================================== COPY ABOVE THIS LINE ==================================
#
#
# You can alter the _layout_ setting if you wish to use an alternate layout, and obviously you
# can change the HTML above as you see fit.
# can change the HTML above as you see fit.
#
# When you compile your jekyll site, this plugin will loop through the list of categories in your
# site, and use the layout above to generate a page for each one with a list of links to the
# When you compile your jekyll site, this plugin will loop through the list of categories in your
# site, and use the layout above to generate a page for each one with a list of links to the
# individual posts.
#
# Included filters :
Expand All @@ -40,14 +40,14 @@
#
# Available _config.yml settings :
# - category_dir: The subfolder to build category pages in (default is 'categories').
# - category_title_prefix: The string used before the category name in the page title (default is
# - category_title_prefix: The string used before the category name in the page title (default is
# 'Category: ').
module Jekyll


# The CategoryIndex class creates a single category page for the specified category.
class CategoryIndex < Page

# Initializes a new CategoryIndex.
#
# +base+ is the String path to the <source>.
Expand All @@ -69,14 +69,14 @@ def initialize(site, base, category_dir, category)
meta_description_prefix = site.config['category_meta_description_prefix'] || 'Category: '
self.data['description'] = "#{meta_description_prefix}#{category}"
end

end


# The Site class is a built-in Jekyll class with access to global site config information.
class Site
# Creates an instance of CategoryIndex for each category page, renders it, and

# Creates an instance of CategoryIndex for each category page, renders it, and
# writes the output to a file.
#
# +category_dir+ is the String path to the category folder.
Expand All @@ -88,24 +88,24 @@ def write_category_index(category_dir, category)
# Record the fact that this page has been added, otherwise Site::cleanup will remove it.
self.pages << index
end

# Loops through the list of category pages and processes each one.
def write_category_indexes
if self.layouts.key? 'category_index'
dir = self.config['category_dir'] || 'categories'
self.categories.keys.each do |category|
self.write_category_index(File.join(dir, category), category)
end

# Throw an exception if the layout couldn't be found.
else
throw "No 'category_index' layout found."
end
end

end


# Jekyll hook - the generate method is called by jekyll, and generates all of the category pages.
class GenerateCategories < Generator
safe true
Expand All @@ -116,11 +116,11 @@ def generate(site)
end

end


# Adds some extra filters used during the category creation process.
module Filters

# Outputs a list of categories as comma-separated <a> links. This is used
# to output the category list for each post on a category page.
#
Expand All @@ -131,7 +131,7 @@ def category_links(categories)
categories = categories.sort!.map do |item|
'<a href="/categories/'+item+'/" class="'+item+'" title="'+item+'">'+item+'</a>'
end

connector = "and"
case categories.length
when 0
Expand All @@ -144,7 +144,7 @@ def category_links(categories)
"#{categories[0...-1].join(', ')}, #{connector} #{categories[-1]}"
end
end

# Outputs the post.date as formatted html, with hooks for CSS styling.
#
# +date+ is the date object to format as HTML.
Expand All @@ -156,7 +156,7 @@ def date_to_html_string(date)
result += date.strftime('<span class="year">%Y</span> ')
result
end

end

end
6 changes: 3 additions & 3 deletions _plugins/postfiles.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Jekyll

# StaticFile subclass that properly translates paths
class PostFile < StaticFile
def path
Expand All @@ -23,9 +23,9 @@ def generate(site)
postfile_id = post.id.gsub(/(\w)\/(\d{4})\/(\d\d)\/(\d\d)\/(.*)/, '\1-\2-\3-\4-\5')
# Get the directory that files from this post would be in
postfile_dir = File.join(site.config['source'], '_postfiles', postfile_id)

# Add a static file entry for each postfile, if any
Dir[File.join(postfile_dir, '/*')].each do |pf|
Dir[File.join(postfile_dir, '/*')].each do |pf|
site.static_files << PostFile.new(site, postfile_dir, post.url, File.basename(pf))
end
end
Expand Down
6 changes: 3 additions & 3 deletions _posts/2011-1-16-001-post-example.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: post
title: 001_post_example
---

*This is a post example.*
*This is a post example.*
Below I've placed commonly used markdown syntax so that you can see how I've designed each elements.

##This is h2 heading
Expand Down Expand Up @@ -38,7 +38,7 @@ Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus v

## Blockquote

> Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Vestibulum id ligula porta felis euismod semper. Maecenas faucibus mollis interdum. Donec sed odio dui.
> Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Vestibulum id ligula porta felis euismod semper. Maecenas faucibus mollis interdum. Donec sed odio dui.
> Donec ullamcorper nulla non metus auctor fringilla. Nullam id dolor id nibh ultricies vehicula ut id elit. Nulla vitae elit libero, a pharetra augue. Maecenas sed diam eget risus varius blandit sit amet non magna.

## Image
Expand All @@ -49,7 +49,7 @@ There are 3 pre-defined class for images.
2. **.right** = Image floats right
3. **.huge** = If your image is big then you should use this class

examples below apply class accordingly.
examples below apply class accordingly.

![Image](http://placehold.it/100x100){:class='left'}
Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Vestibulum id ligula porta felis euismod semper. Maecenas faucibus mollis interdum. Donec sed odio dui.
Expand Down
Loading