Skip to content

Commit

Permalink
change to docs/
Browse files Browse the repository at this point in the history
  • Loading branch information
schacon committed May 2, 2012
1 parent 0957bd2 commit fb8d9d7
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 39 deletions.
2 changes: 1 addition & 1 deletion app/helpers/doc_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module DocHelper
def man(name)
"<a href=\"/ref/#{name}\">#{name.gsub('git-', '')}</a>".html_safe
"<a href=\"/docs/#{name}\">#{name.gsub('git-', '')}</a>".html_safe
end
def linkify(content, section)
next_page = section.next_slug
Expand Down
2 changes: 1 addition & 1 deletion app/models/doc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def self.search(term, highlight = false)
:name => name,
:score => hit["_score"],
:highlight => highlight,
:url => "/ref/#{name}"
:url => "/docs/#{name}"
}
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/doc/_versions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<% @versions.each do |v| %>
<% if v[:changed] %>
<li>
<a href="/ref/<%= @file.name %>/<%= v[:name] %>"><span class="version"><%= v[:name] %></span>
<a href="/docs/<%= @file.name %>/<%= v[:name] %>"><span class="version"><%= v[:name] %></span>
<span class="diff">
<% v[:diff][0].times do %>
<img src="/images/icons/green-dot.png" />
Expand Down
4 changes: 2 additions & 2 deletions app/views/doc/ext.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
</p>
</li>
<li>
<h4><a href="/ref/gittutorial">Official Git Tutorial</a></h4>
<h4><a href="/docs/gittutorial">Official Git Tutorial</a></h4>
<p class='description'>
The official gittutorial man page is a good place to start.
</p>
</li>
<li>
<h4><a href="/ref/everyday">Everyday Git</a></h4>
<h4><a href="/docs/everyday">Everyday Git</a></h4>
<p class='description'>
Learn the basics with 20 of the most common commands.
</p>
Expand Down
2 changes: 1 addition & 1 deletion app/views/doc/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
%h2 Reference

%div.callout.ref-manual
%h3= link_to "Reference Manual", "/ref"
%h3= link_to "Reference Manual", "/docs"
%p
The official and comprehensive <strong>man pages</strong> that are included in the Git package itself.

Expand Down
4 changes: 2 additions & 2 deletions app/views/downloads/guis/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
- content_for :sidebar do
%div.callout
%p
The entire <strong><a href="#">Pro Git book</a></strong> written by Scott Chacon is available to <a href="#">read online for free</a>. Dead tree versions are available on <a href="#">Amazon.com</a>.
The entire <strong><a href="/book">Pro Git book</a></strong> written by Scott Chacon is available to <a href="/book">read online for free</a>. Dead tree versions are available on <a href="#">Amazon.com</a>.

%div#main
%h1 GUI Clients

%p
Git comes with built-in GUI tools for committing (<a href="/ref/git-gui">git-gui</a>) and browsing (<a href="/ref/gitk">gitk</a>), but there are several third-party tools for users looking for platform-specific experience.
Git comes with built-in GUI tools for committing (<a href="/docs/git-gui">git-gui</a>) and browsing (<a href="/docs/gitk">gitk</a>), but there are several third-party tools for users looking for platform-specific experience.

%p
=link_to "Only show GUIs for my OS (Windows)", "#", {:class => "subtle-button", :id => "gui-os-filter", 'data-os' => 'windows'}
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_related.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<li class="<%= rel.content_type %>">
<strong><a href="<%= rel.content_url %>"><%= rel.name %></a></strong>
<% if rel.content_type == "reference" %>
in <a href="/ref">Reference</a>
in <a href="/docs">Reference</a>
<% elsif rel.content_type == "book" %>
in <a href="/book/en">Books</a>
<% elsif rel.content_type == "video" %>
Expand Down
24 changes: 0 additions & 24 deletions app/views/shared/_sidebar.html.erb

This file was deleted.

9 changes: 6 additions & 3 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
get "site/index"

match "/doc" => "doc#index"
match "/ref" => "doc#ref"
match "/ref/:file" => "doc#man"
match "/ref/:file/:version" => "doc#man", :version => /[^\/]+/
match "/docs" => "doc#ref"
match "/docs/:file" => "doc#man"
match "/docs/:file/:version" => "doc#man", :version => /[^\/]+/
match "/test" => "doc#test"
match "/videos" => "doc#videos"
match "/doc/ext" => "doc#ext"

match "/ref/:file" => "doc#man"
match "/ref/:file/:version" => "doc#man", :version => /[^\/]+/

match "/book" => "doc#book"
match "/book/commands" => "doc#commands"
match "/book/ch:chapter-:section.html" => "doc#progit"
Expand Down
6 changes: 3 additions & 3 deletions lib/tasks/related.rake
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def find_book_links
if section = Section.find(id)
puts "linking #{section.title} with #{command}"
from = ['book', section.title, section.slug, "/book/en/#{section.slug}", score]
to = ['reference', command, command, "/ref/#{command}", score]
to = ['reference', command, command, "/docs/#{command}", score]
create_related_item(from, to)
end
end
Expand Down Expand Up @@ -78,8 +78,8 @@ def find_reference_links
next if command == name
if rdv = DocVersion.latest_for(command)
puts "linking #{name} with #{command}"
from = ['reference', name, name, "/ref/#{name}", score]
to = ['reference', command, command, "/ref/#{command}", score]
from = ['reference', name, name, "/docs/#{name}", score]
to = ['reference', command, command, "/docs/#{command}", score]
create_related_item(from, to)
end
end
Expand Down

0 comments on commit fb8d9d7

Please sign in to comment.