- $chapter->appendTextChild( 'next_url', sprintf( '%sch%02d.html', $prepend_chapter, $counter + 1 ) );
- $chapter->appendTextChild( 'canonical_url',
- sprintf( 'http://www.exim.org/exim-html-current/doc/html/spec_html/%sch%02d.html', $prepend_chapter, $counter ) );
+ $chapter->appendTextChild( 'next_url', sprintf( '%sch%02d.html', $prepend_chapter, $counter + 1 ) )
+ unless int(@chapters) == $counter;
+ $chapter->appendTextChild( 'toc_url', ( $type eq 'filter' ? 'filter' : 'index' ) . '.html' );
+ $chapter->appendTextChild(
+ 'canonical_url',
+ sprintf(
+ 'http://www.exim.org/exim-html-current/doc/html/spec_html/%sch%02d.html',
+ $prepend_chapter, $counter
+ )
+ );
+ if ( $version ne $opt{latest} ) {
+ $chapter->appendTextChild(
+ 'current_url',
+ sprintf(
+ '../../../../exim-html-current/doc/html/spec_html/%sch%02d.html',
+ $prepend_chapter, $counter
+ )
+ );
+ }