awestructx 0.4.0
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.
- data/bin/awestruct +8 -0
- data/lib/awestruct/astruct.rb +22 -0
- data/lib/awestruct/astruct_mixin.rb +71 -0
- data/lib/awestruct/cli/auto.rb +20 -0
- data/lib/awestruct/cli/generate.rb +26 -0
- data/lib/awestruct/cli/invoker.rb +109 -0
- data/lib/awestruct/cli/options.rb +116 -0
- data/lib/awestruct/cli/server.rb +24 -0
- data/lib/awestruct/config.rb +30 -0
- data/lib/awestruct/context.rb +22 -0
- data/lib/awestruct/context_helper.rb +68 -0
- data/lib/awestruct/engine.rb +254 -0
- data/lib/awestruct/extensions/assets.rb +39 -0
- data/lib/awestruct/extensions/atomizer.rb +44 -0
- data/lib/awestruct/extensions/cachebuster.rb +12 -0
- data/lib/awestruct/extensions/coffeescripttransform.rb +42 -0
- data/lib/awestruct/extensions/data_dir.rb +31 -0
- data/lib/awestruct/extensions/disqus.rb +62 -0
- data/lib/awestruct/extensions/extend_string.rb +97 -0
- data/lib/awestruct/extensions/flattr.rb +42 -0
- data/lib/awestruct/extensions/google_analytics.rb +38 -0
- data/lib/awestruct/extensions/gsub.rb +20 -0
- data/lib/awestruct/extensions/indexifier.rb +17 -0
- data/lib/awestruct/extensions/intense_debate.rb +38 -0
- data/lib/awestruct/extensions/minify.rb +178 -0
- data/lib/awestruct/extensions/obfuscate.rb +32 -0
- data/lib/awestruct/extensions/paginator.rb +105 -0
- data/lib/awestruct/extensions/partial.rb +25 -0
- data/lib/awestruct/extensions/pipeline.rb +50 -0
- data/lib/awestruct/extensions/posts.rb +70 -0
- data/lib/awestruct/extensions/relative.rb +11 -0
- data/lib/awestruct/extensions/remotePartial.rb +17 -0
- data/lib/awestruct/extensions/sitemap.rb +85 -0
- data/lib/awestruct/extensions/sitemap.xml.haml +16 -0
- data/lib/awestruct/extensions/tag_cloud.html.haml +7 -0
- data/lib/awestruct/extensions/tag_cloud.rb +34 -0
- data/lib/awestruct/extensions/tagger.rb +107 -0
- data/lib/awestruct/extensions/template.atom.haml +39 -0
- data/lib/awestruct/handler_chain.rb +28 -0
- data/lib/awestruct/handler_chains.rb +65 -0
- data/lib/awestruct/handlers/base_handler.rb +92 -0
- data/lib/awestruct/handlers/base_sass_handler.rb +42 -0
- data/lib/awestruct/handlers/file_handler.rb +61 -0
- data/lib/awestruct/handlers/front_matter_handler.rb +80 -0
- data/lib/awestruct/handlers/haml_handler.rb +42 -0
- data/lib/awestruct/handlers/interpolation_handler.rb +28 -0
- data/lib/awestruct/handlers/layout_handler.rb +61 -0
- data/lib/awestruct/handlers/markdown_handler.rb +36 -0
- data/lib/awestruct/handlers/no_op_handler.rb +34 -0
- data/lib/awestruct/handlers/sass_handler.rb +14 -0
- data/lib/awestruct/handlers/scss_handler.rb +14 -0
- data/lib/awestruct/handlers/string_handler.rb +29 -0
- data/lib/awestruct/handlers/textile_handler.rb +43 -0
- data/lib/awestruct/handlers/yaml_handler.rb +25 -0
- data/lib/awestruct/layouts.rb +15 -0
- data/lib/awestruct/page.rb +128 -0
- data/lib/awestruct/page_loader.rb +72 -0
- data/lib/awestruct/pipeline.rb +49 -0
- data/lib/awestruct/site.rb +51 -0
- data/lib/awestruct/util/default_inflections.rb +45 -0
- data/lib/awestruct/util/inflector.rb +242 -0
- data/lib/awestruct/version.rb +4 -0
- data/lib/guard/awestruct.rb +38 -0
- metadata +427 -0
@@ -0,0 +1,107 @@
|
|
1
|
+
|
2
|
+
module Awestruct
|
3
|
+
module Extensions
|
4
|
+
class Tagger
|
5
|
+
|
6
|
+
class TagStat
|
7
|
+
attr_accessor :pages
|
8
|
+
attr_accessor :group
|
9
|
+
attr_accessor :primary_page
|
10
|
+
def initialize(tag, pages)
|
11
|
+
@tag = tag
|
12
|
+
@pages = pages
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_s
|
16
|
+
@tag
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
module TagLinker
|
21
|
+
def tag_links(delimiter = ', ', style_class = nil)
|
22
|
+
class_attr = (style_class ? ' class="' + style_class + '"' : '')
|
23
|
+
tags.map{|tag| %Q{<a#{class_attr} href="#{tag.primary_page.url}">#{tag}</a>}}.join(delimiter)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def initialize(tagged_items_property, input_path, output_path='tags', opts={})
|
28
|
+
@tagged_items_property = tagged_items_property
|
29
|
+
@input_path = input_path
|
30
|
+
@output_path = output_path
|
31
|
+
@sanitize = opts[:sanitize] || false
|
32
|
+
@pagination_opts = opts
|
33
|
+
end
|
34
|
+
|
35
|
+
def execute(site)
|
36
|
+
@tags ||= {}
|
37
|
+
all = site.send( @tagged_items_property )
|
38
|
+
return if ( all.nil? || all.empty? )
|
39
|
+
|
40
|
+
all.each do |page|
|
41
|
+
tags = page.tags
|
42
|
+
if ( tags && ! tags.empty? )
|
43
|
+
tags.each do |tag|
|
44
|
+
tag = tag.to_s
|
45
|
+
@tags[tag] ||= TagStat.new( tag, [] )
|
46
|
+
@tags[tag].pages << page
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
all.each do |page|
|
52
|
+
page.tags = (page.tags||[]).collect{|t| @tags[t]}
|
53
|
+
page.extend( TagLinker )
|
54
|
+
end
|
55
|
+
|
56
|
+
ordered_tags = @tags.values
|
57
|
+
ordered_tags.sort!{|l,r| -(l.pages.size <=> r.pages.size)}
|
58
|
+
#ordered_tags = ordered_tags[0,100]
|
59
|
+
ordered_tags.sort!{|l,r| l.to_s <=> r.to_s}
|
60
|
+
|
61
|
+
min = 9999
|
62
|
+
max = 0
|
63
|
+
|
64
|
+
ordered_tags.each do |tag|
|
65
|
+
min = tag.pages.size if ( tag.pages.size < min )
|
66
|
+
max = tag.pages.size if ( tag.pages.size > max )
|
67
|
+
end
|
68
|
+
|
69
|
+
span = max - min
|
70
|
+
|
71
|
+
if span > 0
|
72
|
+
slice = span / 6.0
|
73
|
+
ordered_tags.each do |tag|
|
74
|
+
adjusted_size = tag.pages.size - min
|
75
|
+
scaled_size = adjusted_size / slice
|
76
|
+
tag.group = (( tag.pages.size - min ) / slice).ceil
|
77
|
+
end
|
78
|
+
else
|
79
|
+
ordered_tags.each do |tag|
|
80
|
+
tag.group = 0
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
@tags.values.each do |tag|
|
85
|
+
## Optionally sanitize tag URL
|
86
|
+
output_prefix = File.join( @output_path, sanitize(tag.to_s) )
|
87
|
+
options = { :remove_input=>false, :output_prefix=>output_prefix, :collection=>tag.pages }.merge( @pagination_opts )
|
88
|
+
|
89
|
+
paginator = Awestruct::Extensions::Paginator.new( @tagged_items_property, @input_path, options )
|
90
|
+
primary_page = paginator.execute( site )
|
91
|
+
tag.primary_page = primary_page
|
92
|
+
end
|
93
|
+
|
94
|
+
site.send( "#{@tagged_items_property}_tags=", ordered_tags )
|
95
|
+
end
|
96
|
+
|
97
|
+
def sanitize(string)
|
98
|
+
#replace accents with unaccented version, go lowercase and replace and space with dash
|
99
|
+
if @sanitize
|
100
|
+
string.to_s.urlize({:convert_spaces=>true})
|
101
|
+
else
|
102
|
+
string
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
---
|
3
|
+
!!! XML
|
4
|
+
|
5
|
+
%feed{ 'xml:lang'=>'en-US', :xmlns=>'http://www.w3.org/2005/Atom' }
|
6
|
+
%id= "#{page.content_url}/"
|
7
|
+
%title= escape_once( page.title )
|
8
|
+
- if ( defined?( site.author ) )
|
9
|
+
%author
|
10
|
+
- if ( defined?( site.author.name ) )
|
11
|
+
%name= site.author.name
|
12
|
+
- if ( site.author.email )
|
13
|
+
%email= site.author.email
|
14
|
+
- else
|
15
|
+
%name= site.author
|
16
|
+
- unless page.entries.empty?
|
17
|
+
%updated= page.entries.first.date.xmlschema
|
18
|
+
%link{:rel=>"self", :type=>"application/atom+xml", :href=>"#{site.base_url}#{page.url}" }
|
19
|
+
%link{:rel=>"alternate", :type=>"text/html", :href=>"#{page.content_url}/" }
|
20
|
+
- for entry in page.entries
|
21
|
+
%entry
|
22
|
+
%id #{site.base_url}#{entry.url}
|
23
|
+
%title= escape_once( entry.title )
|
24
|
+
%updated= entry.date.xmlschema
|
25
|
+
%published= entry.date.xmlschema
|
26
|
+
%link{:rel=>"alternate", :type=>"text/html", :href=>"#{site.base_url}#{entry.url}" }
|
27
|
+
- if ( defined?( entry.author ) )
|
28
|
+
%author
|
29
|
+
- if ( defined?( entry.author.name ) )
|
30
|
+
%name= entry.author.name
|
31
|
+
- if ( entry.author.email )
|
32
|
+
%email= entry.author.email
|
33
|
+
- else
|
34
|
+
%name= entry.author
|
35
|
+
%summary
|
36
|
+
#{summarize( html_to_text( entry.content ), 100 )}
|
37
|
+
%content{:type=>'html'}
|
38
|
+
= clean_html( html_escape( fully_qualify_urls( site.base_url, find_and_preserve( entry.content ) ) ) )
|
39
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
module Awestruct
|
3
|
+
|
4
|
+
class HandlerChain
|
5
|
+
|
6
|
+
attr_reader :matcher
|
7
|
+
attr_reader :handler_classes
|
8
|
+
|
9
|
+
def initialize(matcher, *handler_classes)
|
10
|
+
@matcher = matcher
|
11
|
+
@handler_classes = handler_classes
|
12
|
+
end
|
13
|
+
|
14
|
+
def matches?(path)
|
15
|
+
@matcher.match( path )
|
16
|
+
end
|
17
|
+
|
18
|
+
def create(site, path)
|
19
|
+
cur = path
|
20
|
+
@handler_classes.each do |cls|
|
21
|
+
cur = cls.new( site, cur )
|
22
|
+
end
|
23
|
+
cur
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'awestruct/handler_chain'
|
2
|
+
require 'awestruct/handlers/file_handler'
|
3
|
+
require 'awestruct/handlers/front_matter_handler'
|
4
|
+
require 'awestruct/handlers/interpolation_handler'
|
5
|
+
require 'awestruct/handlers/markdown_handler'
|
6
|
+
require 'awestruct/handlers/textile_handler'
|
7
|
+
require 'awestruct/handlers/haml_handler'
|
8
|
+
require 'awestruct/handlers/sass_handler'
|
9
|
+
require 'awestruct/handlers/scss_handler'
|
10
|
+
require 'awestruct/handlers/layout_handler'
|
11
|
+
|
12
|
+
module Awestruct
|
13
|
+
|
14
|
+
class HandlerChains
|
15
|
+
|
16
|
+
|
17
|
+
DEFAULTS = [
|
18
|
+
HandlerChain.new( /\.md$/,
|
19
|
+
Awestruct::Handlers::FileHandler,
|
20
|
+
Awestruct::Handlers::FrontMatterHandler,
|
21
|
+
Awestruct::Handlers::InterpolationHandler,
|
22
|
+
Awestruct::Handlers::MarkdownHandler,
|
23
|
+
Awestruct::Handlers::LayoutHandler
|
24
|
+
),
|
25
|
+
HandlerChain.new( /\.textile$/,
|
26
|
+
Awestruct::Handlers::FileHandler,
|
27
|
+
Awestruct::Handlers::FrontMatterHandler,
|
28
|
+
Awestruct::Handlers::InterpolationHandler,
|
29
|
+
Awestruct::Handlers::TextileHandler,
|
30
|
+
Awestruct::Handlers::LayoutHandler
|
31
|
+
),
|
32
|
+
HandlerChain.new( /\.haml$/,
|
33
|
+
Awestruct::Handlers::FileHandler,
|
34
|
+
Awestruct::Handlers::FrontMatterHandler,
|
35
|
+
Awestruct::Handlers::HamlHandler,
|
36
|
+
Awestruct::Handlers::LayoutHandler
|
37
|
+
),
|
38
|
+
HandlerChain.new( /\.sass$/,
|
39
|
+
Awestruct::Handlers::FileHandler,
|
40
|
+
Awestruct::Handlers::SassHandler
|
41
|
+
),
|
42
|
+
HandlerChain.new( /\.scss$/,
|
43
|
+
Awestruct::Handlers::FileHandler,
|
44
|
+
Awestruct::Handlers::ScssHandler
|
45
|
+
),
|
46
|
+
HandlerChain.new( /.*/, Awestruct::Handlers::FileHandler )
|
47
|
+
]
|
48
|
+
|
49
|
+
def initialize(include_defaults=true)
|
50
|
+
@chains = []
|
51
|
+
self << :defaults if include_defaults
|
52
|
+
end
|
53
|
+
|
54
|
+
def[](path)
|
55
|
+
@chains.detect{|e| e.matches?( path.to_s ) }
|
56
|
+
end
|
57
|
+
|
58
|
+
def <<(chain)
|
59
|
+
@chains += DEFAULTS and return if ( chain == :defaults )
|
60
|
+
@chains << chain
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
|
2
|
+
require 'hashery/open_cascade'
|
3
|
+
|
4
|
+
module Awestruct
|
5
|
+
module Handlers
|
6
|
+
class BaseHandler
|
7
|
+
|
8
|
+
attr_reader :site
|
9
|
+
attr_reader :delegate
|
10
|
+
|
11
|
+
def initialize(site, delegate=nil)
|
12
|
+
@site = site
|
13
|
+
@delegate = delegate
|
14
|
+
end
|
15
|
+
|
16
|
+
def stale?
|
17
|
+
return @delegate.stale? if @delegate
|
18
|
+
false
|
19
|
+
end
|
20
|
+
|
21
|
+
def input_mtime(page)
|
22
|
+
return @delegate.input_mtime(page) if @delegate
|
23
|
+
0
|
24
|
+
end
|
25
|
+
|
26
|
+
def simple_name
|
27
|
+
return @delegate.simple_name if @delegate
|
28
|
+
nil
|
29
|
+
end
|
30
|
+
|
31
|
+
def relative_source_path
|
32
|
+
return @delegate.relative_source_path if @delegate
|
33
|
+
nil
|
34
|
+
end
|
35
|
+
|
36
|
+
def output_filename
|
37
|
+
return @delegate.output_filename if @delegate
|
38
|
+
nil
|
39
|
+
end
|
40
|
+
|
41
|
+
def output_path
|
42
|
+
File.join( File.dirname( relative_source_path ), output_filename )
|
43
|
+
end
|
44
|
+
|
45
|
+
def output_extension
|
46
|
+
return @delegate.output_extension if @delegate
|
47
|
+
File.extname( output_filename )
|
48
|
+
end
|
49
|
+
|
50
|
+
def path
|
51
|
+
return @delegate.path if @delegate
|
52
|
+
nil
|
53
|
+
end
|
54
|
+
|
55
|
+
def front_matter
|
56
|
+
return @delegate.front_matter if @delegate
|
57
|
+
{}
|
58
|
+
end
|
59
|
+
|
60
|
+
def content_syntax
|
61
|
+
return @delegate.raw_content if @delegate
|
62
|
+
:none
|
63
|
+
end
|
64
|
+
|
65
|
+
def raw_content
|
66
|
+
return @delegate.raw_content if @delegate
|
67
|
+
nil
|
68
|
+
end
|
69
|
+
|
70
|
+
def rendered_content(context, with_layouts=true)
|
71
|
+
return @delegate.rendered_content(context, with_layouts) if @delegate
|
72
|
+
nil
|
73
|
+
end
|
74
|
+
|
75
|
+
def content_line_offset
|
76
|
+
return @delegate.content_line_offset if @delegate
|
77
|
+
0
|
78
|
+
end
|
79
|
+
|
80
|
+
def inherit_front_matter(page)
|
81
|
+
@delegate.inherit_front_matter(page) if @delegate
|
82
|
+
end
|
83
|
+
|
84
|
+
def to_chain
|
85
|
+
chain = [ self ]
|
86
|
+
chain += @delegate.to_chain if @delegate
|
87
|
+
chain.flatten
|
88
|
+
end
|
89
|
+
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
|
2
|
+
require 'awestruct/handlers/base_handler'
|
3
|
+
|
4
|
+
require 'compass'
|
5
|
+
require 'ninesixty'
|
6
|
+
require 'bootstrap-sass'
|
7
|
+
|
8
|
+
module Awestruct
|
9
|
+
module Handlers
|
10
|
+
class BaseSassHandler < BaseHandler
|
11
|
+
|
12
|
+
attr_reader :syntax
|
13
|
+
|
14
|
+
def initialize(site, delegate, syntax)
|
15
|
+
super( site, delegate )
|
16
|
+
@syntax = syntax
|
17
|
+
end
|
18
|
+
|
19
|
+
def simple_name
|
20
|
+
File.basename( relative_source_path, ".#{syntax}" )
|
21
|
+
end
|
22
|
+
|
23
|
+
def output_filename
|
24
|
+
simple_name + '.css'
|
25
|
+
end
|
26
|
+
|
27
|
+
def rendered_content(context, with_layouts=true)
|
28
|
+
sass_opts = Compass.sass_engine_options
|
29
|
+
sass_opts[:load_paths] ||= []
|
30
|
+
Compass::Frameworks::ALL.each do |framework|
|
31
|
+
sass_opts[:load_paths] << framework.stylesheets_directory
|
32
|
+
end
|
33
|
+
sass_opts[:load_paths] << File.dirname( context.page.source_path )
|
34
|
+
sass_opts[:syntax] = syntax
|
35
|
+
sass_opts[:custom] = site
|
36
|
+
sass_engine = Sass::Engine.new( raw_content, sass_opts )
|
37
|
+
sass_engine.render
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'awestruct/handlers/base_handler'
|
2
|
+
|
3
|
+
module Awestruct
|
4
|
+
module Handlers
|
5
|
+
class FileHandler < BaseHandler
|
6
|
+
|
7
|
+
attr_accessor :path
|
8
|
+
|
9
|
+
def initialize(site, path)
|
10
|
+
super( site )
|
11
|
+
case ( path )
|
12
|
+
when Pathname
|
13
|
+
@path = path
|
14
|
+
else
|
15
|
+
@path = Pathname.new( path.to_s )
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def output_filename
|
20
|
+
File.basename( @path )
|
21
|
+
end
|
22
|
+
|
23
|
+
def relative_source_path
|
24
|
+
begin
|
25
|
+
p = path.relative_path_from( site.dir )
|
26
|
+
return nil if !! ( %r(^\.\.) =~ p )
|
27
|
+
File.join( '', p )
|
28
|
+
rescue
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def stale?
|
34
|
+
return true if ( @content.nil? || ( File.mtime( @path ) > @mtime ) )
|
35
|
+
false
|
36
|
+
end
|
37
|
+
|
38
|
+
def input_mtime(page)
|
39
|
+
path.mtime
|
40
|
+
end
|
41
|
+
|
42
|
+
def raw_content
|
43
|
+
read
|
44
|
+
@content
|
45
|
+
end
|
46
|
+
|
47
|
+
def rendered_content(context, with_layouts=true)
|
48
|
+
raw_content
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
def read
|
54
|
+
( @content = File.read( @path ) ) if stale?
|
55
|
+
@mtime = File.mtime( @path )
|
56
|
+
return @content
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'awestruct/handlers/base_handler'
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
module Awestruct
|
6
|
+
module Handlers
|
7
|
+
class FrontMatterHandler < BaseHandler
|
8
|
+
|
9
|
+
def initialize(site, delegate)
|
10
|
+
super
|
11
|
+
@parsed_parts = false
|
12
|
+
end
|
13
|
+
|
14
|
+
def front_matter
|
15
|
+
parse_parts()
|
16
|
+
@front_matter
|
17
|
+
end
|
18
|
+
|
19
|
+
def raw_content
|
20
|
+
parse_parts()
|
21
|
+
@raw_content
|
22
|
+
end
|
23
|
+
|
24
|
+
def content_line_offset
|
25
|
+
parse_parts()
|
26
|
+
@content_line_offset
|
27
|
+
end
|
28
|
+
|
29
|
+
def inherit_front_matter(page)
|
30
|
+
page.inherit_front_matter_from( front_matter )
|
31
|
+
super
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def parse_parts
|
37
|
+
return if ( @parsed_parts && ! delegate.stale? )
|
38
|
+
|
39
|
+
full_content = delegate.raw_content
|
40
|
+
full_content.force_encoding(site.encoding) if site.encoding
|
41
|
+
yaml_content = ''
|
42
|
+
|
43
|
+
dash_lines = 0
|
44
|
+
mode = :yaml
|
45
|
+
|
46
|
+
@raw_content = ''
|
47
|
+
@content_line_offset = 0
|
48
|
+
|
49
|
+
full_content.each_line do |line|
|
50
|
+
if ( line.strip == '---' )
|
51
|
+
dash_lines = dash_lines +1
|
52
|
+
end
|
53
|
+
if ( mode == :yaml )
|
54
|
+
@content_line_offset += 1
|
55
|
+
yaml_content << line
|
56
|
+
else
|
57
|
+
@raw_content << line
|
58
|
+
end
|
59
|
+
if ( dash_lines == 2 )
|
60
|
+
mode = :page
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
if ( dash_lines == 0 )
|
65
|
+
@raw_content = yaml_content
|
66
|
+
yaml_content = ''
|
67
|
+
@content_line_offset = 0
|
68
|
+
elsif ( mode == :yaml )
|
69
|
+
@raw_content = nil
|
70
|
+
@content_line_offset = -1
|
71
|
+
end
|
72
|
+
|
73
|
+
@front_matter = YAML.load( yaml_content ) || {}
|
74
|
+
@parsed_parts = true
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|