dimples 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c480fd2f7363a7a6072668b2380b2e6962456bf3
4
- data.tar.gz: ab0db580748680bd12d31dc34b947ee7d2161c60
3
+ metadata.gz: dd2d51dbcbd0c10c03542661f809574871431fba
4
+ data.tar.gz: ee382f7f2b50192068d97de6d9610ecbae179f35
5
5
  SHA512:
6
- metadata.gz: d56249e0b2cfaa9d0e4cfe6472503cfaa30d6e17e83da57cdeee62568c643c126492e03a714118d6f6e5023dd3c51b9d870d33bb075336f4494073ed01ab34c4
7
- data.tar.gz: 84b2d79bc6f0108196098b91fbb62ba8d533114ef4902164ebf525ae1ad6cd8fc50a5b260a00ccdc0e1327cb7a457a21ccf255b6b110cb8ddf95e64ffda87fbb
6
+ metadata.gz: c13dd73aec1705d44b4fcbe166ed503f9574912a36e70efc30dfd46831156286ca36f07036d7f08bce4209341bec2d2b0f2b7abafb204617dfe26b2027f3358a
7
+ data.tar.gz: f5b69ede0e4303853b5e6f5ac759ce7e688573e7244414d2b1e83af8f80e6383c322a3923ca8c85ce8af1c71efef1dbc11dbc8c92b4f2621bb4a4d03ece71143
@@ -38,9 +38,7 @@ module Dimples
38
38
  'category' => 'category',
39
39
  },
40
40
 
41
- 'markdown' => {
42
- 'enabled' => true,
43
- 'options' => {},
41
+ 'rendering' => {
44
42
  },
45
43
 
46
44
  'pagination' => {
@@ -17,14 +17,28 @@ module Dimples
17
17
  context[:site] = @site unless context[:site]
18
18
  context[:this] = self unless context[:this]
19
19
 
20
+ proc = Proc.new { |template| contents() }
21
+
22
+ renderer = if @path
23
+ extension = File.extname(@path)[1..-1]
24
+ options = @site.config['rendering'][extension] || {}
25
+
26
+ Tilt.new(@path, options, &proc)
27
+ else
28
+ Tilt::StringTemplate.new(&proc)
29
+ end
30
+
20
31
  begin
21
- proc = Proc.new { |template| contents() }
22
- renderer = @path ? Tilt.new(@path, &proc) : Tilt::StringTemplate.new(&proc)
23
32
  output = renderer.render(nil, context) { body }.strip
24
-
25
33
  @rendered_contents = output
26
- rescue RuntimeError, TypeError, NoMethodError => e
27
- raise "Failed to render #{path ? path.gsub(@site.source_paths[:root], '') : type} - #{e}"
34
+ rescue RuntimeError, TypeError, NoMethodError, SyntaxError => e
35
+ problem_file = if @path
36
+ @path.gsub(@site.source_paths[:root], '')
37
+ else
38
+ "dynamic #{type}"
39
+ end
40
+
41
+ raise "Failed to render #{problem_file} - #{e}"
28
42
  end
29
43
 
30
44
  if use_layout && @layout && @site.templates[@layout]
@@ -1,3 +1,3 @@
1
1
  module Dimples
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dimples
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bogan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-25 00:00:00.000000000 Z
11
+ date: 2015-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tilt
@@ -24,8 +24,7 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
- description: This is a very simple static site generator, born out of the loins of
28
- usesthis.com.
27
+ description: A very, very, very simple gem for building static websites.
29
28
  email:
30
29
  - d+dimples@waferbaby.com
31
30
  executables: []
@@ -64,5 +63,5 @@ rubyforge_project:
64
63
  rubygems_version: 2.2.2
65
64
  signing_key:
66
65
  specification_version: 4
67
- summary: A very silly static site generator
66
+ summary: A basic static site generator
68
67
  test_files: []