diff options
author | Eric Wong <e@80x24.org> | 2019-01-04 13:46:50 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-01-04 13:57:04 +0000 |
commit | c526442ad8f9fddc1b99c0309cfdfbb05a9b582f (patch) | |
tree | 4d1673bbd6b0a04358fe3342304bce8b5f94e68a | |
parent | baeeae3f945889e4ec2c41661e40a627d4a1d4e0 (diff) | |
download | olddoc-c526442ad8f9fddc1b99c0309cfdfbb05a9b582f.tar.gz |
It's common to have gitweb and cgit URLs which are viewable in the browser AND clonable. So add links to encourage follows.
-rw-r--r-- | lib/oldweb/_tail.rhtml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/oldweb/_tail.rhtml b/lib/oldweb/_tail.rhtml index 14fc5a8..e3fada5 100644 --- a/lib/oldweb/_tail.rhtml +++ b/lib/oldweb/_tail.rhtml @@ -22,8 +22,11 @@ href="mailto:<%= private_email %>"><%= private_email %></a><% end if url_or_cmd = source_code.shift + url_or_cmd = url_or_cmd.sub(%r{\b(https?://\S+)}, "<a\nhref='\\1'>\\1</a>") %> source code: <%= url_or_cmd %> -<% source_code.each do |x| %><%= "\t#{x}" %><% end +<% source_code.each do |x| %><%= + %Q{\t#{x.sub(%r{\b(https?://\S+)}, %Q{<a\nhref='\\1'>\\1</a>})}} +%><% end end %></pre><% end %> |