octopress-render-code 1.0.1 → 1.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e02e5e31bc56d78a7d2d3a2437d749c99779e9ac
4
- data.tar.gz: 03801b1418d49d4afca74f0afe57e25926f0d5a7
3
+ metadata.gz: d559663f30dbd449ed0d0793aff868feebf75ea6
4
+ data.tar.gz: 95a6eb33f7bdd56d9f0f29b82d7ad74f1663cd3e
5
5
  SHA512:
6
- metadata.gz: bb43ec8958cfefb8a585f14eacde58f72950e04b83f2295aa04a314c7a79e29d5d03e25d2088730ce54f6d97c99fb7a6a3dc69ee5ebba9bd26a1f4b7ae9d250f
7
- data.tar.gz: 8f11b12b2b9dad93795bf606e2b33a042b62eb91b041865d22b73a6c66c5fda192e4b202a149f49ecf8357f469833b362b7a7e13e8cd4854221dae69527ce985
6
+ metadata.gz: b94c0cf704afa787d5c621f63cdf23d5486c2f9607ecb9eb25229a6b9e574b062ae528be0f0722e3c5cebac324590eb2a8afb9dff407b43428c8ff464a3d0184
7
+ data.tar.gz: 5feb30bddd3c6e1c717de49fe71f3b45b64a455234a905f9609cdf24207c90b2b0cfa3f116d06f564f49bd1c2fd777ee10861609839c68b4c397620a896d2fdd
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.2 - 2014-06-25
4
+ - Fix: Better supports being rendered as a partial
5
+
3
6
  ## 1.0.1 - 2014-06-23
4
7
  - Fix: Properly handles case where only filename is passed.
5
8
 
@@ -17,7 +17,9 @@ module Octopress
17
17
  end
18
18
 
19
19
  def render(context)
20
- @page_path = context.environments.first['page']['path']
20
+ if page = context.environments.first['page']
21
+ @page_path = page['path']
22
+ end
21
23
  site = context.registers[:site]
22
24
  config_dir = (site.config['code_dir'] || 'downloads/code').sub(/^\//,'')
23
25
  @code_dir = File.join(site.source, config_dir)
@@ -60,9 +62,11 @@ module Octopress
60
62
  elsif clean_markup =~ TitleFile
61
63
  defaults[:title] = $1
62
64
  @file = get_path($2)
63
- puts "\nRenderCode Warning:".red
64
- puts " Passing title before path has been deprecated and will be removed in RenderCode 2.0".red
65
- puts " Update #{@page_path} with {% render_code #{$2} #{$1} ... %}.".yellow
65
+ if @page_path
66
+ puts "\nRenderCode Warning:".red
67
+ puts " Passing title before path has been deprecated and will be removed in RenderCode 2.0".red
68
+ puts " Update #{@page_path} with {% render_code #{$2} #{$1} ... %}.".yellow
69
+ end
66
70
  end
67
71
  end
68
72
 
@@ -80,7 +84,9 @@ module Octopress
80
84
  def highlight(code, options)
81
85
  options[:aliases] = @aliases || {}
82
86
  code = CodeHighlighter.highlight(code, options)
83
- code = "<notextile>#{code}</notextile>" if File.extname(@page_path).match(/textile/)
87
+ if @page_path
88
+ code = "<notextile>#{code}</notextile>" if File.extname(@page_path).match(/textile/)
89
+ end
84
90
  code
85
91
  end
86
92
  end
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module RenderCode
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-render-code
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-24 00:00:00.000000000 Z
11
+ date: 2014-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll