aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorBrandon Mathis <brandon@imathis.com>2011-07-21 15:45:09 -0400
committerBrandon Mathis <brandon@imathis.com>2011-07-21 16:14:23 -0400
commit44e1351fc71eaef7aefdc168dc9bc15b20d4bda4 (patch)
treeb357bb5f6618f0d346d8d97a84b1cff9823ae9c9 /plugins
parent05e4b7951d976070675eb02a072ffb9f0b235dba (diff)
downloadmy_new_personal_website-44e1351fc71eaef7aefdc168dc9bc15b20d4bda4.tar.xz
my_new_personal_website-44e1351fc71eaef7aefdc168dc9bc15b20d4bda4.zip
1. Added condition to full_url filter to allow it to be used as a root_url appending filter for remapping root "/" urls when octopress is deployed to a subdirectory. Updated _includes/article and _layouts/page to use the filter
2. Added documentation for the include_code plugin
Diffstat (limited to '')
-rw-r--r--plugins/custom_filters.rb1
-rw-r--r--plugins/include_code.rb9
2 files changed, 9 insertions, 1 deletions
diff --git a/plugins/custom_filters.rb b/plugins/custom_filters.rb
index f0db30ee..0a7604f7 100644
--- a/plugins/custom_filters.rb
+++ b/plugins/custom_filters.rb
@@ -21,6 +21,7 @@ module OctopressFilters
# Replaces relative urls with full urls
def full_urls(input, url='')
+ url ||= ''
input.gsub /(\s+(href|src)\s*=\s*["|']{1})(\/[^\"'>]+)/ do
$1+url+$3
end
diff --git a/plugins/include_code.rb b/plugins/include_code.rb
index e00f1c81..6a7d786e 100644
--- a/plugins/include_code.rb
+++ b/plugins/include_code.rb
@@ -5,13 +5,20 @@
#
# Syntax {% include_code path/to/file %}
#
-# Example:
+# Example 1:
# {% include_code javascripts/test.js %}
#
# This will import test.js from source/downloads/code/javascripts/test.js
# and output the contents in a syntax highlighted code block inside a figure,
# with a figcaption listing the file name and download link
#
+# Example 2:
+# You can also include an optional title for the <figcaption>
+#
+# {% include_code Example 2 javascripts/test.js %}
+#
+# will output a figcaption with the title: Example 2 (test.js)
+#
require 'pathname'