| 1 | # ABSTRACT: Role for objects that are converted during the publishing process | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | package HiD::Role::IsConverted; | ||||||||||||||||||||||||||||
| 5 | 8 | $HiD::Role::IsConverted::VERSION = '1.5'; | |||||||||||||||||||||||||||
| 6 | 8 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 8 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 8 | ▶ | use 5.014; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 8 | ▶ | use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 8 | ▶ | use autodie; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 8 | ▶ | use warnings qw/ FATAL utf8 /; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 8 | ▶ | use open qw/ :std :utf8 /; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | 8 | ▶ | use charnames qw/ :full /; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | 8 | ▶ | use feature qw/ unicode_strings /; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 8 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 18 | 8 | ▶ | use Class::Load qw/ :all /; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | 8 | ▶ | use Encode; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | 8 | ▶ | use File::Slurp qw/ read_file /; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 21 | 8 | ▶ | use HiD::Types; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 22 | 8 | ▶ | use YAML::XS qw/ Load /; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 8 | requires 'get_default_layout'; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 8 | has content => ( | |||||||||||||||||||||||||||
| 28 | is => 'ro', | ||||||||||||||||||||||||||||
| 29 | isa => 'Str', | ||||||||||||||||||||||||||||
| 30 | required => 1 , | ||||||||||||||||||||||||||||
| 31 | ); | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | has converted_content => ( | ||||||||||||||||||||||||||||
| 35 | is => 'ro' , | ||||||||||||||||||||||||||||
| 36 | isa => 'Str' , | ||||||||||||||||||||||||||||
| 37 | lazy => 1 , | ||||||||||||||||||||||||||||
| 38 | default => sub { | ||||||||||||||||||||||||||||
| 39 | 51 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 40 | 51 | return _convert_by_extension( $self->content , $self->ext ); | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | 8 | ); | |||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | has converted_excerpt => ( | ||||||||||||||||||||||||||||
| 46 | is => 'ro' , | ||||||||||||||||||||||||||||
| 47 | isa => 'Str' , | ||||||||||||||||||||||||||||
| 48 | lazy => 1 , | ||||||||||||||||||||||||||||
| 49 | default => sub { | ||||||||||||||||||||||||||||
| 50 | 10 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | 10 | my $converted_excerpt = _convert_by_extension( $self->excerpt , $self->ext ); | |||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 10 | ▶ | if ( $self->excerpt ne $self->content ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 55 | # Add the "read more" link | ||||||||||||||||||||||||||||
| 56 | ### FIXME this should be configurable | ||||||||||||||||||||||||||||
| 57 | 1 | $converted_excerpt .= $self->readmore_link; | |||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | 10 | return $converted_excerpt; | |||||||||||||||||||||||||||
| 61 | }, | ||||||||||||||||||||||||||||
| 62 | 8 | ); | |||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 8 | has hid => ( | |||||||||||||||||||||||||||
| 66 | is => 'ro' , | ||||||||||||||||||||||||||||
| 67 | isa => 'HiD' , | ||||||||||||||||||||||||||||
| 68 | required => 1 , | ||||||||||||||||||||||||||||
| 69 | handles => [ qw/ get_config /] , | ||||||||||||||||||||||||||||
| 70 | ); | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | 8 | has layouts => ( | |||||||||||||||||||||||||||
| 74 | is => 'ro' , | ||||||||||||||||||||||||||||
| 75 | isa => 'HashRef[HiD::Layout]' , | ||||||||||||||||||||||||||||
| 76 | required => 1 , | ||||||||||||||||||||||||||||
| 77 | ); | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | has metadata => ( | ||||||||||||||||||||||||||||
| 81 | is => 'ro' , | ||||||||||||||||||||||||||||
| 82 | isa => 'HashRef' , | ||||||||||||||||||||||||||||
| 83 | 0 | ▶ | default => sub {{}} , | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 84 | 8 | lazy => 1, | |||||||||||||||||||||||||||
| 85 | traits => [ 'Hash' ] , | ||||||||||||||||||||||||||||
| 86 | handles => { | ||||||||||||||||||||||||||||
| 87 | get_metadata => 'get', | ||||||||||||||||||||||||||||
| 88 | }, | ||||||||||||||||||||||||||||
| 89 | ); | ||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | has readmore_link => ( | ||||||||||||||||||||||||||||
| 93 | is => 'ro' , | ||||||||||||||||||||||||||||
| 94 | isa => 'Str' , | ||||||||||||||||||||||||||||
| 95 | lazy => 1 , | ||||||||||||||||||||||||||||
| 96 | default => sub { | ||||||||||||||||||||||||||||
| 97 | 1 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=9.9
| |||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | 1 | ▶ | if ( defined $self->get_config('readmore_link')) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 100 | 0 | my $link = $self->get_config('readmore_link'); | |||||||||||||||||||||||||||
| 101 | 0 | my $url = $self->url; | |||||||||||||||||||||||||||
| 102 | 0 | $link =~ s/__URL__/$url/; | |||||||||||||||||||||||||||
| 103 | 0 | return $link; | |||||||||||||||||||||||||||
| 104 | }; | ||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||
| 106 | return | ||||||||||||||||||||||||||||
| 107 | 1 | q{<p class="readmore"><a href="} | |||||||||||||||||||||||||||
| 108 | . $self->url | ||||||||||||||||||||||||||||
| 109 | . q{" class="readmore">read more</a></p>}; | ||||||||||||||||||||||||||||
| 110 | }, | ||||||||||||||||||||||||||||
| 111 | 8 | ); | |||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||
| 114 | has rendered_content => ( | ||||||||||||||||||||||||||||
| 115 | is => 'ro' , | ||||||||||||||||||||||||||||
| 116 | isa => 'Str' , | ||||||||||||||||||||||||||||
| 117 | lazy => 1 , | ||||||||||||||||||||||||||||
| 118 | default => sub { | ||||||||||||||||||||||||||||
| 119 | 51 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=15.0
| |||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||
| 121 | 51 | ▶ | my $layout_name = $self->get_metadata( 'layout' ) // $self->get_default_layout; | ||||||||||||||||||||||||||
|
Condition66%2/3
$self->get_metadata("layout") // $self->get_default_layout
MC/DC0%0/2
$self->get_metadata("layout") // $self->get_default_layout
$self->get_metadata("layout")
$self->get_default_layout
Truth table66%2/3
A // B
A= $self->get_metadata("layout")B= $self->get_default_layout
| |||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||
| 123 | my $layout = $self->layouts->{$layout_name} // $self->layouts->{default} // | ||||||||||||||||||||||||||||
| 124 | 51 | ▶ | die "FIXME no default layout?"; | ||||||||||||||||||||||||||
|
Condition40%2/5
($self->layouts->{$layout_name} // $self->layouts->{"default"}) // die("FIXME no default layout?")
$self->layouts->{$layout_name} // $self->layouts->{"default"}
MC/DC0%0/2
($self->layouts->{$layout_name} // $self->layouts->{"default"}) // die("FIXME no default layout?")
$self->layouts->{$layout_name}
$self->layouts->{"default"}
Truth table33%1/3
A // B
A= $self->layouts->{$layout_name}B= $self->layouts->{"default"}
| |||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||
| 126 | 51 | my $output = $layout->render( $self->template_data ); | |||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||
| 128 | 50 | return $output; | |||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||
| 130 | 8 | ); | |||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||
| 133 | has template_data => ( | ||||||||||||||||||||||||||||
| 134 | is => 'ro' , | ||||||||||||||||||||||||||||
| 135 | isa => 'HashRef' , | ||||||||||||||||||||||||||||
| 136 | lazy => 1 , | ||||||||||||||||||||||||||||
| 137 | default => sub { | ||||||||||||||||||||||||||||
| 138 | 51 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||
| 140 | my $data = { | ||||||||||||||||||||||||||||
| 141 | baseurl => $self->hid->config->{baseurl} , | ||||||||||||||||||||||||||||
| 142 | 51 | content => $self->converted_content , | |||||||||||||||||||||||||||
| 143 | page => $self->metadata , | ||||||||||||||||||||||||||||
| 144 | site => $self->hid , | ||||||||||||||||||||||||||||
| 145 | }; | ||||||||||||||||||||||||||||
| 146 | 51 | ▶ | $data->{post} = $self if $self->does('HiD::Role::IsPost'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||
| 148 | 51 | ▶ | $data->{page}{url} = $self->url if $self->can( 'url' ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||
| 150 | 50 | return $data; | |||||||||||||||||||||||||||
| 151 | }, | ||||||||||||||||||||||||||||
| 152 | 8 | ); | |||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||
| 154 | around BUILDARGS => sub { | ||||||||||||||||||||||||||||
| 155 | 85 | ▶ | my $orig = shift; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=8 SCAR=22.1
| |||||||||||||||||||||||||||||
| 156 | 85 | my $class = shift; | |||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||
| 158 | 85 | ▶ | my %args = ( ref $_[0] and ref $_[0] eq 'HASH' ) ? %{ $_[0] } : @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $_[0] and ref $_[0] eq "HASH"
MC/DC0%0/2
ref $_[0] and ref $_[0] eq "HASH"
ref $_[0]
ref $_[0] eq "HASH"
Truth table33%1/3
A and B
A= ref $_[0]B= ref $_[0] eq "HASH"
| |||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||
| 160 | 85 | ▶ | unless ( $args{content} and $args{metadata} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$args{"content"} and $args{"metadata"}
MC/DC0%0/2
$args{"content"} and $args{"metadata"}
$args{"content"}
$args{"metadata"}
Truth table33%1/3
A and B
A= $args{"content"}B= $args{"metadata"}
| |||||||||||||||||||||||||||||
| 161 | 85 | my $file_content = read_file( $args{input_filename}, binmode => ':utf8' ); | |||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||
| 163 | 85 | my( $metadata , $content ); | |||||||||||||||||||||||||||
| 164 | 85 | ▶ | if ( $file_content =~ /^---/ ) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 165 | 77 | ( $metadata , $content ) = $file_content | |||||||||||||||||||||||||||
| 166 | =~ /^---\n?(.*?)---\n?(.*)$/ms; | ||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||
| 168 | elsif ( $args{input_filename} =~ /\.html?$/ ) { | ||||||||||||||||||||||||||||
| 169 | 0 | die "plain HTML file without YAML front matter" | |||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||
| 171 | else { | ||||||||||||||||||||||||||||
| 172 | 8 | $content = $file_content; | |||||||||||||||||||||||||||
| 173 | 8 | $metadata = ''; | |||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||
| 176 | 85 | $args{content} = $content; | |||||||||||||||||||||||||||
| 177 | 85 | ▶ | $args{metadata} = Load( encode('utf8',$metadata) ) // {}; | ||||||||||||||||||||||||||
|
Condition100%2/2
Load(&encode("utf8", $metadata)) // {}
MC/DC100%1/1
Load(&encode("utf8", $metadata)) // {}
Load(&encode("utf8", $metadata))
Truth table100%2/2
A
A= Load(&encode("utf8", $metadata))
| |||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||
| 180 | 85 | return $class->$orig( \%args ); | |||||||||||||||||||||||||||
| 181 | 8 | }; | |||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||
| 183 | { # hide the map | ||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||
| 185 | ### FIXME make this extensible | ||||||||||||||||||||||||||||
| 186 | 8 | my %conversion_extension_map = ( | |||||||||||||||||||||||||||
| 187 | markdown => [ 'Text::Markdown' , 'markdown' ] , | ||||||||||||||||||||||||||||
| 188 | mkdn => [ 'Text::Markdown' , 'markdown' ] , | ||||||||||||||||||||||||||||
| 189 | mk => [ 'Text::Markdown' , 'markdown' ] , | ||||||||||||||||||||||||||||
| 190 | md => [ 'Text::Markdown' , 'markdown' ] , | ||||||||||||||||||||||||||||
| 191 | mmd => [ 'Text::MultiMarkdown' , 'markdown' ] , | ||||||||||||||||||||||||||||
| 192 | textile => [ 'Text::Textile' , 'process' ] , | ||||||||||||||||||||||||||||
| 193 | ); | ||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||
| 195 | sub _convert_by_extension { | ||||||||||||||||||||||||||||
| 196 | 61 | ▶ | my( $content , $extension ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
_convert_by_extension: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||
| 198 | return $content | ||||||||||||||||||||||||||||
| 199 | 61 | ▶ | unless exists $conversion_extension_map{ $extension }; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||
| 201 | 49 | my( $module , $method ) = @{ $conversion_extension_map{ $extension }}; | |||||||||||||||||||||||||||
| 202 | 49 | load_class( $module ); | |||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||
| 204 | 49 | my $converted = $module->new->$method( $content ); | |||||||||||||||||||||||||||
| 205 | 49 | return $converted; | |||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||
| 209 | 8 | ▶ | no Moose::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 210 | 8 | 1; | |||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||
| 212 | __END__ | ||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||
| 214 | =pod | ||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||
| 216 | =encoding utf-8 | ||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||
| 218 | =head1 NAME | ||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||
| 220 | HiD::Role::IsConverted - Role for objects that are converted during the publishing process | ||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||
| 222 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||
| 224 | package HiD::ThingThatIsConverted | ||||||||||||||||||||||||||||
| 225 | use Moose; | ||||||||||||||||||||||||||||
| 226 | with 'HiD::Role::IsConverted'; | ||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||
| 228 | ... | ||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||
| 230 | 1; | ||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||
| 232 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||
| 234 | This role is consumed by objects that are converted during the publication | ||||||||||||||||||||||||||||
| 235 | process -- e.g., from Markdown or Textile to HTML, or rendered through a | ||||||||||||||||||||||||||||
| 236 | layout object. This role provides required attributes and methods used during | ||||||||||||||||||||||||||||
| 237 | that process. | ||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||
| 239 | =head1 ATTRIBUTES | ||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||
| 241 | =head2 content ( ro / Str / required ) | ||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||
| 243 | Page content (stuff after the YAML front matter) | ||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||
| 245 | =head2 converted_content ( ro / Str / lazily built from content ) | ||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||
| 247 | Content after it has gone through the conversion process. | ||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||
| 249 | =head2 converted_excerpt ( ro / Str / lazily built from content ) | ||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||
| 251 | Excerpt after it has gone through the conversion process | ||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||
| 253 | =head2 hid | ||||||||||||||||||||||||||||
| 254 | |||||||||||||||||||||||||||||
| 255 | The HiD object for the current site. Here primarily to provide access to site | ||||||||||||||||||||||||||||
| 256 | metadata. | ||||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||
| 258 | =head2 layouts ( ro / HashRef[HiD::Layout] / required ) | ||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||
| 260 | Hashref of layout objects keyed by name. | ||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||
| 262 | =head2 metadata ( ro / HashRef ) | ||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||
| 264 | Hashref of info from YAML front matter | ||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||
| 266 | =head2 readmore_link | ||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||
| 268 | Placed at the bottom of rendered excerpts. Intended to link to the full | ||||||||||||||||||||||||||||
| 269 | version of the content. | ||||||||||||||||||||||||||||
| 270 | |||||||||||||||||||||||||||||
| 271 | A string matching C<__URL__> will be replaced with the URL of the object (i.e., | ||||||||||||||||||||||||||||
| 272 | the output of C<$self->url>) being converted. | ||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||
| 274 | =head2 rendered_content | ||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||
| 276 | Content after any layouts have been applied | ||||||||||||||||||||||||||||
| 277 | |||||||||||||||||||||||||||||
| 278 | =head2 template_data | ||||||||||||||||||||||||||||
| 279 | |||||||||||||||||||||||||||||
| 280 | Data for passing to template processing function. | ||||||||||||||||||||||||||||
| 281 | |||||||||||||||||||||||||||||
| 282 | =head1 VERSION | ||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||
| 284 | version 1.5 | ||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||
| 286 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||
| 288 | John SJ Anderson <genehack@genehack.org> | ||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||
| 290 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||
| 291 | |||||||||||||||||||||||||||||
| 292 | This software is copyright (c) 2014 by John SJ Anderson. | ||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||
| 294 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||
| 295 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||
| 297 | =cut | ||||||||||||||||||||||||||||