]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Merge commit 'smcv/aggregateinternal' into aggregateinternal
authorJoey Hess <joey@kodama.kitenet.net>
Tue, 15 Jul 2008 02:42:22 +0000 (22:42 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Tue, 15 Jul 2008 02:42:22 +0000 (22:42 -0400)
Conflicts:

doc/plugins/aggregate.mdwn

IkiWiki/Plugin/aggregate.pm
doc/ikiwiki-transition.mdwn
doc/plugins/aggregate.mdwn
doc/todo/aggregate_to_internal_pages.mdwn
ikiwiki-transition

index 2fcdec9e73d71ad303ff4f807d8f81a9bcc58248..f648a3f99f053dd99aa0fb255f5994c20358a327 100644 (file)
@@ -132,9 +132,11 @@ sub migrate_to_internal { #{{{
 
        foreach my $data (values %guids) {
                next unless $data->{page};
+               next if $data->{expired};
                
                $config{aggregateinternal} = 0;
                my $oldname = pagefile($data->{page});
+               my $oldoutput = $config{destdir}."/".IkiWiki::htmlpage($data->{page});
                
                $config{aggregateinternal} = 1;
                my $newname = pagefile($data->{page});
@@ -154,6 +156,10 @@ sub migrate_to_internal { #{{{
                else {
                        debug("$oldname not found");
                }
+               if (-e $oldoutput) {
+                       debug("removing output file $oldoutput");
+                       unlink($oldoutput) || error ("$!");
+               }
        }
        
        savestate();
index 624268d23b6c49c9a5fea73baefb5962c826f295..3290ca7e908b4328c60329523da5cfd973e0ae6f 100644 (file)
@@ -28,7 +28,7 @@ treat these as preprocessor directives and convert them.
 # aggregateinternal
 
 The `aggregateinternal` mode moves pages aggregated by the aggregate plugin
-so that the `aggregateinternal` option can be endabled 
+so that the `aggregateinternal` option can be enabled.
 
 # indexdb
 
index d87e33ab93aec8be9e6d49254231696459d00cb0..ecca0232ea0aacbac18a451dc3446a10d27787f5 100644 (file)
@@ -101,8 +101,7 @@ you should follow this process:
    be changed to `internal(foo/*)`. This has to be done because internal
    pages are not matched by regular globs.
 2. Turn on `aggregateinternal` in the setup file.
-3. Use [[ikiwiki-transition]] to move all existing aggregated `.html`
-   files. The command to run is `ikiwiki-transition aggregateinternal $srcdir`,
-   or if you have changed the `htmlext` option to something other than "html",
-   `ikiwiki-transition aggregateinternal $srcdir $htmlext`
+3. Use [[ikiwiki-transition]] to rename all existing aggregated `.html`
+   files in the srcdir. The command to run is
+   `ikiwiki-transition aggregateinternal $setupfile`,
 4. Refresh the wiki. (`ikiwiki -setup your.setup -refresh`)
index 7eddc589131fc7a8e8a91fac2de6533b8bba9c34..38427133f006e73338bf426eafde5a822eaa89e2 100644 (file)
@@ -53,7 +53,7 @@ change their pagespecs to use `internal()`.
 
 > I've patched ikiwiki-transition to have an aggregateinternal mode.
 > See my aggregateinternal branch, again.
-> "ikiwiki-transition aggregateinternal $srcdir $htmlext" moves the pages around,
+> "ikiwiki-transition aggregateinternal $setupfile" moves the pages around,
 > although it doesn't update the pagespecs (I wouldn't know how...) --[[smcv]]
 
 [[tag patch done]]
index 6524297ee6e0fa00749210a5593e70290b3913a4..3e2c89bf9d0166d2a1b29d56541b4b8c272d75d7 100755 (executable)
@@ -100,12 +100,12 @@ sub hashpassword {
 }
 
 sub aggregateinternal {
-       $config{srcdir} = shift;
-       $config{wikistatedir} = $config{srcdir}."/.ikiwiki";
-       $config{htmlext} = (shift or "html");
-
+       require IkiWiki::Setup;
        require IkiWiki::Plugin::aggregate;
 
+       %config = (IkiWiki::defaultconfig(), IkiWiki::Setup::load(shift));
+       IkiWiki::checkconfig();
+
        IkiWiki::Plugin::aggregate::migrate_to_internal();
 
        print "... now add aggregateinternal => 1 to your .setup file\n";
@@ -117,7 +117,7 @@ sub usage {
        print STDERR "  prefix_directives file\n";
        print STDERR "  indexdb srcdir\n";
        print STDERR "  hashpassword srcdir\n";
-       print STDERR "  aggregateinternal srcdir [htmlext]\n";
+       print STDERR "  aggregateinternal setupfile\n";
        exit 1;
 }