aboutsummaryrefslogtreecommitdiff
path: root/_plugins
diff options
context:
space:
mode:
Diffstat (limited to '_plugins')
-rw-r--r--_plugins/custom_filters.rb11
-rw-r--r--_plugins/generate_sitemap.rb11
-rw-r--r--_plugins/generate_styles.rb1
3 files changed, 17 insertions, 6 deletions
diff --git a/_plugins/custom_filters.rb b/_plugins/custom_filters.rb
index 2c58e677..84f1caa0 100644
--- a/_plugins/custom_filters.rb
+++ b/_plugins/custom_filters.rb
@@ -15,6 +15,11 @@ module OctopressFilters
$1+url+$3
end
end
+ def search_url(input)
+ input.gsub /(http:\/\/)(\S+)/ do
+ $2
+ end
+ end
def smart_quotes(input)
require 'rubypants'
RubyPants.new(input).to_html
@@ -23,10 +28,14 @@ module OctopressFilters
require 'titlecase'
input.titlecase
end
- def ordinalize(date)
+ def datetime(date)
if date.class == String
date = Time.parse(date)
end
+ date
+ end
+ def ordinalize(date)
+ date = datetime(date)
"#{date.strftime('%B')} #{ordinal(date.strftime('%e').to_i)}, #{date.strftime('%Y')}"
end
def ordinal(number)
diff --git a/_plugins/generate_sitemap.rb b/_plugins/generate_sitemap.rb
index 488a992b..4d580c47 100644
--- a/_plugins/generate_sitemap.rb
+++ b/_plugins/generate_sitemap.rb
@@ -44,7 +44,6 @@ module Jekyll
priority :low
# Domain that you are generating the sitemap for - update this to match your site.
- BASE_URL = 'http://recursive-design.com'
# Generates the sitemap.xml file.
#
@@ -82,6 +81,8 @@ module Jekyll
def generate_content(site)
result = ''
+ base_url = site.config['url']
+
# First, try to find any stand-alone pages.
site.pages.each{ |page|
path = page.subfolder + '/' + page.name
@@ -93,14 +94,14 @@ module Jekyll
end
unless path =~/error/
- result += entry(path, mod_date)
+ result += entry(base_url, path, mod_date)
end
}
# Next, find all the posts.
posts = site.site_payload['site']['posts']
for post in posts do
- result += entry(post.id, post.date)
+ result += entry(base_url, post.id, post.date)
end
result
@@ -115,12 +116,12 @@ module Jekyll
#
# +path+ is the URL path to the page.
# +date+ is the date the file was modified (in the case of regular pages), or published (for blog posts).
- def entry(path, date)
+ def entry(base_url, path, date)
# Force extensions to .html from markdown, textile.
path = path.gsub(/\.(markdown|textile)$/i, '.html')
"
<url>
- <loc>#{BASE_URL}#{path}</loc>
+ <loc>#{base_url}#{path}</loc>
<lastmod>#{date.strftime("%Y-%m-%d")}</lastmod>
</url>"
end
diff --git a/_plugins/generate_styles.rb b/_plugins/generate_styles.rb
new file mode 100644
index 00000000..e1819f84
--- /dev/null
+++ b/_plugins/generate_styles.rb
@@ -0,0 +1 @@
+system "sleep 0.5; compass compile --css-dir source/stylesheets"