~duncan-bayne/halp

45f23241e45bc52ba48aa9d8e564abe8a1d97f89 — Duncan Bayne 1 year, 3 months ago 4405910
Use consistent Atom terminology for feeds
2 files changed, 7 insertions(+), 7 deletions(-)

M lib/Halp/WebServer.pm
M www/templates/page.html.tpl
M lib/Halp/WebServer.pm => lib/Halp/WebServer.pm +6 -6
@@ 47,12 47,12 @@ sub generate_menu {
}

sub wrap_page_template {
    my ($self, $title, $content, $show_rss_link, $request_path, $local_path) = @_;
    my ($self, $title, $content, $show_atom_link, $request_path, $local_path) = @_;

    my $menu = $self->generate_menu($request_path);
    my $template_pathname = File::Spec->catfile($self->{template_path}, 'page.html.tpl');
    my $template = Text::Template->new(SOURCE => $template_pathname);
    my $rss_url = File::Spec->catfile($request_path, "feed.xml");
    my $atom_url = File::Spec->catfile($request_path, "feed.xml");

    my $footer = '';
    if (-f $local_path) {


@@ 62,9 62,9 @@ sub wrap_page_template {
	}
    }

    my $rss_feed = '';
    if ($show_rss_link) {
	$rss_feed = "<a href='$rss_url'><img class='feed-logo' src='/.static/images/atom.png' alt='Atom Feed'></a>";
    my $atom_feed = '';
    if ($show_atom_link) {
	$atom_feed = "<a href='$atom_url'><img class='feed-logo' src='/.static/images/atom.png' alt='Atom Feed'></a>";
    }

    my @stylesheets = [];


@@ 74,7 74,7 @@ sub wrap_page_template {
	@stylesheets = ['halp.css'];
    }

    my $result = $template->fill_in(HASH => {'title' => $title, 'content' => $content, 'menu' => $menu, 'rss_feed' => $rss_feed, 'stylesheets' => @stylesheets, 'footer' => $footer});
    my $result = $template->fill_in(HASH => {'title' => $title, 'content' => $content, 'menu' => $menu, 'atom_feed' => $atom_feed, 'stylesheets' => @stylesheets, 'footer' => $footer});

    return $result;
}

M www/templates/page.html.tpl => www/templates/page.html.tpl +1 -1
@@ 17,7 17,7 @@
    </nav>
    <main>
      <h1>
	{ $title }{ $rss_feed }
	{ $title }{ $atom_feed }
      </h1>
      { $content }
    </main>