Permalink
Browse files

Updated include path for the command line tool.

Updated version number.
Fixed exporting of template module caching options.
  • Loading branch information...
byrnereese committed Dec 8, 2010
1 parent 3371a09 commit 0cf517980c0753be5c499f271752f1223f9b34ed
Showing with 33 additions and 6 deletions.
  1. +8 −0 .gitignore
  2. +6 −1 Makefile.PL
  3. +1 −1 addons/ThemeExport.plugin/config.yaml
  4. +17 −3 addons/ThemeExport.plugin/lib/MT/Theme/Exporter.pm
  5. +1 −1 tools/export-theme
View
@@ -0,0 +1,8 @@
+#*
+*.bak
+*.zip
+Makefile
+Makefile.old
+MANIFEST
+MANIFEST.bak
+*~
View
@@ -1,7 +1,12 @@
use ExtUtils::MakeMaker;
+use YAML::Any qw(LoadFile);
+my $file = "addons/ThemeExport.plugin/config.yaml";
+my $version = LoadFile($file)->{version} ||
+ die "No version found in $file";
+
WriteMakefile(
NAME => 'Theme Exporter',
- VERSION => '0.2',
+ VERSION => $version,
DISTNAME => 'ThemeExport',
);
@@ -3,7 +3,7 @@ name: 'Theme Exporter'
description: "A plugin that provides a simple user interface for exporting a blog's templates into an easily distributable theme."
plugin_author: 'Endevver, LLC.'
plugin_link: 'http://endevver.com/plugins/theme-export/'
-version: 1.0
+version: 1.0.1
static_version: 1
applications:
@@ -8,6 +8,7 @@ use File::Copy::Recursive qw(dircopy);
use File::Path;
use File::Spec;
use MT;
+use MT::PublishOption;
use MT::FileMgr;
use MT::Util qw( dirify );
use YAML::Tiny;
@@ -384,13 +385,25 @@ sub _process_templates {
# Write the template text out to a file within the plugin envelope
if ( $self->_write_tmpl( $t, $ts_id, $args->{type}, $basename ) ) {
-
+ print "Wrote template " . $t->name . " (".$t->type.",build=".$t->build_type.")\n";
# Using the template in context, compile the YAML config
my $cfg = {
label => $t->name,
- filename =>
- File::Spec->catfile( $args->{type}, $basename . '.mtml' )
+ filename => File::Spec->catfile( $args->{type}, $basename . '.mtml' ),
+ ($t->type eq 'index' && $t->build_type != MT::PublishOption::ONDEMAND()) ? ( build_type => $t->build_type ) : (),
};
+ use Data::Dumper;
+# print Dumper($cfg);
+ if ($t->type =~ /^(module|widget|custom)$/) {
+ $cfg->{'include_with_ssi'} = 1 if ($t->include_with_ssi);
+ foreach (qw( expire_type expire_event expire_interval )) {
+ my $var = 'cache_'.$_;
+ if (my $val = $t->$var()) {
+ $cfg->{cache}->{$_} = $val;
+ $cfg->{cache}->{$_} *= 60 if ($_ eq 'expire_interval');
+ }
+ }
+ }
# The "config" attribute can be either a code or hash reference
if ( 'CODE' eq ref( $args->{config} ) ) {
@@ -431,6 +444,7 @@ sub _templatemap_config {
$mappings->{$type} = {
archive_type => $map->archive_type,
preferred => $map->is_preferred,
+ $map->build_type != MT::PublishOption::ONDEMAND() ? (build_type => $map->build_type) : (),
$map->file_template
&& $map->file_template ne '~' && $map->file_template ne ''
? ( file_template => $map->file_template )
View
@@ -13,7 +13,7 @@ use strict;
use warnings;
use Carp;
-use lib qw( lib extlib plugins/ThemeExport/lib );
+use lib qw( lib extlib addons/ThemeExport.plugin/lib );
use base qw( MT::Tool );
use MT::Theme::Util qw( find_theme_plugin );

0 comments on commit 0cf5179

Please sign in to comment.