# google_sitemap.rb # Copyright (c) 2006 http://d.bulkitem.com/ # Distributed under the GPL add_conf_proc('google_sitemaps', 'Google sitemap') do saveconf_google_sitemaps request_uri = File::dirname(@cgi.request_uri) if request_uri == "/" @conf['google_sitemaps.uri_format'] ||= 'http://' + @cgi.server_name + '/index.cgi?date=%s' else @conf['google_sitemaps.uri_format'] ||= 'http://' + @cgi.server_name + request_uri + '/index.cgi?date=%s' end @conf['google_sitemaps.output_file'] ||= File::dirname(ENV['SCRIPT_FILENAME']) + '/sitemap.xml' if File.writable_real?(@conf['google_sitemaps.output_file']) == false msg = "[NG] 指定されているファイルの書き込み権限がありません。" else msg = "[OK] 指定されているファイルの書き込み権限があります。" end <<-HTML

Google ウェブマスターツール用のSitemap XMLを出力する設定を行います。

アドレスフォーマット

日付別表示時のURLフォーマットを指定します。日付文字列の部分は%sにしてください。

eg.
http://www.example.com/inex.cgi?date=%s
http://www.example.com/%s.html

XMLファイルの出力先

出力するファイルを絶対パスで指定します。

#{msg}

HTML end