Skip to content

Commit 28634ff

Browse files
committed
Add link to metacpan file
Fixes #42 Provide a link to the full file on Meta::CPAN
1 parent ac7eaf9 commit 28634ff

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

views/show-search.tt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,15 @@
2626
</p>
2727

2828
<% FOREACH match IN item.matches %>
29+
<%
30+
SET line = 0;
31+
IF match.blocks && match.blocks.0 && match.blocks.0.matchlines && match.blocks.0.matchlines.0;
32+
line = match.blocks.0.matchlines.0;
33+
END;
34+
%>
2935
<p class="description">
3036
<a class="author" href="<% link_to_distro %>&amp;f=<% match.file | uri %>" title="grep on this file"><% match.file %></a>
37+
<a class="author" href="https://metacpan.org/release/<% item.distro | uri %>/source/<% match.file | url %>#L<% line | uri %>" title="view on Meta::CPAN"><i class="fa fa-book"></i>&nbsp;view on Meta::CPAN</a>
3138
<% FOREACH bl IN match.blocks %>
3239
<pre class="line-numbers" data-start="<% bl.start_at %>" data-line="<% bl.matchlines.join(',') %>"><code class="language-perl"><%= bl.code | html_entity -%></code></pre>
3340
<% END %>

0 commit comments

Comments
 (0)