...
|
...
|
@@ -77,31 +77,35 @@
|
77
|
77
|
# Create atom feed
|
78
|
78
|
my $commit_title = $commit->{title};
|
79
|
79
|
$commit_title = Mojo::Util::xml_escape
|
80
|
|
- my $url = url_with->to_abs;
|
81
|
|
- my $url_no_atom = $url;
|
82
|
|
- $url_no_atom =~ s/\.atom$//;
|
|
80
|
+
|
|
81
|
+ my $alternate_url = url_with;
|
|
82
|
+ my $alternate_url_path_parts = $alternate_url->path->parts;
|
|
83
|
+ $alternate_url_path_parts->[-1] =~ s/\.atom$//;
|
|
84
|
+
|
83
|
85
|
#%>
|
84
|
86
|
<?xml version="1.0" encoding="UTF-8" ?>
|
85
|
87
|
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xml:lang="en-US">
|
86
|
88
|
<id>tag:gitprep,2008:/<%= $user %>/<%= $project %>/commits/<%= $rev_file %></id>
|
87
|
|
- <link type="text/html" rel="alternate" href="<%= $url_no_atom %>"/>
|
88
|
|
- <link type="application/atom+xml" rel="self" href="<%= $url %>"/>
|
|
89
|
+ <link type="text/html" rel="alternate" href="<%= $alternate_url->to_abs %>"/>
|
|
90
|
+ <link type="application/atom+xml" rel="self" href="<%= url_with->to_abs %>"/>
|
89
|
91
|
<title>Recent Commits to <%= "$project:$rev" %></title>
|
90
|
92
|
<updated><%= $commits->[0]->{updated} %></updated>
|
91
|
93
|
|
92
|
94
|
% for my $commit (@$commits) {
|
93
|
|
- % my $author_uri = url_for->base->to_abs . "/$user";
|
94
|
|
- % my $link_href = url_for->base->to_abs . "/$user/$project/commit/$commit->{id}";
|
|
95
|
+ % my $author_url = url_for;
|
|
96
|
+ % $author_url->path->parts([$user]);
|
|
97
|
+ % my $entry_alternate_url = url_for;
|
|
98
|
+ % $entry_alternate_url->path->parts([$user, $project, 'commit', $commit->{id}]);
|
95
|
99
|
<entry>
|
96
|
100
|
<id>tag:gitprep,2008:Grit::Commit/<%= $commit->{id} %></id>
|
97
|
|
- <link type="text/html" rel="alternate" href="<%= $link_href %>"/>
|
|
101
|
+ <link type="text/html" rel="alternate" href="<%= $entry_alternate_url->to_abs %>"/>
|
98
|
102
|
<title>
|
99
|
103
|
<%= $commit->{title} %>
|
100
|
104
|
</title>
|
101
|
105
|
<updated><%= $commit->{updated} %></updated>
|
102
|
106
|
<author>
|
103
|
107
|
<name><%= $user %></name>
|
104
|
|
- <uri><%= $author_uri %></uri>
|
|
108
|
+ <uri><%= $author_url->to_abs %></uri>
|
105
|
109
|
</author>
|
106
|
110
|
<content type="html">
|
107
|
111
|
<%= "<pre style='white-space:pre-wrap;width:81ex'>$commit->{title}</pre>" %>
|