~ubuntu-branches/ubuntu/wily/tdiary/wily

« back to all changes in this revision

Viewing changes to contrib2/plugin/ja/google_sitemaps.rb

  • Committer: Bazaar Package Importer
  • Author(s): Daigo Moriwaki
  • Date: 2011-04-11 21:53:16 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110411215316-ih4gt4q8p29d2wf8
Tags: 3.0.1-1
* New upstream release (Closes: #542801, #594947)
* debian/control:
 - Bumped up Standards-Version to 3.9.1.
 - Updated version dependency.
* debian/tdiary-setup.rb: Followed the upstream changes, incorporating js and
  index.fcgi

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# google_sitemap.rb
 
2
# Copyright (c) 2006 http://d.bulkitem.com/
 
3
# Distributed under the GPL
 
4
 
 
5
add_conf_proc('google_sitemaps', 'Google sitemap') do
 
6
  saveconf_google_sitemaps
 
7
 
 
8
  request_uri = File::dirname(ENV['REQUEST_URI'])
 
9
  if request_uri == "/"
 
10
    @conf['google_sitemaps.uri_format'] ||= 'http://' + @cgi.server_name + '/index.cgi?date=%s'
 
11
  else
 
12
    @conf['google_sitemaps.uri_format'] ||= 'http://' + @cgi.server_name + request_uri + '/index.cgi?date=%s'
 
13
  end
 
14
  @conf['google_sitemaps.output_file'] ||= File::dirname(ENV['SCRIPT_FILENAME']) + '/sitemap.xml'
 
15
 
 
16
  if File.writable_real?(@conf['google_sitemaps.output_file']) == false
 
17
    msg = "<strong>[NG] 指定されているファイルの書き込み権限がありません。</strong>"
 
18
  else
 
19
    msg = "[OK] 指定されているファイルの書き込み権限があります。"
 
20
  end
 
21
 
 
22
  <<-HTML
 
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>
 
28
 
 
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>
 
32
  <p>#{msg}</p>
 
33
  HTML
 
34
 
 
35
end