2
# Copyright (c) 2006 http://d.bulkitem.com/
3
# Distributed under the GPL
5
add_conf_proc('google_sitemaps', 'Google sitemap') do
6
saveconf_google_sitemaps
8
request_uri = File::dirname(ENV['REQUEST_URI'])
10
@conf['google_sitemaps.uri_format'] ||= 'http://' + @cgi.server_name + '/index.cgi?date=%s'
12
@conf['google_sitemaps.uri_format'] ||= 'http://' + @cgi.server_name + request_uri + '/index.cgi?date=%s'
14
@conf['google_sitemaps.output_file'] ||= File::dirname(ENV['SCRIPT_FILENAME']) + '/sitemap.xml'
16
if File.writable_real?(@conf['google_sitemaps.output_file']) == false
17
msg = "<strong>[NG] 指定されているファイルの書き込み権限がありません。</strong>"
19
msg = "[OK] 指定されているファイルの書き込み権限があります。"
23
<p>Google ウェブマスターツール用のSitemap XMLを出力する設定を行います。</p>
24
<h3 class="subtitle">アドレスフォーマット</h3>
25
<p>日付別表示時のURLフォーマットを指定します。日付文字列の部分は<strong>%s</strong>にしてください。</p>
26
<p><input type="text" name="google_sitemaps.uri_format" value="#{ CGI::escapeHTML(@conf['google_sitemaps.uri_format']) }" size="50"></p>
27
<div class="section">eg.<br>http://www.example.com/inex.cgi?date=<strong>%s</strong><br>http://www.example.com/<strong>%s</strong>.html</div>
29
<h3 class="subtitle">XMLファイルの出力先</h3>
30
<p>出力するファイルを絶対パスで指定します。</p>
31
<p><input type="text" name="google_sitemaps.output_file" value="#{ CGI::escapeHTML(@conf['google_sitemaps.output_file']) }" size=\"50\"></p>