null+****@clear*****
null+****@clear*****
2011年 5月 24日 (火) 01:17:16 JST
Kouhei Sutou 2011-05-23 16:17:16 +0000 (Mon, 23 May 2011)
New Revision: 46ef5a49b442d9c3df0f34af9871b3fcf4ba649c
Log:
[doc] fix top-to-link for groonga.org.
Modified files:
doc/themes/groonga/layout.html
tools/prepare-sphinx-html.rb
Modified: doc/themes/groonga/layout.html (+1 -1)
===================================================================
--- doc/themes/groonga/layout.html 2011-05-23 15:59:03 +0000 (76446cc)
+++ doc/themes/groonga/layout.html 2011-05-23 16:17:16 +0000 (b29de8b)
@@ -13,7 +13,7 @@
{% block header %}
<div class="header">
<h1 class="title">
- <a href="./">
+ <a id="top-link" href="{{ pathto('index.html', 1) }}">
<span class="title">groonga</span>
<span class="title-separator">-</span>
<span class="title-short-description">An open-source fulltext search engine and column store.</span>
Modified: tools/prepare-sphinx-html.rb (+8 -1)
===================================================================
--- tools/prepare-sphinx-html.rb 2011-05-23 15:59:03 +0000 (a875791)
+++ tools/prepare-sphinx-html.rb 2011-05-23 16:17:16 +0000 (172f5ff)
@@ -19,6 +19,7 @@ def fix_locale_link(url, locale)
url.gsub(/\A((?:\.\.\/){2,})([a-z]{2})\/html\//) do
relative_base_path = $1
link_locale = $2
+ close_quote = $3
if locale == "en"
relative_base_path = relative_base_path.gsub(/\A\.\.\//, '')
end
@@ -30,13 +31,19 @@ def fix_locale_link(url, locale)
end
def fix_html_link(html, locale)
- html.gsub(/(href|src)="(.+?)"/) do
+ html = html.gsub(/(href|src)="(.+?)"/) do
attribute = $1
link = $2
link = fix_link_path(link)
link = fix_locale_link(link, locale)
"#{attribute}=\"#{link}\""
end
+ html.gsub(/(id="top-link" href=)"(.+?)"/) do
+ prefix = $1
+ top_path = $2
+ top_path = "." if top_path == "#"
+ "#{prefix}\"#{top_path}/../\""
+ end
end
def fix_js_link(js, locale)