plainblack.com
Username Password
search
Bookmark and Share

Google Sitemap Config XML

When import this package into your asset tree, you can visit http://www.example.com/config.xml to get the google sitemap config.xml file, then you can use the tool from google to generate the sitemap.xml.gz for google sitemap. 

The command is:
#wget http://www.example.com/config.xml
#sitemap_gen.py --config=config.xml

You mast change the <site base_url="http://www.example.com" ... > and <url href="http://www.example.com ...> to fit your site need.

Chinese user can see here for details:
中文用户查看这里了解详细步骤:
http://www.webgui.cn/webgui/applications/app-list/webgui-google-sitemap 

System RequirementsPlease be advised: this contribution was tested with something older than WebGUI 7.5. When this contribution was uploaded there was no field for the author to fill out regarding it's requirements.
Comments
4Jesse: "
Great to see someone took my sitemap stuff a step further and made a package out of it!

Not sure if this got my latest tweaks, but I figured out how to do the timestamp properly for the config.xml - all it requires is a one line change to get it to do timestamps for each url.

in the <tmpl_loop pageloop>

change the url bit to:


<url href="http://www.example.com<tmpl_var page.url>"
lastmod="&#94;LastModifiedPage(<tmpl_var
page.url>,,%y-%m-%dT%h:%n:%s+00:00);" />


You'll need to replace +00:00 above with your local timezone settings
based on GMT.  So if you're in Perth you might add +08:00 while if
you're in the US you might add -08:00.

I've included an updated google sitemap package based on zxp's work with the change above.


Jesse 

-
If my comment is useful, rate me - I can always use the karma! :)
Join us on the #webgui irc channel on freenode! (I use the nick Radix)

"
4elnino: "
where is this LastModifiedPage macro coming from? I didn't see it described on the wiki either. do I need to install the package to get it?

 

Thanks!

 
"
4Jesse: "
package WebGUI::Macro::LastModifiedPage;

#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2006 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com                     info@plainblack.com
#-------------------------------------------------------------------

use strict;
use WebGUI::Asset;
use WebGUI::International;

=head1 NAME

Package WebGUI::Macro::LastModifiedPage

=head1 DESCRIPTION

Macro for displaying the date that the most recent revision of the given Asset was last modified.

=head2 process ( [asset, label, format] )

=head3 asset

Asset to calculate the date from.

=head3 label

Text to prepend to the date.  This can be the empty string.

=head3 format string

A string specifying how to format the date using codes similar to those used by
sprintf.  See L<WebGUI::Session::datetime/"epochToHuman"> for a list of codes.
Uses "%z" if empty.

=cut


#-------------------------------------------------------------------
sub process {
        my $session = shift;
        return '' unless $session->asset;
        my ($asseturl, $label, $format, $time);
        ($asseturl, $label, $format) = @_;
        $format = '%z' if ($format eq "");
        my $asset = WebGUI::Asset->newByUrl($session,$asseturl);
        ($time) = $session->dbSlave->quickArray("SELECT max(revisionDate) FROM assetData where assetId=?",[$asset->getId]);
        if ($time) {
                return $label.$session->datetime->epochToHuman($time,$format);
        }
        my $i18n = WebGUI::International->new($session,'Macro_LastModified');
        return $i18n->get('never');
}

1;

-
If my comment is useful, rate me - I can always use the karma! :)
Join us on the #webgui irc channel on freenode! (I use the nick Radix)
"
4dionak: "
Is it just me, or is this package now corrupt? 

Diona 

----

Knowmad Technologies

http://www.knowmad.com
"
Downloadgoogle-sitemap.wgpkg google-sitemap.wgpkg
LinksNo Support Offered
Statistics Downloads: 498
Views: 6286
Rating: 4
Updated: 8/7/2006
Keywords packages
NavigationBack to the Bazaar
© 2018 Plain Black Corporation | All Rights Reserved