Skip to content

Commit b17f398

Browse files
tjgrathwelldshafik
authored andcommitted
Fix issues with Ruby curriculum updates
* Goals that had markdown blocks now actually show up * Fix "next_step" and "back to" to work with pages that have colons * Prune some empty-ish pages * Remove 'objects.step' (dupe of classes.step)
1 parent 21ab99b commit b17f398

File tree

5 files changed

+7
-38
lines changed

5 files changed

+7
-38
lines changed

lib/doc_page.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def body_content
123123
if @back
124124
div.back {
125125
text "Back to "
126-
a(class: "back", href: @back) do
126+
a(class: "back", href: URI.escape(@back, URI::PATTERN::RESERVED)) do
127127
text Titleizer.title_for_page(@back.split('#').first)
128128
end
129129
}

lib/step.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,14 @@ def link_without_toc name
9999
link name
100100
end
101101

102+
def _escaped str
103+
URI.escape(str, URI::PATTERN::RESERVED)
104+
end
105+
102106
def simple_link name, options={}
103107
require 'uri'
104108
hash = URI.escape '#'
105-
href = name + "?back=#{page_name}#{hash}step#{current_anchor_num}"
109+
href = "#{_escaped(name)}?back=#{_escaped(page_name)}#{hash}step#{current_anchor_num}"
106110
if block_given?
107111
a({:href => href}.merge(options)) do
108112
yield

sites/en/ruby/classes.step

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ explanation do
4040
message "Data is stored on your object using **instance variables** that start with an `@` sign. Instance variables behave like normal variables, but are only visible from inside a specific instance of your object. If you want the data to be externally accessible, you have to write more methods."
4141
end
4242

43-
next_step 'summary:_organizing'
43+
next_step 'how_to_write_a_program'

sites/en/ruby/getting_help.step

Lines changed: 0 additions & 20 deletions
This file was deleted.

sites/en/ruby/summary:_organizing.step

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)