Skip to content

Commit

Permalink
Fixed bug where the staticExportItemWillBegin function wasn't called …
Browse files Browse the repository at this point in the history
…with Static publishing, as well as extended the renderLocation variable
  • Loading branch information
ccgus committed Sep 10, 2012
1 parent 5132f5f commit 6fa4142
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions plugins-bundle/Static/Static/VPBWriter.m
Expand Up @@ -226,6 +226,11 @@ - (void)exportAndLimitToCount:(NSInteger)postCount {

currentPageCount++;


if ([jstalk hasFunctionNamed:@"staticExportItemWillBegin"]) {
[jstalk callFunctionNamed:@"staticExportItemWillBegin" withArguments:[NSArray arrayWithObjects:doc, item, _staticSetup, nil]];
}

NSDictionary *renderOptions = [NSDictionary dictionaryWithObjectsAndKeys:jstalk, @"jstalk", [NSNumber numberWithBool:YES], @"ignoreTemplateWrapping", [NSNumber numberWithBool:YES], @"ignoreAutoLinks", nil];

NSDictionary *d = [webExportController renderItem:item options:renderOptions];
Expand Down Expand Up @@ -362,11 +367,10 @@ - (void)exportAndLimitToCount:(NSInteger)postCount {
}
}

[exportContext removeObjectForKey:@"renderLocation"];


// write the archive page!
{
[exportContext setObject:@"archivePage" forKey:@"renderLocation"];

// close the opening div we've got going on.
[archivePage appendString:@"</div>\n"];

Expand All @@ -385,6 +389,9 @@ - (void)exportAndLimitToCount:(NSInteger)postCount {


if ([jstalk hasFunctionNamed:@"staticSupportPages"]) {

[exportContext setObject:@"archivePage" forKey:@"staticSupportPage"];

NSArray *supportPagesList = [jstalk callFunctionNamed:@"staticSupportPages" withArguments:[NSArray arrayWithObjects:doc, _staticSetup, nil]];

for (NSString *key in supportPagesList) @autoreleasepool {
Expand Down Expand Up @@ -434,12 +441,9 @@ - (void)exportAndLimitToCount:(NSInteger)postCount {
}

}




}

[exportContext removeObjectForKey:@"renderLocation"];

if ([jstalk hasFunctionNamed:@"staticExportDidEnd"]) {
[jstalk callFunctionNamed:@"staticExportDidEnd" withArguments:[NSArray arrayWithObjects:doc, _staticSetup, nil]];
Expand Down

0 comments on commit 6fa4142

Please sign in to comment.