~duncan-bayne/halp

da05c590ba116d3b5b60f869e577a904454ab2a6 — Duncan Bayne 6 months ago c784b51
Use the correct Web path for Atom feed generation
2 files changed, 3 insertions(+), 3 deletions(-)

M lib/Halp/AtomFeed.pm
M lib/Halp/WebServer.pm
M lib/Halp/AtomFeed.pm => lib/Halp/AtomFeed.pm +2 -2
@@ 11,7 11,7 @@ use Exporter 'import';
our @EXPORT = qw(feed_for);

sub feed_for {
    my ($request_path, $local_path, $domain, $author) = @_;
    my ($request_path, $local_path, $web_path, $domain, $author) = @_;

    my $current_timestamp = `date -u +"%Y-%m-%dT%H:%M:%SZ"`;
    chomp($current_timestamp);


@@ 31,7 31,7 @@ sub feed_for {
	my $full_path = $file->{filename};
	if (-f $full_path) {
	    my $contents = read_file($full_path);
	    my $feed_directory = dirname($full_path);
	    my $feed_directory = File::Spec->catfile($web_path, dirname($full_path));
	    my $updated_at = `cd $feed_directory; git log --reverse --pretty='format:%ad' --date=iso8601-strict -- $full_path | head -1`;
	    chomp($updated_at);


M lib/Halp/WebServer.pm => lib/Halp/WebServer.pm +1 -1
@@ 149,7 149,7 @@ sub handle_file {
sub handle_atom_feed {
    my ($self, $request_path, $local_path) = @_;

    my $atom_feed = feed_for($request_path, $local_path, $self->{domain}, $self->{author});
    my $atom_feed = feed_for($request_path, $local_path, $web_path, $self->{domain}, $self->{author});
    return {content_type => 'application/xml+atom', content => $atom_feed};
}